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.
Files changed (126) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +444 -438
  3. data/MANIFEST +68 -65
  4. data/README +154 -153
  5. data/Rakefile +42 -37
  6. data/doc/conversion_guide.txt +37 -37
  7. data/lib/windows/clipboard.rb +61 -61
  8. data/lib/windows/com.rb +192 -192
  9. data/lib/windows/com/accessibility.rb +16 -16
  10. data/lib/windows/com/automation.rb +149 -149
  11. data/lib/windows/com/variant.rb +24 -24
  12. data/lib/windows/console.rb +114 -114
  13. data/lib/windows/debug.rb +35 -35
  14. data/lib/windows/device_io.rb +248 -248
  15. data/lib/windows/directory.rb +27 -27
  16. data/lib/windows/error.rb +504 -498
  17. data/lib/windows/eventlog.rb +80 -80
  18. data/lib/windows/file.rb +264 -264
  19. data/lib/windows/file_mapping.rb +25 -25
  20. data/lib/windows/filesystem.rb +15 -15
  21. data/lib/windows/gdi/bitmap.rb +65 -65
  22. data/lib/windows/gdi/device_context.rb +46 -46
  23. data/lib/windows/gdi/metafile.rb +40 -40
  24. data/lib/windows/gdi/painting_drawing.rb +115 -115
  25. data/lib/windows/handle.rb +23 -23
  26. data/lib/windows/library.rb +44 -44
  27. data/lib/windows/limits.rb +34 -34
  28. data/lib/windows/mailslot.rb +24 -24
  29. data/lib/windows/memory.rb +128 -128
  30. data/lib/windows/msvcrt/buffer.rb +75 -75
  31. data/lib/windows/msvcrt/directory.rb +31 -31
  32. data/lib/windows/msvcrt/file.rb +47 -47
  33. data/lib/windows/msvcrt/io.rb +73 -73
  34. data/lib/windows/msvcrt/string.rb +182 -182
  35. data/lib/windows/msvcrt/time.rb +169 -169
  36. data/lib/windows/national.rb +580 -580
  37. data/lib/windows/network/management.rb +525 -525
  38. data/lib/windows/network/snmp.rb +92 -92
  39. data/lib/windows/network/winsock.rb +128 -128
  40. data/lib/windows/nio.rb +50 -50
  41. data/lib/windows/ntfs/winternl.rb +117 -117
  42. data/lib/windows/path.rb +143 -143
  43. data/lib/windows/pipe.rb +42 -42
  44. data/lib/windows/process.rb +176 -176
  45. data/lib/windows/registry.rb +171 -171
  46. data/lib/windows/security.rb +479 -479
  47. data/lib/windows/security/authentication.rb +32 -32
  48. data/lib/windows/security/sspi.rb +153 -0
  49. data/lib/windows/service.rb +142 -142
  50. data/lib/windows/shell.rb +171 -171
  51. data/lib/windows/socket.rb +86 -86
  52. data/lib/windows/sound.rb +39 -39
  53. data/lib/windows/synchronize.rb +133 -133
  54. data/lib/windows/system_info.rb +229 -229
  55. data/lib/windows/thread.rb +64 -64
  56. data/lib/windows/time.rb +48 -48
  57. data/lib/windows/tool_helper.rb +36 -36
  58. data/lib/windows/unicode.rb +155 -155
  59. data/lib/windows/volume.rb +61 -61
  60. data/lib/windows/window.rb +81 -81
  61. data/lib/windows/window/classes.rb +59 -59
  62. data/lib/windows/window/dialog.rb +91 -91
  63. data/lib/windows/window/menu.rb +102 -102
  64. data/lib/windows/window/message.rb +297 -297
  65. data/lib/windows/window/properties.rb +20 -20
  66. data/lib/windows/window/timer.rb +19 -19
  67. data/lib/windows/wsa.rb +102 -102
  68. data/test/tc_clipboard.rb +41 -41
  69. data/test/tc_com.rb +32 -32
  70. data/test/tc_com_automation.rb +15 -15
  71. data/test/tc_console.rb +108 -108
  72. data/test/tc_debug.rb +48 -48
  73. data/test/tc_device_io.rb +29 -29
  74. data/test/tc_directory.rb +25 -25
  75. data/test/tc_error.rb +38 -38
  76. data/test/tc_eventlog.rb +58 -58
  77. data/test/tc_file.rb +67 -67
  78. data/test/tc_file_mapping.rb +38 -38
  79. data/test/tc_filesystem.rb +27 -27
  80. data/test/tc_gdi_bitmap.rb +25 -25
  81. data/test/tc_gdi_metafile.rb +23 -23
  82. data/test/tc_handle.rb +36 -36
  83. data/test/tc_library.rb +37 -37
  84. data/test/tc_limits.rb +34 -34
  85. data/test/tc_mailslot.rb +22 -22
  86. data/test/tc_memory.rb +44 -44
  87. data/test/tc_msvcrt_buffer.rb +63 -63
  88. data/test/tc_msvcrt_directory.rb +96 -96
  89. data/test/tc_msvcrt_file.rb +80 -80
  90. data/test/tc_msvcrt_io.rb +48 -48
  91. data/test/tc_msvcrt_string.rb +94 -94
  92. data/test/tc_msvcrt_time.rb +19 -19
  93. data/test/tc_national.rb +38 -38
  94. data/test/tc_network_management.rb +32 -32
  95. data/test/tc_network_snmp.rb +31 -31
  96. data/test/tc_network_winsock.rb +34 -34
  97. data/test/tc_nio.rb +32 -32
  98. data/test/tc_ntfs_winternl.rb +48 -48
  99. data/test/tc_path.rb +90 -90
  100. data/test/tc_pipe.rb +53 -53
  101. data/test/tc_process.rb +24 -24
  102. data/test/tc_registry.rb +29 -29
  103. data/test/tc_security.rb +104 -104
  104. data/test/tc_security_authentication.rb +34 -34
  105. data/test/tc_security_sspi.rb +23 -0
  106. data/test/tc_service.rb +57 -57
  107. data/test/tc_shell.rb +34 -34
  108. data/test/tc_socket.rb +20 -20
  109. data/test/tc_sound.rb +37 -37
  110. data/test/tc_synchronize.rb +75 -75
  111. data/test/tc_system_info.rb +33 -33
  112. data/test/tc_thread.rb +29 -29
  113. data/test/tc_time.rb +32 -32
  114. data/test/tc_tool_helper.rb +29 -29
  115. data/test/tc_unicode.rb +83 -83
  116. data/test/tc_volume.rb +47 -47
  117. data/test/tc_window.rb +45 -45
  118. data/test/tc_window_classes.rb +33 -33
  119. data/test/tc_window_dialog.rb +33 -33
  120. data/test/tc_window_menu.rb +29 -29
  121. data/test/tc_window_message.rb +33 -33
  122. data/test/tc_window_properties.rb +29 -29
  123. data/test/tc_window_timer.rb +29 -29
  124. data/test/tc_wsa.rb +19 -19
  125. data/windows-pr.gemspec +33 -34
  126. metadata +31 -32
@@ -1,90 +1,90 @@
1
- #####################################################################
2
- # tc_path.rb
3
- #
4
- # Test case for the Windows::Path module.
5
- #####################################################################
6
- require "windows/path"
7
- require "test/unit"
8
-
9
- class PathFoo
10
- include Windows::Path
11
- end
12
-
13
- class TC_Windows_Path < Test::Unit::TestCase
14
- def setup
15
- @foo = PathFoo.new
16
- @path = "C:\\"
17
- end
18
-
19
- def test_numeric_constants
20
- assert_equal(0x0000, PathFoo::GCT_INVALID)
21
- assert_equal(0x0001, PathFoo::GCT_LFNCHAR)
22
- assert_equal(0x0002, PathFoo::GCT_SHORTCHAR)
23
- assert_equal(0x0004, PathFoo::GCT_WILD)
24
- assert_equal(0x0008, PathFoo::GCT_SEPARATOR)
25
- end
26
-
27
- def test_method_constants
28
- assert_not_nil(PathFoo::PathAddBackslash)
29
- assert_not_nil(PathFoo::PathAddExtension)
30
- assert_not_nil(PathFoo::PathAppend)
31
- assert_not_nil(PathFoo::PathBuildRoot)
32
- assert_not_nil(PathFoo::PathCanonicalize)
33
- assert_not_nil(PathFoo::PathCombine)
34
- assert_not_nil(PathFoo::PathCommonPrefix)
35
- assert_not_nil(PathFoo::PathCompactPath)
36
- assert_not_nil(PathFoo::PathCompactPathEx)
37
- assert_not_nil(PathFoo::PathCreateFromUrl)
38
- assert_not_nil(PathFoo::PathFileExists)
39
- assert_not_nil(PathFoo::PathFindExtension)
40
- assert_not_nil(PathFoo::PathFindFileName)
41
- assert_not_nil(PathFoo::PathFindNextComponent)
42
- assert_not_nil(PathFoo::PathFindOnPath)
43
- assert_not_nil(PathFoo::PathFindSuffixArray)
44
- assert_not_nil(PathFoo::PathGetArgs)
45
- assert_not_nil(PathFoo::PathGetCharType)
46
- assert_not_nil(PathFoo::PathGetDriveNumber)
47
- assert_not_nil(PathFoo::PathIsContentType)
48
- assert_not_nil(PathFoo::PathIsDirectory)
49
- assert_not_nil(PathFoo::PathIsDirectoryEmpty)
50
- assert_not_nil(PathFoo::PathIsFileSpec)
51
- #assert_not_nil(PathFoo::PathIsHTMLFile)
52
- assert_not_nil(PathFoo::PathIsLFNFileSpec)
53
- assert_not_nil(PathFoo::PathIsNetworkPath)
54
- assert_not_nil(PathFoo::PathIsPrefix)
55
- assert_not_nil(PathFoo::PathIsRelative)
56
- assert_not_nil(PathFoo::PathIsRoot)
57
- assert_not_nil(PathFoo::PathIsSameRoot)
58
- assert_not_nil(PathFoo::PathIsSystemFolder)
59
- assert_not_nil(PathFoo::PathIsUNC)
60
- assert_not_nil(PathFoo::PathIsUNCServer)
61
- assert_not_nil(PathFoo::PathIsUNCServerShare)
62
- assert_not_nil(PathFoo::PathIsURL)
63
- assert_not_nil(PathFoo::PathMakePretty)
64
- assert_not_nil(PathFoo::PathMakeSystemFolder)
65
- assert_not_nil(PathFoo::PathMatchSpec)
66
- assert_not_nil(PathFoo::PathParseIconLocation)
67
- assert_not_nil(PathFoo::PathQuoteSpaces)
68
- assert_not_nil(PathFoo::PathRelativePathTo)
69
- assert_not_nil(PathFoo::PathRemoveArgs)
70
- assert_not_nil(PathFoo::PathRemoveBackslash)
71
- assert_not_nil(PathFoo::PathRemoveBlanks)
72
- assert_not_nil(PathFoo::PathRemoveExtension)
73
- assert_not_nil(PathFoo::PathRemoveFileSpec)
74
- assert_not_nil(PathFoo::PathRenameExtension)
75
- assert_not_nil(PathFoo::PathSearchAndQualify)
76
- assert_not_nil(PathFoo::PathSetDlgItemPath)
77
- assert_not_nil(PathFoo::PathSkipRoot)
78
- assert_not_nil(PathFoo::PathStripPath)
79
- assert_not_nil(PathFoo::PathStripToRoot)
80
- assert_not_nil(PathFoo::PathUndecorate)
81
- assert_not_nil(PathFoo::PathUnExpandEnvStrings)
82
- assert_not_nil(PathFoo::PathUnmakeSystemFolder)
83
- assert_not_nil(PathFoo::PathUnquoteSpaces)
84
- end
85
-
86
- def teardown
87
- @foo = nil
88
- @path = nil
89
- end
90
- end
1
+ #####################################################################
2
+ # tc_path.rb
3
+ #
4
+ # Test case for the Windows::Path module.
5
+ #####################################################################
6
+ require "windows/path"
7
+ require "test/unit"
8
+
9
+ class PathFoo
10
+ include Windows::Path
11
+ end
12
+
13
+ class TC_Windows_Path < Test::Unit::TestCase
14
+ def setup
15
+ @foo = PathFoo.new
16
+ @path = "C:\\"
17
+ end
18
+
19
+ def test_numeric_constants
20
+ assert_equal(0x0000, PathFoo::GCT_INVALID)
21
+ assert_equal(0x0001, PathFoo::GCT_LFNCHAR)
22
+ assert_equal(0x0002, PathFoo::GCT_SHORTCHAR)
23
+ assert_equal(0x0004, PathFoo::GCT_WILD)
24
+ assert_equal(0x0008, PathFoo::GCT_SEPARATOR)
25
+ end
26
+
27
+ def test_method_constants
28
+ assert_not_nil(PathFoo::PathAddBackslash)
29
+ assert_not_nil(PathFoo::PathAddExtension)
30
+ assert_not_nil(PathFoo::PathAppend)
31
+ assert_not_nil(PathFoo::PathBuildRoot)
32
+ assert_not_nil(PathFoo::PathCanonicalize)
33
+ assert_not_nil(PathFoo::PathCombine)
34
+ assert_not_nil(PathFoo::PathCommonPrefix)
35
+ assert_not_nil(PathFoo::PathCompactPath)
36
+ assert_not_nil(PathFoo::PathCompactPathEx)
37
+ assert_not_nil(PathFoo::PathCreateFromUrl)
38
+ assert_not_nil(PathFoo::PathFileExists)
39
+ assert_not_nil(PathFoo::PathFindExtension)
40
+ assert_not_nil(PathFoo::PathFindFileName)
41
+ assert_not_nil(PathFoo::PathFindNextComponent)
42
+ assert_not_nil(PathFoo::PathFindOnPath)
43
+ assert_not_nil(PathFoo::PathFindSuffixArray)
44
+ assert_not_nil(PathFoo::PathGetArgs)
45
+ assert_not_nil(PathFoo::PathGetCharType)
46
+ assert_not_nil(PathFoo::PathGetDriveNumber)
47
+ assert_not_nil(PathFoo::PathIsContentType)
48
+ assert_not_nil(PathFoo::PathIsDirectory)
49
+ assert_not_nil(PathFoo::PathIsDirectoryEmpty)
50
+ assert_not_nil(PathFoo::PathIsFileSpec)
51
+ #assert_not_nil(PathFoo::PathIsHTMLFile)
52
+ assert_not_nil(PathFoo::PathIsLFNFileSpec)
53
+ assert_not_nil(PathFoo::PathIsNetworkPath)
54
+ assert_not_nil(PathFoo::PathIsPrefix)
55
+ assert_not_nil(PathFoo::PathIsRelative)
56
+ assert_not_nil(PathFoo::PathIsRoot)
57
+ assert_not_nil(PathFoo::PathIsSameRoot)
58
+ assert_not_nil(PathFoo::PathIsSystemFolder)
59
+ assert_not_nil(PathFoo::PathIsUNC)
60
+ assert_not_nil(PathFoo::PathIsUNCServer)
61
+ assert_not_nil(PathFoo::PathIsUNCServerShare)
62
+ assert_not_nil(PathFoo::PathIsURL)
63
+ assert_not_nil(PathFoo::PathMakePretty)
64
+ assert_not_nil(PathFoo::PathMakeSystemFolder)
65
+ assert_not_nil(PathFoo::PathMatchSpec)
66
+ assert_not_nil(PathFoo::PathParseIconLocation)
67
+ assert_not_nil(PathFoo::PathQuoteSpaces)
68
+ assert_not_nil(PathFoo::PathRelativePathTo)
69
+ assert_not_nil(PathFoo::PathRemoveArgs)
70
+ assert_not_nil(PathFoo::PathRemoveBackslash)
71
+ assert_not_nil(PathFoo::PathRemoveBlanks)
72
+ assert_not_nil(PathFoo::PathRemoveExtension)
73
+ assert_not_nil(PathFoo::PathRemoveFileSpec)
74
+ assert_not_nil(PathFoo::PathRenameExtension)
75
+ assert_not_nil(PathFoo::PathSearchAndQualify)
76
+ assert_not_nil(PathFoo::PathSetDlgItemPath)
77
+ assert_not_nil(PathFoo::PathSkipRoot)
78
+ assert_not_nil(PathFoo::PathStripPath)
79
+ assert_not_nil(PathFoo::PathStripToRoot)
80
+ assert_not_nil(PathFoo::PathUndecorate)
81
+ assert_not_nil(PathFoo::PathUnExpandEnvStrings)
82
+ assert_not_nil(PathFoo::PathUnmakeSystemFolder)
83
+ assert_not_nil(PathFoo::PathUnquoteSpaces)
84
+ end
85
+
86
+ def teardown
87
+ @foo = nil
88
+ @path = nil
89
+ end
90
+ end
@@ -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
@@ -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
- 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
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
@@ -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
@@ -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