windows-pr 1.1.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +15 -0
- data/MANIFEST +65 -65
- data/README +149 -149
- data/Rakefile +37 -52
- data/doc/conversion_guide.txt +37 -37
- data/lib/windows/clipboard.rb +2 -0
- data/lib/windows/com.rb +2 -0
- data/lib/windows/com/accessibility.rb +12 -10
- data/lib/windows/com/automation.rb +149 -147
- data/lib/windows/com/variant.rb +24 -22
- data/lib/windows/console.rb +114 -112
- data/lib/windows/debug.rb +35 -33
- data/lib/windows/device_io.rb +248 -246
- data/lib/windows/directory.rb +2 -0
- data/lib/windows/error.rb +2 -0
- data/lib/windows/eventlog.rb +2 -0
- data/lib/windows/file.rb +264 -262
- data/lib/windows/file_mapping.rb +25 -23
- data/lib/windows/filesystem.rb +2 -0
- data/lib/windows/gdi/bitmap.rb +65 -63
- data/lib/windows/gdi/device_context.rb +46 -44
- data/lib/windows/gdi/metafile.rb +40 -38
- data/lib/windows/gdi/painting_drawing.rb +115 -113
- data/lib/windows/handle.rb +2 -0
- data/lib/windows/library.rb +2 -0
- data/lib/windows/limits.rb +34 -31
- data/lib/windows/mailslot.rb +2 -0
- data/lib/windows/memory.rb +2 -0
- data/lib/windows/msvcrt/buffer.rb +75 -73
- data/lib/windows/msvcrt/directory.rb +31 -29
- data/lib/windows/msvcrt/file.rb +47 -45
- data/lib/windows/msvcrt/io.rb +62 -60
- data/lib/windows/msvcrt/string.rb +2 -0
- data/lib/windows/msvcrt/time.rb +169 -167
- data/lib/windows/national.rb +580 -578
- data/lib/windows/network/management.rb +525 -523
- data/lib/windows/network/snmp.rb +92 -90
- data/lib/windows/network/winsock.rb +128 -126
- data/lib/windows/nio.rb +2 -0
- data/lib/windows/ntfs/winternl.rb +96 -82
- data/lib/windows/path.rb +143 -141
- data/lib/windows/pipe.rb +42 -40
- data/lib/windows/process.rb +2 -0
- data/lib/windows/registry.rb +171 -126
- data/lib/windows/security.rb +479 -477
- data/lib/windows/security/authentication.rb +32 -30
- data/lib/windows/service.rb +142 -140
- data/lib/windows/shell.rb +171 -169
- data/lib/windows/socket.rb +86 -0
- data/lib/windows/sound.rb +39 -37
- data/lib/windows/synchronize.rb +133 -131
- data/lib/windows/system_info.rb +4 -2
- data/lib/windows/thread.rb +2 -0
- data/lib/windows/time.rb +48 -46
- data/lib/windows/tool_helper.rb +36 -34
- data/lib/windows/unicode.rb +2 -0
- data/lib/windows/volume.rb +61 -59
- data/lib/windows/window.rb +81 -79
- data/lib/windows/window/classes.rb +59 -57
- data/lib/windows/window/dialog.rb +91 -89
- data/lib/windows/window/menu.rb +102 -100
- data/lib/windows/window/message.rb +297 -295
- data/lib/windows/window/properties.rb +20 -18
- data/lib/windows/window/timer.rb +19 -17
- data/lib/windows/wsa.rb +102 -0
- 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 -50
- 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 +59 -68
- data/test/tc_msvcrt_directory.rb +96 -98
- data/test/tc_msvcrt_file.rb +80 -80
- data/test/tc_msvcrt_io.rb +48 -48
- data/test/tc_msvcrt_string.rb +94 -93
- data/test/tc_msvcrt_time.rb +19 -29
- 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 +33 -18
- 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_service.rb +57 -57
- data/test/tc_shell.rb +34 -34
- data/test/tc_socket.rb +20 -0
- data/test/tc_sound.rb +37 -37
- data/test/tc_synchronize.rb +75 -75
- data/test/tc_system_info.rb +33 -43
- 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 +62 -62
- 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 -0
- data/windows-pr.gemspec +1 -1
- metadata +13 -7
data/test/tc_pipe.rb
CHANGED
@@ -1,53 +1,53 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_pipe.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Pipe module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/pipe'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class PipeFoo
|
10
|
-
include Windows::Pipe
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Pipe < Test::Unit::TestCase
|
14
|
-
|
15
|
-
def setup
|
16
|
-
@foo = PipeFoo.new
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_numeric_constants
|
20
|
-
assert_equal(0x00000001, PipeFoo::NMPWAIT_NOWAIT)
|
21
|
-
assert_equal(0xffffffff, PipeFoo::NMPWAIT_WAIT_FOREVER)
|
22
|
-
assert_equal(0x00000000, PipeFoo::NMPWAIT_USE_DEFAULT_WAIT)
|
23
|
-
assert_equal(0x00000000, PipeFoo::PIPE_WAIT)
|
24
|
-
assert_equal(0x00000001, PipeFoo::PIPE_NOWAIT)
|
25
|
-
assert_equal(0x00000001, PipeFoo::PIPE_ACCESS_INBOUND)
|
26
|
-
assert_equal(0x00000002, PipeFoo::PIPE_ACCESS_OUTBOUND)
|
27
|
-
assert_equal(0x00000003, PipeFoo::PIPE_ACCESS_DUPLEX)
|
28
|
-
assert_equal(0x00000000, PipeFoo::PIPE_TYPE_BYTE)
|
29
|
-
assert_equal(0x00000004, PipeFoo::PIPE_TYPE_MESSAGE)
|
30
|
-
assert_equal(0x00000000, PipeFoo::PIPE_READMODE_BYTE)
|
31
|
-
assert_equal(0x00000002, PipeFoo::PIPE_READMODE_MESSAGE)
|
32
|
-
assert_equal(0x00000000, PipeFoo::PIPE_CLIENT_END)
|
33
|
-
assert_equal(0x00000001, PipeFoo::PIPE_SERVER_END)
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_method_constants
|
37
|
-
assert_not_nil(PipeFoo::CallNamedPipe)
|
38
|
-
assert_not_nil(PipeFoo::ConnectNamedPipe)
|
39
|
-
assert_not_nil(PipeFoo::CreateNamedPipe)
|
40
|
-
assert_not_nil(PipeFoo::CreatePipe)
|
41
|
-
assert_not_nil(PipeFoo::DisconnectNamedPipe)
|
42
|
-
assert_not_nil(PipeFoo::GetNamedPipeHandleState)
|
43
|
-
assert_not_nil(PipeFoo::GetNamedPipeInfo)
|
44
|
-
assert_not_nil(PipeFoo::PeekNamedPipe)
|
45
|
-
assert_not_nil(PipeFoo::SetNamedPipeHandleState)
|
46
|
-
assert_not_nil(PipeFoo::TransactNamedPipe)
|
47
|
-
assert_not_nil(PipeFoo::WaitNamedPipe)
|
48
|
-
end
|
49
|
-
|
50
|
-
def teardown
|
51
|
-
@foo = nil
|
52
|
-
end
|
53
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_pipe.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Pipe module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/pipe'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class PipeFoo
|
10
|
+
include Windows::Pipe
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Pipe < Test::Unit::TestCase
|
14
|
+
|
15
|
+
def setup
|
16
|
+
@foo = PipeFoo.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_numeric_constants
|
20
|
+
assert_equal(0x00000001, PipeFoo::NMPWAIT_NOWAIT)
|
21
|
+
assert_equal(0xffffffff, PipeFoo::NMPWAIT_WAIT_FOREVER)
|
22
|
+
assert_equal(0x00000000, PipeFoo::NMPWAIT_USE_DEFAULT_WAIT)
|
23
|
+
assert_equal(0x00000000, PipeFoo::PIPE_WAIT)
|
24
|
+
assert_equal(0x00000001, PipeFoo::PIPE_NOWAIT)
|
25
|
+
assert_equal(0x00000001, PipeFoo::PIPE_ACCESS_INBOUND)
|
26
|
+
assert_equal(0x00000002, PipeFoo::PIPE_ACCESS_OUTBOUND)
|
27
|
+
assert_equal(0x00000003, PipeFoo::PIPE_ACCESS_DUPLEX)
|
28
|
+
assert_equal(0x00000000, PipeFoo::PIPE_TYPE_BYTE)
|
29
|
+
assert_equal(0x00000004, PipeFoo::PIPE_TYPE_MESSAGE)
|
30
|
+
assert_equal(0x00000000, PipeFoo::PIPE_READMODE_BYTE)
|
31
|
+
assert_equal(0x00000002, PipeFoo::PIPE_READMODE_MESSAGE)
|
32
|
+
assert_equal(0x00000000, PipeFoo::PIPE_CLIENT_END)
|
33
|
+
assert_equal(0x00000001, PipeFoo::PIPE_SERVER_END)
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_method_constants
|
37
|
+
assert_not_nil(PipeFoo::CallNamedPipe)
|
38
|
+
assert_not_nil(PipeFoo::ConnectNamedPipe)
|
39
|
+
assert_not_nil(PipeFoo::CreateNamedPipe)
|
40
|
+
assert_not_nil(PipeFoo::CreatePipe)
|
41
|
+
assert_not_nil(PipeFoo::DisconnectNamedPipe)
|
42
|
+
assert_not_nil(PipeFoo::GetNamedPipeHandleState)
|
43
|
+
assert_not_nil(PipeFoo::GetNamedPipeInfo)
|
44
|
+
assert_not_nil(PipeFoo::PeekNamedPipe)
|
45
|
+
assert_not_nil(PipeFoo::SetNamedPipeHandleState)
|
46
|
+
assert_not_nil(PipeFoo::TransactNamedPipe)
|
47
|
+
assert_not_nil(PipeFoo::WaitNamedPipe)
|
48
|
+
end
|
49
|
+
|
50
|
+
def teardown
|
51
|
+
@foo = nil
|
52
|
+
end
|
53
|
+
end
|
data/test/tc_process.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_process.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Process module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/process'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class TC_Windows_Process < Test::Unit::TestCase
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_process.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Process module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/process'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class TC_Windows_Process < Test::Unit::TestCase
|
10
|
+
include Windows::Process
|
11
|
+
|
12
|
+
def test_constants
|
13
|
+
assert_equal(0x1F0FFF, PROCESS_ALL_ACCESS)
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_methods
|
17
|
+
assert(self.respond_to?(:CreateProcess, true))
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_helper_methods
|
21
|
+
assert(self.respond_to?(:windows_64?, true))
|
22
|
+
assert_equal(true, [true, false].include?(windows_64?))
|
23
|
+
end
|
24
|
+
end
|
data/test/tc_registry.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_registry.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Registry module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/registry'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class RegistryFoo
|
10
|
-
include Windows::Registry
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Registry < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = RegistryFoo.new
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_numeric_constants
|
19
|
-
assert_equal(0x80000000, RegistryFoo::HKEY_CLASSES_ROOT)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_method_constants
|
23
|
-
assert_not_nil(RegistryFoo::RegCloseKey)
|
24
|
-
end
|
25
|
-
|
26
|
-
def teardown
|
27
|
-
@foo = nil
|
28
|
-
end
|
29
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_registry.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Registry module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/registry'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class RegistryFoo
|
10
|
+
include Windows::Registry
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Registry < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = RegistryFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0x80000000, RegistryFoo::HKEY_CLASSES_ROOT)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_constants
|
23
|
+
assert_not_nil(RegistryFoo::RegCloseKey)
|
24
|
+
end
|
25
|
+
|
26
|
+
def teardown
|
27
|
+
@foo = nil
|
28
|
+
end
|
29
|
+
end
|
data/test/tc_security.rb
CHANGED
@@ -1,104 +1,104 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_security.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Security module.
|
5
|
-
#####################################################################
|
6
|
-
require "windows/security"
|
7
|
-
require "test/unit"
|
8
|
-
|
9
|
-
class SecurityFoo
|
10
|
-
include Windows::Security
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Security < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = SecurityFoo.new
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_numeric_constants
|
19
|
-
assert_equal(2, SecurityFoo::ACL_REVISION)
|
20
|
-
assert_equal(2, SecurityFoo::ACL_REVISION2)
|
21
|
-
assert_equal(3, SecurityFoo::ACL_REVISION3)
|
22
|
-
assert_equal(4, SecurityFoo::ACL_REVISION4)
|
23
|
-
assert_equal(62, SecurityFoo::ALLOW_ACE_LENGTH)
|
24
|
-
assert_equal(4, SecurityFoo::DACL_SECURITY_INFORMATION)
|
25
|
-
assert_equal(4, SecurityFoo::SE_DACL_PRESENT)
|
26
|
-
assert_equal(20, SecurityFoo::SECURITY_DESCRIPTOR_MIN_LENGTH)
|
27
|
-
assert_equal(1, SecurityFoo::SECURITY_DESCRIPTOR_REVISION)
|
28
|
-
assert_equal(4026597376, SecurityFoo::GENERIC_RIGHTS_MASK)
|
29
|
-
assert_equal(4026531840, SecurityFoo::GENERIC_RIGHTS_CHK)
|
30
|
-
assert_equal(2097151, SecurityFoo::REST_RIGHTS_MASK)
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_method_constants
|
34
|
-
assert_not_nil(SecurityFoo::AddAce)
|
35
|
-
assert_not_nil(SecurityFoo::CopySid)
|
36
|
-
assert_not_nil(SecurityFoo::GetAce)
|
37
|
-
assert_not_nil(SecurityFoo::GetFileSecurity)
|
38
|
-
assert_not_nil(SecurityFoo::GetLengthSid)
|
39
|
-
assert_not_nil(SecurityFoo::GetSecurityDescriptorControl)
|
40
|
-
assert_not_nil(SecurityFoo::GetSecurityDescriptorDacl)
|
41
|
-
assert_not_nil(SecurityFoo::InitializeAcl)
|
42
|
-
assert_not_nil(SecurityFoo::InitializeSecurityDescriptor)
|
43
|
-
assert_not_nil(SecurityFoo::LookupAccountName)
|
44
|
-
assert_not_nil(SecurityFoo::LookupAccountSid)
|
45
|
-
assert_not_nil(SecurityFoo::SetFileSecurity)
|
46
|
-
assert_not_nil(SecurityFoo::SetSecurityDescriptorDacl)
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_add_ace
|
50
|
-
assert_respond_to(@foo, :AddAce)
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_copy_sid
|
54
|
-
assert_respond_to(@foo, :CopySid)
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_get_ace
|
58
|
-
assert_respond_to(@foo, :GetAce)
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_get_file_security
|
62
|
-
assert_respond_to(@foo, :GetFileSecurity)
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_get_length_sid
|
66
|
-
assert_respond_to(@foo, :GetLengthSid)
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_security_descriptr_control
|
70
|
-
assert_respond_to(@foo, :GetSecurityDescriptorControl)
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_security_descriptor_dacl
|
74
|
-
assert_respond_to(@foo, :GetSecurityDescriptorDacl)
|
75
|
-
end
|
76
|
-
|
77
|
-
def test_initialize_acl
|
78
|
-
assert_respond_to(@foo, :InitializeAcl)
|
79
|
-
end
|
80
|
-
|
81
|
-
def test_initialize_security_descriptor
|
82
|
-
assert_respond_to(@foo, :InitializeSecurityDescriptor)
|
83
|
-
end
|
84
|
-
|
85
|
-
def test_lookup_account_name
|
86
|
-
assert_respond_to(@foo, :LookupAccountName)
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_lookup_account_sid
|
90
|
-
assert_respond_to(@foo, :LookupAccountSid)
|
91
|
-
end
|
92
|
-
|
93
|
-
def test_set_file_security
|
94
|
-
assert_respond_to(@foo, :SetFileSecurity)
|
95
|
-
end
|
96
|
-
|
97
|
-
def test_set_security_descriptor_dacl
|
98
|
-
assert_respond_to(@foo, :SetSecurityDescriptorDacl)
|
99
|
-
end
|
100
|
-
|
101
|
-
def teardown
|
102
|
-
@foo = nil
|
103
|
-
end
|
104
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_security.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Security module.
|
5
|
+
#####################################################################
|
6
|
+
require "windows/security"
|
7
|
+
require "test/unit"
|
8
|
+
|
9
|
+
class SecurityFoo
|
10
|
+
include Windows::Security
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Security < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = SecurityFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(2, SecurityFoo::ACL_REVISION)
|
20
|
+
assert_equal(2, SecurityFoo::ACL_REVISION2)
|
21
|
+
assert_equal(3, SecurityFoo::ACL_REVISION3)
|
22
|
+
assert_equal(4, SecurityFoo::ACL_REVISION4)
|
23
|
+
assert_equal(62, SecurityFoo::ALLOW_ACE_LENGTH)
|
24
|
+
assert_equal(4, SecurityFoo::DACL_SECURITY_INFORMATION)
|
25
|
+
assert_equal(4, SecurityFoo::SE_DACL_PRESENT)
|
26
|
+
assert_equal(20, SecurityFoo::SECURITY_DESCRIPTOR_MIN_LENGTH)
|
27
|
+
assert_equal(1, SecurityFoo::SECURITY_DESCRIPTOR_REVISION)
|
28
|
+
assert_equal(4026597376, SecurityFoo::GENERIC_RIGHTS_MASK)
|
29
|
+
assert_equal(4026531840, SecurityFoo::GENERIC_RIGHTS_CHK)
|
30
|
+
assert_equal(2097151, SecurityFoo::REST_RIGHTS_MASK)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_method_constants
|
34
|
+
assert_not_nil(SecurityFoo::AddAce)
|
35
|
+
assert_not_nil(SecurityFoo::CopySid)
|
36
|
+
assert_not_nil(SecurityFoo::GetAce)
|
37
|
+
assert_not_nil(SecurityFoo::GetFileSecurity)
|
38
|
+
assert_not_nil(SecurityFoo::GetLengthSid)
|
39
|
+
assert_not_nil(SecurityFoo::GetSecurityDescriptorControl)
|
40
|
+
assert_not_nil(SecurityFoo::GetSecurityDescriptorDacl)
|
41
|
+
assert_not_nil(SecurityFoo::InitializeAcl)
|
42
|
+
assert_not_nil(SecurityFoo::InitializeSecurityDescriptor)
|
43
|
+
assert_not_nil(SecurityFoo::LookupAccountName)
|
44
|
+
assert_not_nil(SecurityFoo::LookupAccountSid)
|
45
|
+
assert_not_nil(SecurityFoo::SetFileSecurity)
|
46
|
+
assert_not_nil(SecurityFoo::SetSecurityDescriptorDacl)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_add_ace
|
50
|
+
assert_respond_to(@foo, :AddAce)
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_copy_sid
|
54
|
+
assert_respond_to(@foo, :CopySid)
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_get_ace
|
58
|
+
assert_respond_to(@foo, :GetAce)
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_get_file_security
|
62
|
+
assert_respond_to(@foo, :GetFileSecurity)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_get_length_sid
|
66
|
+
assert_respond_to(@foo, :GetLengthSid)
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_security_descriptr_control
|
70
|
+
assert_respond_to(@foo, :GetSecurityDescriptorControl)
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_security_descriptor_dacl
|
74
|
+
assert_respond_to(@foo, :GetSecurityDescriptorDacl)
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_initialize_acl
|
78
|
+
assert_respond_to(@foo, :InitializeAcl)
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_initialize_security_descriptor
|
82
|
+
assert_respond_to(@foo, :InitializeSecurityDescriptor)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_lookup_account_name
|
86
|
+
assert_respond_to(@foo, :LookupAccountName)
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_lookup_account_sid
|
90
|
+
assert_respond_to(@foo, :LookupAccountSid)
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_set_file_security
|
94
|
+
assert_respond_to(@foo, :SetFileSecurity)
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_set_security_descriptor_dacl
|
98
|
+
assert_respond_to(@foo, :SetSecurityDescriptorDacl)
|
99
|
+
end
|
100
|
+
|
101
|
+
def teardown
|
102
|
+
@foo = nil
|
103
|
+
end
|
104
|
+
end
|
@@ -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
|