windows-pr 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +444 -438
- data/MANIFEST +68 -65
- data/README +154 -153
- data/Rakefile +42 -37
- data/doc/conversion_guide.txt +37 -37
- data/lib/windows/clipboard.rb +61 -61
- data/lib/windows/com.rb +192 -192
- data/lib/windows/com/accessibility.rb +16 -16
- data/lib/windows/com/automation.rb +149 -149
- data/lib/windows/com/variant.rb +24 -24
- data/lib/windows/console.rb +114 -114
- data/lib/windows/debug.rb +35 -35
- data/lib/windows/device_io.rb +248 -248
- data/lib/windows/directory.rb +27 -27
- data/lib/windows/error.rb +504 -498
- data/lib/windows/eventlog.rb +80 -80
- data/lib/windows/file.rb +264 -264
- data/lib/windows/file_mapping.rb +25 -25
- data/lib/windows/filesystem.rb +15 -15
- data/lib/windows/gdi/bitmap.rb +65 -65
- data/lib/windows/gdi/device_context.rb +46 -46
- data/lib/windows/gdi/metafile.rb +40 -40
- data/lib/windows/gdi/painting_drawing.rb +115 -115
- data/lib/windows/handle.rb +23 -23
- data/lib/windows/library.rb +44 -44
- data/lib/windows/limits.rb +34 -34
- data/lib/windows/mailslot.rb +24 -24
- data/lib/windows/memory.rb +128 -128
- data/lib/windows/msvcrt/buffer.rb +75 -75
- data/lib/windows/msvcrt/directory.rb +31 -31
- data/lib/windows/msvcrt/file.rb +47 -47
- data/lib/windows/msvcrt/io.rb +73 -73
- data/lib/windows/msvcrt/string.rb +182 -182
- data/lib/windows/msvcrt/time.rb +169 -169
- data/lib/windows/national.rb +580 -580
- data/lib/windows/network/management.rb +525 -525
- data/lib/windows/network/snmp.rb +92 -92
- data/lib/windows/network/winsock.rb +128 -128
- data/lib/windows/nio.rb +50 -50
- data/lib/windows/ntfs/winternl.rb +117 -117
- data/lib/windows/path.rb +143 -143
- data/lib/windows/pipe.rb +42 -42
- data/lib/windows/process.rb +176 -176
- data/lib/windows/registry.rb +171 -171
- data/lib/windows/security.rb +479 -479
- data/lib/windows/security/authentication.rb +32 -32
- data/lib/windows/security/sspi.rb +153 -0
- data/lib/windows/service.rb +142 -142
- data/lib/windows/shell.rb +171 -171
- data/lib/windows/socket.rb +86 -86
- data/lib/windows/sound.rb +39 -39
- data/lib/windows/synchronize.rb +133 -133
- data/lib/windows/system_info.rb +229 -229
- data/lib/windows/thread.rb +64 -64
- data/lib/windows/time.rb +48 -48
- data/lib/windows/tool_helper.rb +36 -36
- data/lib/windows/unicode.rb +155 -155
- data/lib/windows/volume.rb +61 -61
- data/lib/windows/window.rb +81 -81
- data/lib/windows/window/classes.rb +59 -59
- data/lib/windows/window/dialog.rb +91 -91
- data/lib/windows/window/menu.rb +102 -102
- data/lib/windows/window/message.rb +297 -297
- data/lib/windows/window/properties.rb +20 -20
- data/lib/windows/window/timer.rb +19 -19
- data/lib/windows/wsa.rb +102 -102
- data/test/tc_clipboard.rb +41 -41
- data/test/tc_com.rb +32 -32
- data/test/tc_com_automation.rb +15 -15
- data/test/tc_console.rb +108 -108
- data/test/tc_debug.rb +48 -48
- data/test/tc_device_io.rb +29 -29
- data/test/tc_directory.rb +25 -25
- data/test/tc_error.rb +38 -38
- data/test/tc_eventlog.rb +58 -58
- data/test/tc_file.rb +67 -67
- data/test/tc_file_mapping.rb +38 -38
- data/test/tc_filesystem.rb +27 -27
- data/test/tc_gdi_bitmap.rb +25 -25
- data/test/tc_gdi_metafile.rb +23 -23
- data/test/tc_handle.rb +36 -36
- data/test/tc_library.rb +37 -37
- data/test/tc_limits.rb +34 -34
- data/test/tc_mailslot.rb +22 -22
- data/test/tc_memory.rb +44 -44
- data/test/tc_msvcrt_buffer.rb +63 -63
- data/test/tc_msvcrt_directory.rb +96 -96
- data/test/tc_msvcrt_file.rb +80 -80
- data/test/tc_msvcrt_io.rb +48 -48
- data/test/tc_msvcrt_string.rb +94 -94
- data/test/tc_msvcrt_time.rb +19 -19
- data/test/tc_national.rb +38 -38
- data/test/tc_network_management.rb +32 -32
- data/test/tc_network_snmp.rb +31 -31
- data/test/tc_network_winsock.rb +34 -34
- data/test/tc_nio.rb +32 -32
- data/test/tc_ntfs_winternl.rb +48 -48
- data/test/tc_path.rb +90 -90
- data/test/tc_pipe.rb +53 -53
- data/test/tc_process.rb +24 -24
- data/test/tc_registry.rb +29 -29
- data/test/tc_security.rb +104 -104
- data/test/tc_security_authentication.rb +34 -34
- data/test/tc_security_sspi.rb +23 -0
- data/test/tc_service.rb +57 -57
- data/test/tc_shell.rb +34 -34
- data/test/tc_socket.rb +20 -20
- data/test/tc_sound.rb +37 -37
- data/test/tc_synchronize.rb +75 -75
- data/test/tc_system_info.rb +33 -33
- data/test/tc_thread.rb +29 -29
- data/test/tc_time.rb +32 -32
- data/test/tc_tool_helper.rb +29 -29
- data/test/tc_unicode.rb +83 -83
- data/test/tc_volume.rb +47 -47
- data/test/tc_window.rb +45 -45
- data/test/tc_window_classes.rb +33 -33
- data/test/tc_window_dialog.rb +33 -33
- data/test/tc_window_menu.rb +29 -29
- data/test/tc_window_message.rb +33 -33
- data/test/tc_window_properties.rb +29 -29
- data/test/tc_window_timer.rb +29 -29
- data/test/tc_wsa.rb +19 -19
- data/windows-pr.gemspec +33 -34
- metadata +31 -32
@@ -1,34 +1,34 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_security_authentication.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Security::Authentication module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/security/authentication'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class TC_Windows_Security_Authentication < Test::Unit::TestCase
|
10
|
-
|
11
|
-
include Windows::Security::Authentication
|
12
|
-
|
13
|
-
def test_methods
|
14
|
-
assert_respond_to(self, :LsaOpenPolicy)
|
15
|
-
assert_respond_to(self, :LsaClose)
|
16
|
-
assert_respond_to(self, :LsaNtStatusToWinError)
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_constants
|
20
|
-
assert_not_nil(POLICY_VIEW_LOCAL_INFORMATION)
|
21
|
-
assert_not_nil(POLICY_VIEW_AUDIT_INFORMATION)
|
22
|
-
assert_not_nil(POLICY_GET_PRIVATE_INFORMATION)
|
23
|
-
assert_not_nil(POLICY_TRUST_ADMIN)
|
24
|
-
assert_not_nil(POLICY_CREATE_ACCOUNT)
|
25
|
-
assert_not_nil(POLICY_CREATE_SECRET)
|
26
|
-
assert_not_nil(POLICY_CREATE_PRIVILEGE)
|
27
|
-
assert_not_nil(POLICY_SET_DEFAULT_QUOTA_LIMITS)
|
28
|
-
assert_not_nil(POLICY_SET_AUDIT_REQUIREMENTS)
|
29
|
-
assert_not_nil(POLICY_AUDIT_LOG_ADMIN)
|
30
|
-
assert_not_nil(POLICY_SERVER_ADMIN)
|
31
|
-
assert_not_nil(POLICY_LOOKUP_NAMES)
|
32
|
-
assert_not_nil(POLICY_NOTIFICATION)
|
33
|
-
end
|
34
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_security_authentication.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Security::Authentication module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/security/authentication'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class TC_Windows_Security_Authentication < Test::Unit::TestCase
|
10
|
+
|
11
|
+
include Windows::Security::Authentication
|
12
|
+
|
13
|
+
def test_methods
|
14
|
+
assert_respond_to(self, :LsaOpenPolicy)
|
15
|
+
assert_respond_to(self, :LsaClose)
|
16
|
+
assert_respond_to(self, :LsaNtStatusToWinError)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_constants
|
20
|
+
assert_not_nil(POLICY_VIEW_LOCAL_INFORMATION)
|
21
|
+
assert_not_nil(POLICY_VIEW_AUDIT_INFORMATION)
|
22
|
+
assert_not_nil(POLICY_GET_PRIVATE_INFORMATION)
|
23
|
+
assert_not_nil(POLICY_TRUST_ADMIN)
|
24
|
+
assert_not_nil(POLICY_CREATE_ACCOUNT)
|
25
|
+
assert_not_nil(POLICY_CREATE_SECRET)
|
26
|
+
assert_not_nil(POLICY_CREATE_PRIVILEGE)
|
27
|
+
assert_not_nil(POLICY_SET_DEFAULT_QUOTA_LIMITS)
|
28
|
+
assert_not_nil(POLICY_SET_AUDIT_REQUIREMENTS)
|
29
|
+
assert_not_nil(POLICY_AUDIT_LOG_ADMIN)
|
30
|
+
assert_not_nil(POLICY_SERVER_ADMIN)
|
31
|
+
assert_not_nil(POLICY_LOOKUP_NAMES)
|
32
|
+
assert_not_nil(POLICY_NOTIFICATION)
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_security_sspi.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Security::SSPI module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/security/SSPI'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class TC_Windows_Security_SSPI < Test::Unit::TestCase
|
10
|
+
include Windows::Security::SSPI
|
11
|
+
|
12
|
+
def test_methods
|
13
|
+
assert_respond_to(self, :AcceptSecurityContext)
|
14
|
+
assert_respond_to(self, :AcquireCredentialsHandle)
|
15
|
+
assert_respond_to(self, :FreeCredentialsHandle)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_constants
|
19
|
+
assert_not_nil(SECPKG_CRED_INBOUND)
|
20
|
+
assert_not_nil(SECPKG_CRED_OUTBOUND)
|
21
|
+
assert_not_nil(SECPKG_CRED_BOTH)
|
22
|
+
end
|
23
|
+
end
|
data/test/tc_service.rb
CHANGED
@@ -1,57 +1,57 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_service.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Service module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/service'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class ServiceFoo
|
10
|
-
include Windows::Service
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Service < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = ServiceFoo.new
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_numeric_constants
|
19
|
-
assert_equal(0, ServiceFoo::SC_ACTION_NONE)
|
20
|
-
assert_equal(1, ServiceFoo::SC_ACTION_RESTART)
|
21
|
-
assert_equal(2, ServiceFoo::SC_ACTION_REBOOT)
|
22
|
-
assert_equal(3, ServiceFoo::SC_ACTION_RUN_COMMAND)
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_method_constants
|
26
|
-
assert_not_nil(ServiceFoo::ChangeServiceConfig)
|
27
|
-
assert_not_nil(ServiceFoo::ChangeServiceConfig2)
|
28
|
-
assert_not_nil(ServiceFoo::CloseServiceHandle)
|
29
|
-
assert_not_nil(ServiceFoo::ControlService)
|
30
|
-
assert_not_nil(ServiceFoo::CreateService)
|
31
|
-
assert_not_nil(ServiceFoo::DeleteService)
|
32
|
-
assert_not_nil(ServiceFoo::EnumDependentServices)
|
33
|
-
assert_not_nil(ServiceFoo::EnumServicesStatus)
|
34
|
-
assert_not_nil(ServiceFoo::EnumServicesStatusEx)
|
35
|
-
assert_not_nil(ServiceFoo::GetServiceDisplayName)
|
36
|
-
assert_not_nil(ServiceFoo::GetServiceKeyName)
|
37
|
-
assert_not_nil(ServiceFoo::LockServiceDatabase)
|
38
|
-
assert_not_nil(ServiceFoo::NotifyBootConfigStatus)
|
39
|
-
assert_not_nil(ServiceFoo::OpenSCManager)
|
40
|
-
assert_not_nil(ServiceFoo::OpenService)
|
41
|
-
assert_not_nil(ServiceFoo::QueryServiceConfig)
|
42
|
-
assert_not_nil(ServiceFoo::QueryServiceConfig2)
|
43
|
-
assert_not_nil(ServiceFoo::QueryServiceStatus)
|
44
|
-
assert_not_nil(ServiceFoo::QueryServiceStatusEx)
|
45
|
-
assert_not_nil(ServiceFoo::RegisterServiceCtrlHandler)
|
46
|
-
assert_not_nil(ServiceFoo::RegisterServiceCtrlHandlerEx)
|
47
|
-
assert_not_nil(ServiceFoo::SetServiceBits)
|
48
|
-
assert_not_nil(ServiceFoo::SetServiceStatus)
|
49
|
-
assert_not_nil(ServiceFoo::StartService)
|
50
|
-
assert_not_nil(ServiceFoo::StartServiceCtrlDispatcher)
|
51
|
-
assert_not_nil(ServiceFoo::UnlockServiceDatabase)
|
52
|
-
end
|
53
|
-
|
54
|
-
def teardown
|
55
|
-
@foo = nil
|
56
|
-
end
|
57
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_service.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Service module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/service'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class ServiceFoo
|
10
|
+
include Windows::Service
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Service < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = ServiceFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0, ServiceFoo::SC_ACTION_NONE)
|
20
|
+
assert_equal(1, ServiceFoo::SC_ACTION_RESTART)
|
21
|
+
assert_equal(2, ServiceFoo::SC_ACTION_REBOOT)
|
22
|
+
assert_equal(3, ServiceFoo::SC_ACTION_RUN_COMMAND)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_method_constants
|
26
|
+
assert_not_nil(ServiceFoo::ChangeServiceConfig)
|
27
|
+
assert_not_nil(ServiceFoo::ChangeServiceConfig2)
|
28
|
+
assert_not_nil(ServiceFoo::CloseServiceHandle)
|
29
|
+
assert_not_nil(ServiceFoo::ControlService)
|
30
|
+
assert_not_nil(ServiceFoo::CreateService)
|
31
|
+
assert_not_nil(ServiceFoo::DeleteService)
|
32
|
+
assert_not_nil(ServiceFoo::EnumDependentServices)
|
33
|
+
assert_not_nil(ServiceFoo::EnumServicesStatus)
|
34
|
+
assert_not_nil(ServiceFoo::EnumServicesStatusEx)
|
35
|
+
assert_not_nil(ServiceFoo::GetServiceDisplayName)
|
36
|
+
assert_not_nil(ServiceFoo::GetServiceKeyName)
|
37
|
+
assert_not_nil(ServiceFoo::LockServiceDatabase)
|
38
|
+
assert_not_nil(ServiceFoo::NotifyBootConfigStatus)
|
39
|
+
assert_not_nil(ServiceFoo::OpenSCManager)
|
40
|
+
assert_not_nil(ServiceFoo::OpenService)
|
41
|
+
assert_not_nil(ServiceFoo::QueryServiceConfig)
|
42
|
+
assert_not_nil(ServiceFoo::QueryServiceConfig2)
|
43
|
+
assert_not_nil(ServiceFoo::QueryServiceStatus)
|
44
|
+
assert_not_nil(ServiceFoo::QueryServiceStatusEx)
|
45
|
+
assert_not_nil(ServiceFoo::RegisterServiceCtrlHandler)
|
46
|
+
assert_not_nil(ServiceFoo::RegisterServiceCtrlHandlerEx)
|
47
|
+
assert_not_nil(ServiceFoo::SetServiceBits)
|
48
|
+
assert_not_nil(ServiceFoo::SetServiceStatus)
|
49
|
+
assert_not_nil(ServiceFoo::StartService)
|
50
|
+
assert_not_nil(ServiceFoo::StartServiceCtrlDispatcher)
|
51
|
+
assert_not_nil(ServiceFoo::UnlockServiceDatabase)
|
52
|
+
end
|
53
|
+
|
54
|
+
def teardown
|
55
|
+
@foo = nil
|
56
|
+
end
|
57
|
+
end
|
data/test/tc_shell.rb
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_shell.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Shell module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/shell'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class ShellFoo
|
10
|
-
include Windows::Shell
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Shell < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = ShellFoo.new
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_numeric_constants
|
19
|
-
assert_equal(0, ShellFoo::CSIDL_DESKTOP)
|
20
|
-
assert_equal(1, ShellFoo::CSIDL_INTERNET)
|
21
|
-
assert_equal(2, ShellFoo::CSIDL_PROGRAMS)
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_method_constants
|
25
|
-
assert_not_nil(ShellFoo::DragQueryFile)
|
26
|
-
assert_not_nil(ShellFoo::ExtractIcon)
|
27
|
-
assert_not_nil(ShellFoo::ExtractIconEx)
|
28
|
-
assert_not_nil(ShellFoo::ShellAbout)
|
29
|
-
end
|
30
|
-
|
31
|
-
def teardown
|
32
|
-
@foo = nil
|
33
|
-
end
|
34
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_shell.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Shell module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/shell'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class ShellFoo
|
10
|
+
include Windows::Shell
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Shell < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = ShellFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0, ShellFoo::CSIDL_DESKTOP)
|
20
|
+
assert_equal(1, ShellFoo::CSIDL_INTERNET)
|
21
|
+
assert_equal(2, ShellFoo::CSIDL_PROGRAMS)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_method_constants
|
25
|
+
assert_not_nil(ShellFoo::DragQueryFile)
|
26
|
+
assert_not_nil(ShellFoo::ExtractIcon)
|
27
|
+
assert_not_nil(ShellFoo::ExtractIconEx)
|
28
|
+
assert_not_nil(ShellFoo::ShellAbout)
|
29
|
+
end
|
30
|
+
|
31
|
+
def teardown
|
32
|
+
@foo = nil
|
33
|
+
end
|
34
|
+
end
|
data/test/tc_socket.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_socket.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Socket module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/socket'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class TC_Windows_Socket < Test::Unit::TestCase
|
10
|
-
include Windows::Socket
|
11
|
-
|
12
|
-
def test_methods
|
13
|
-
assert_respond_to(self, :accept)
|
14
|
-
assert_respond_to(self, :AcceptEx)
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_constants
|
18
|
-
assert_equal(0, IPPROTO_IP)
|
19
|
-
end
|
20
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_socket.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Socket module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/socket'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class TC_Windows_Socket < Test::Unit::TestCase
|
10
|
+
include Windows::Socket
|
11
|
+
|
12
|
+
def test_methods
|
13
|
+
assert_respond_to(self, :accept)
|
14
|
+
assert_respond_to(self, :AcceptEx)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_constants
|
18
|
+
assert_equal(0, IPPROTO_IP)
|
19
|
+
end
|
20
|
+
end
|
data/test/tc_sound.rb
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_sound.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Sound module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/sound'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class SoundFoo
|
10
|
-
include Windows::Sound
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Sound < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = SoundFoo.new
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_numeric_constants
|
19
|
-
assert_equal(0, SoundFoo::SND_SYNC)
|
20
|
-
assert_equal(1, SoundFoo::SND_ASYNC)
|
21
|
-
assert_equal(2, SoundFoo::SND_NODEFAULT)
|
22
|
-
assert_equal(4, SoundFoo::SND_MEMORY)
|
23
|
-
assert_equal(8, SoundFoo::SND_LOOP)
|
24
|
-
assert_equal(16, SoundFoo::SND_NOSTOP)
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_method_constants
|
28
|
-
assert_not_nil(SoundFoo::Beep)
|
29
|
-
assert_not_nil(SoundFoo::PlaySound)
|
30
|
-
assert_not_nil(SoundFoo::WaveOutSetVolume)
|
31
|
-
assert_not_nil(SoundFoo::WaveOutGetVolume)
|
32
|
-
end
|
33
|
-
|
34
|
-
def teardown
|
35
|
-
@foo = nil
|
36
|
-
end
|
37
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_sound.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Sound module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/sound'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class SoundFoo
|
10
|
+
include Windows::Sound
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Sound < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = SoundFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0, SoundFoo::SND_SYNC)
|
20
|
+
assert_equal(1, SoundFoo::SND_ASYNC)
|
21
|
+
assert_equal(2, SoundFoo::SND_NODEFAULT)
|
22
|
+
assert_equal(4, SoundFoo::SND_MEMORY)
|
23
|
+
assert_equal(8, SoundFoo::SND_LOOP)
|
24
|
+
assert_equal(16, SoundFoo::SND_NOSTOP)
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_method_constants
|
28
|
+
assert_not_nil(SoundFoo::Beep)
|
29
|
+
assert_not_nil(SoundFoo::PlaySound)
|
30
|
+
assert_not_nil(SoundFoo::WaveOutSetVolume)
|
31
|
+
assert_not_nil(SoundFoo::WaveOutGetVolume)
|
32
|
+
end
|
33
|
+
|
34
|
+
def teardown
|
35
|
+
@foo = nil
|
36
|
+
end
|
37
|
+
end
|
data/test/tc_synchronize.rb
CHANGED
@@ -1,75 +1,75 @@
|
|
1
|
-
##################################################################
|
2
|
-
# tc_synchronize.rb
|
3
|
-
#
|
4
|
-
# Test case for the windows/synchronize package.
|
5
|
-
##################################################################
|
6
|
-
require "windows/synchronize"
|
7
|
-
require "test/unit"
|
8
|
-
|
9
|
-
class TC_Windows_Synchronize < Test::Unit::TestCase
|
10
|
-
include Windows::Synchronize
|
11
|
-
|
12
|
-
def setup
|
13
|
-
@handle = (0.chr * 16).unpack('LLLL')
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_numeric_constants
|
17
|
-
assert_not_nil(INFINITE)
|
18
|
-
assert_not_nil(WAIT_OBJECT_0)
|
19
|
-
assert_not_nil(WAIT_TIMEOUT)
|
20
|
-
assert_not_nil(WAIT_ABANDONED)
|
21
|
-
assert_not_nil(WAIT_FAILED)
|
22
|
-
assert_not_nil(QS_ALLEVENTS)
|
23
|
-
assert_not_nil(QS_ALLINPUT)
|
24
|
-
assert_not_nil(QS_ALLPOSTMESSAGE)
|
25
|
-
assert_not_nil(QS_HOTKEY)
|
26
|
-
assert_not_nil(QS_INPUT)
|
27
|
-
assert_not_nil(QS_KEY)
|
28
|
-
assert_not_nil(QS_MOUSE)
|
29
|
-
assert_not_nil(QS_MOUSEBUTTON)
|
30
|
-
assert_not_nil(QS_MOUSEMOVE)
|
31
|
-
assert_not_nil(QS_PAINT)
|
32
|
-
assert_not_nil(QS_POSTMESSAGE)
|
33
|
-
assert_not_nil(QS_RAWINPUT)
|
34
|
-
assert_not_nil(QS_SENDMESSAGE)
|
35
|
-
assert_not_nil(QS_TIMER)
|
36
|
-
assert_not_nil(MWMO_ALERTABLE)
|
37
|
-
assert_not_nil(MWMO_INPUTAVAILABLE)
|
38
|
-
assert_not_nil(MWMO_WAITALL)
|
39
|
-
assert_not_nil(EVENT_ALL_ACCESS)
|
40
|
-
assert_not_nil(EVENT_MODIFY_STATE)
|
41
|
-
assert_not_nil(MUTEX_ALL_ACCESS)
|
42
|
-
assert_not_nil(MUTEX_MODIFY_STATE)
|
43
|
-
assert_not_nil(SEMAPHORE_ALL_ACCESS)
|
44
|
-
assert_not_nil(SEMAPHORE_MODIFY_STATE)
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_method_constants
|
48
|
-
assert_not_nil(CreateEvent)
|
49
|
-
assert_not_nil(CreateMutex)
|
50
|
-
assert_not_nil(CreateSemaphore)
|
51
|
-
assert_not_nil(DeleteCriticalSection)
|
52
|
-
assert_not_nil(EnterCriticalSection)
|
53
|
-
assert_not_nil(GetOverlappedResult)
|
54
|
-
assert_not_nil(InitializeCriticalSection)
|
55
|
-
assert_not_nil(InitializeCriticalSectionAndSpinCount)
|
56
|
-
assert_not_nil(LeaveCriticalSection)
|
57
|
-
assert_not_nil(MsgWaitForMultipleObjects)
|
58
|
-
assert_not_nil(MsgWaitForMultipleObjectsEx)
|
59
|
-
assert_not_nil(OpenEvent)
|
60
|
-
assert_not_nil(OpenMutex)
|
61
|
-
assert_not_nil(OpenSemaphore)
|
62
|
-
assert_not_nil(ReleaseMutex)
|
63
|
-
assert_not_nil(ReleaseSemaphore)
|
64
|
-
assert_not_nil(ResetEvent)
|
65
|
-
assert_not_nil(SetEvent)
|
66
|
-
assert_not_nil(WaitForMultipleObjects)
|
67
|
-
assert_not_nil(WaitForMultipleObjectsEx)
|
68
|
-
assert_not_nil(WaitForSingleObject)
|
69
|
-
assert_not_nil(WaitForSingleObjectEx)
|
70
|
-
end
|
71
|
-
|
72
|
-
def teardown
|
73
|
-
@handle = nil
|
74
|
-
end
|
75
|
-
end
|
1
|
+
##################################################################
|
2
|
+
# tc_synchronize.rb
|
3
|
+
#
|
4
|
+
# Test case for the windows/synchronize package.
|
5
|
+
##################################################################
|
6
|
+
require "windows/synchronize"
|
7
|
+
require "test/unit"
|
8
|
+
|
9
|
+
class TC_Windows_Synchronize < Test::Unit::TestCase
|
10
|
+
include Windows::Synchronize
|
11
|
+
|
12
|
+
def setup
|
13
|
+
@handle = (0.chr * 16).unpack('LLLL')
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_numeric_constants
|
17
|
+
assert_not_nil(INFINITE)
|
18
|
+
assert_not_nil(WAIT_OBJECT_0)
|
19
|
+
assert_not_nil(WAIT_TIMEOUT)
|
20
|
+
assert_not_nil(WAIT_ABANDONED)
|
21
|
+
assert_not_nil(WAIT_FAILED)
|
22
|
+
assert_not_nil(QS_ALLEVENTS)
|
23
|
+
assert_not_nil(QS_ALLINPUT)
|
24
|
+
assert_not_nil(QS_ALLPOSTMESSAGE)
|
25
|
+
assert_not_nil(QS_HOTKEY)
|
26
|
+
assert_not_nil(QS_INPUT)
|
27
|
+
assert_not_nil(QS_KEY)
|
28
|
+
assert_not_nil(QS_MOUSE)
|
29
|
+
assert_not_nil(QS_MOUSEBUTTON)
|
30
|
+
assert_not_nil(QS_MOUSEMOVE)
|
31
|
+
assert_not_nil(QS_PAINT)
|
32
|
+
assert_not_nil(QS_POSTMESSAGE)
|
33
|
+
assert_not_nil(QS_RAWINPUT)
|
34
|
+
assert_not_nil(QS_SENDMESSAGE)
|
35
|
+
assert_not_nil(QS_TIMER)
|
36
|
+
assert_not_nil(MWMO_ALERTABLE)
|
37
|
+
assert_not_nil(MWMO_INPUTAVAILABLE)
|
38
|
+
assert_not_nil(MWMO_WAITALL)
|
39
|
+
assert_not_nil(EVENT_ALL_ACCESS)
|
40
|
+
assert_not_nil(EVENT_MODIFY_STATE)
|
41
|
+
assert_not_nil(MUTEX_ALL_ACCESS)
|
42
|
+
assert_not_nil(MUTEX_MODIFY_STATE)
|
43
|
+
assert_not_nil(SEMAPHORE_ALL_ACCESS)
|
44
|
+
assert_not_nil(SEMAPHORE_MODIFY_STATE)
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_method_constants
|
48
|
+
assert_not_nil(CreateEvent)
|
49
|
+
assert_not_nil(CreateMutex)
|
50
|
+
assert_not_nil(CreateSemaphore)
|
51
|
+
assert_not_nil(DeleteCriticalSection)
|
52
|
+
assert_not_nil(EnterCriticalSection)
|
53
|
+
assert_not_nil(GetOverlappedResult)
|
54
|
+
assert_not_nil(InitializeCriticalSection)
|
55
|
+
assert_not_nil(InitializeCriticalSectionAndSpinCount)
|
56
|
+
assert_not_nil(LeaveCriticalSection)
|
57
|
+
assert_not_nil(MsgWaitForMultipleObjects)
|
58
|
+
assert_not_nil(MsgWaitForMultipleObjectsEx)
|
59
|
+
assert_not_nil(OpenEvent)
|
60
|
+
assert_not_nil(OpenMutex)
|
61
|
+
assert_not_nil(OpenSemaphore)
|
62
|
+
assert_not_nil(ReleaseMutex)
|
63
|
+
assert_not_nil(ReleaseSemaphore)
|
64
|
+
assert_not_nil(ResetEvent)
|
65
|
+
assert_not_nil(SetEvent)
|
66
|
+
assert_not_nil(WaitForMultipleObjects)
|
67
|
+
assert_not_nil(WaitForMultipleObjectsEx)
|
68
|
+
assert_not_nil(WaitForSingleObject)
|
69
|
+
assert_not_nil(WaitForSingleObjectEx)
|
70
|
+
end
|
71
|
+
|
72
|
+
def teardown
|
73
|
+
@handle = nil
|
74
|
+
end
|
75
|
+
end
|