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
data/test/tc_console.rb
CHANGED
@@ -1,108 +1,108 @@
|
|
1
|
-
######################################################################
|
2
|
-
# tc_console.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Console module.
|
5
|
-
######################################################################
|
6
|
-
require 'windows/console'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class TC_Windows_Console < Test::Unit::TestCase
|
10
|
-
include Windows::Console
|
11
|
-
|
12
|
-
def setup
|
13
|
-
@ver = `ver`.chomp
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_numeric_constants
|
17
|
-
assert_equal(0, CTRL_C_EVENT)
|
18
|
-
assert_equal(1, CTRL_BREAK_EVENT)
|
19
|
-
assert_equal(5, CTRL_LOGOFF_EVENT)
|
20
|
-
assert_equal(6, CTRL_SHUTDOWN_EVENT)
|
21
|
-
assert_equal(0x0001, ENABLE_PROCESSED_INPUT)
|
22
|
-
assert_equal(0x0002, ENABLE_LINE_INPUT)
|
23
|
-
assert_equal(0x0002, ENABLE_WRAP_AT_EOL_OUTPUT)
|
24
|
-
assert_equal(0x0004, ENABLE_ECHO_INPUT)
|
25
|
-
assert_equal(0x0008, ENABLE_WINDOW_INPUT)
|
26
|
-
assert_equal(0x0010, ENABLE_MOUSE_INPUT)
|
27
|
-
assert_equal(0x0020, ENABLE_INSERT_MODE)
|
28
|
-
assert_equal(0x0040, ENABLE_QUICK_EDIT_MODE)
|
29
|
-
assert_equal(-10, STD_INPUT_HANDLE)
|
30
|
-
assert_equal(-11, STD_OUTPUT_HANDLE)
|
31
|
-
assert_equal(-12, STD_ERROR_HANDLE)
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_method_constants
|
35
|
-
assert_respond_to(self, :AddConsoleAlias)
|
36
|
-
assert_respond_to(self, :AllocConsole)
|
37
|
-
assert_respond_to(self, :CreateConsoleScreenBuffer)
|
38
|
-
assert_respond_to(self, :FillConsoleOutputAttribute)
|
39
|
-
assert_respond_to(self, :FillConsoleOutputCharacter)
|
40
|
-
assert_respond_to(self, :FlushConsoleInputBuffer)
|
41
|
-
assert_respond_to(self, :FreeConsole)
|
42
|
-
assert_respond_to(self, :GenerateConsoleCtrlEvent)
|
43
|
-
assert_respond_to(self, :GetConsoleAlias)
|
44
|
-
assert_respond_to(self, :GetConsoleAliases)
|
45
|
-
assert_respond_to(self, :GetConsoleAliasesLength)
|
46
|
-
assert_respond_to(self, :GetConsoleAliasExes)
|
47
|
-
assert_respond_to(self, :GetConsoleAliasExesLength)
|
48
|
-
assert_respond_to(self, :GetConsoleCP)
|
49
|
-
assert_respond_to(self, :GetConsoleCursorInfo)
|
50
|
-
assert_respond_to(self, :GetConsoleMode)
|
51
|
-
assert_respond_to(self, :GetConsoleOutputCP)
|
52
|
-
assert_respond_to(self, :GetConsoleScreenBufferInfo)
|
53
|
-
assert_respond_to(self, :GetConsoleTitle)
|
54
|
-
assert_respond_to(self, :GetConsoleWindow)
|
55
|
-
assert_respond_to(self, :GetLargestConsoleWindowSize)
|
56
|
-
assert_respond_to(self, :GetNumberOfConsoleInputEvents)
|
57
|
-
assert_respond_to(self, :GetNumberOfConsoleMouseButtons)
|
58
|
-
assert_respond_to(self, :GetStdHandle)
|
59
|
-
assert_respond_to(self, :PeekConsoleInput)
|
60
|
-
assert_respond_to(self, :ReadConsole)
|
61
|
-
assert_respond_to(self, :ReadConsoleInput)
|
62
|
-
assert_respond_to(self, :ReadConsoleOutput)
|
63
|
-
assert_respond_to(self, :ReadConsoleOutputAttribute)
|
64
|
-
assert_respond_to(self, :ReadConsoleOutputCharacter)
|
65
|
-
assert_respond_to(self, :ScrollConsoleScreenBuffer)
|
66
|
-
assert_respond_to(self, :SetConsoleActiveScreenBuffer)
|
67
|
-
assert_respond_to(self, :SetConsoleCP)
|
68
|
-
assert_respond_to(self, :SetConsoleCtrlHandler)
|
69
|
-
assert_respond_to(self, :SetConsoleCursorInfo)
|
70
|
-
assert_respond_to(self, :SetConsoleCursorPosition)
|
71
|
-
assert_respond_to(self, :SetConsoleMode)
|
72
|
-
assert_respond_to(self, :SetConsoleOutputCP)
|
73
|
-
assert_respond_to(self, :SetConsoleScreenBufferSize)
|
74
|
-
assert_respond_to(self, :SetConsoleTextAttribute)
|
75
|
-
assert_respond_to(self, :SetConsoleTitle)
|
76
|
-
assert_respond_to(self, :SetConsoleWindowInfo)
|
77
|
-
assert_respond_to(self, :SetStdHandle)
|
78
|
-
assert_respond_to(self, :WriteConsole)
|
79
|
-
assert_respond_to(self, :WriteConsoleInput)
|
80
|
-
assert_respond_to(self, :WriteConsoleOutput)
|
81
|
-
assert_respond_to(self, :WriteConsoleOutputAttribute)
|
82
|
-
assert_respond_to(self, :WriteConsoleOutputCharacter)
|
83
|
-
end
|
84
|
-
|
85
|
-
def test_method_constants_xp_or_later
|
86
|
-
if @ver =~ /XP/
|
87
|
-
assert_respond_to(self, :AttachConsole)
|
88
|
-
assert_respond_to(self, :GetConsoleDisplayMode)
|
89
|
-
assert_respond_to(self, :GetConsoleFontSize)
|
90
|
-
assert_respond_to(self, :GetConsoleProcessList)
|
91
|
-
assert_respond_to(self, :GetConsoleSelectionInfo)
|
92
|
-
assert_respond_to(self, :GetCurrentConsoleFont)
|
93
|
-
assert_respond_to(self, :SetConsoleDisplayMode)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def test_explicit_ansi
|
98
|
-
assert_respond_to(self, :GetConsoleAliasA)
|
99
|
-
end
|
100
|
-
|
101
|
-
def test_explicit_unicode
|
102
|
-
assert_respond_to(self, :GetConsoleAliasW)
|
103
|
-
end
|
104
|
-
|
105
|
-
def teardown
|
106
|
-
@ver = nil
|
107
|
-
end
|
108
|
-
end
|
1
|
+
######################################################################
|
2
|
+
# tc_console.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Console module.
|
5
|
+
######################################################################
|
6
|
+
require 'windows/console'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class TC_Windows_Console < Test::Unit::TestCase
|
10
|
+
include Windows::Console
|
11
|
+
|
12
|
+
def setup
|
13
|
+
@ver = `ver`.chomp
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_numeric_constants
|
17
|
+
assert_equal(0, CTRL_C_EVENT)
|
18
|
+
assert_equal(1, CTRL_BREAK_EVENT)
|
19
|
+
assert_equal(5, CTRL_LOGOFF_EVENT)
|
20
|
+
assert_equal(6, CTRL_SHUTDOWN_EVENT)
|
21
|
+
assert_equal(0x0001, ENABLE_PROCESSED_INPUT)
|
22
|
+
assert_equal(0x0002, ENABLE_LINE_INPUT)
|
23
|
+
assert_equal(0x0002, ENABLE_WRAP_AT_EOL_OUTPUT)
|
24
|
+
assert_equal(0x0004, ENABLE_ECHO_INPUT)
|
25
|
+
assert_equal(0x0008, ENABLE_WINDOW_INPUT)
|
26
|
+
assert_equal(0x0010, ENABLE_MOUSE_INPUT)
|
27
|
+
assert_equal(0x0020, ENABLE_INSERT_MODE)
|
28
|
+
assert_equal(0x0040, ENABLE_QUICK_EDIT_MODE)
|
29
|
+
assert_equal(-10, STD_INPUT_HANDLE)
|
30
|
+
assert_equal(-11, STD_OUTPUT_HANDLE)
|
31
|
+
assert_equal(-12, STD_ERROR_HANDLE)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_method_constants
|
35
|
+
assert_respond_to(self, :AddConsoleAlias)
|
36
|
+
assert_respond_to(self, :AllocConsole)
|
37
|
+
assert_respond_to(self, :CreateConsoleScreenBuffer)
|
38
|
+
assert_respond_to(self, :FillConsoleOutputAttribute)
|
39
|
+
assert_respond_to(self, :FillConsoleOutputCharacter)
|
40
|
+
assert_respond_to(self, :FlushConsoleInputBuffer)
|
41
|
+
assert_respond_to(self, :FreeConsole)
|
42
|
+
assert_respond_to(self, :GenerateConsoleCtrlEvent)
|
43
|
+
assert_respond_to(self, :GetConsoleAlias)
|
44
|
+
assert_respond_to(self, :GetConsoleAliases)
|
45
|
+
assert_respond_to(self, :GetConsoleAliasesLength)
|
46
|
+
assert_respond_to(self, :GetConsoleAliasExes)
|
47
|
+
assert_respond_to(self, :GetConsoleAliasExesLength)
|
48
|
+
assert_respond_to(self, :GetConsoleCP)
|
49
|
+
assert_respond_to(self, :GetConsoleCursorInfo)
|
50
|
+
assert_respond_to(self, :GetConsoleMode)
|
51
|
+
assert_respond_to(self, :GetConsoleOutputCP)
|
52
|
+
assert_respond_to(self, :GetConsoleScreenBufferInfo)
|
53
|
+
assert_respond_to(self, :GetConsoleTitle)
|
54
|
+
assert_respond_to(self, :GetConsoleWindow)
|
55
|
+
assert_respond_to(self, :GetLargestConsoleWindowSize)
|
56
|
+
assert_respond_to(self, :GetNumberOfConsoleInputEvents)
|
57
|
+
assert_respond_to(self, :GetNumberOfConsoleMouseButtons)
|
58
|
+
assert_respond_to(self, :GetStdHandle)
|
59
|
+
assert_respond_to(self, :PeekConsoleInput)
|
60
|
+
assert_respond_to(self, :ReadConsole)
|
61
|
+
assert_respond_to(self, :ReadConsoleInput)
|
62
|
+
assert_respond_to(self, :ReadConsoleOutput)
|
63
|
+
assert_respond_to(self, :ReadConsoleOutputAttribute)
|
64
|
+
assert_respond_to(self, :ReadConsoleOutputCharacter)
|
65
|
+
assert_respond_to(self, :ScrollConsoleScreenBuffer)
|
66
|
+
assert_respond_to(self, :SetConsoleActiveScreenBuffer)
|
67
|
+
assert_respond_to(self, :SetConsoleCP)
|
68
|
+
assert_respond_to(self, :SetConsoleCtrlHandler)
|
69
|
+
assert_respond_to(self, :SetConsoleCursorInfo)
|
70
|
+
assert_respond_to(self, :SetConsoleCursorPosition)
|
71
|
+
assert_respond_to(self, :SetConsoleMode)
|
72
|
+
assert_respond_to(self, :SetConsoleOutputCP)
|
73
|
+
assert_respond_to(self, :SetConsoleScreenBufferSize)
|
74
|
+
assert_respond_to(self, :SetConsoleTextAttribute)
|
75
|
+
assert_respond_to(self, :SetConsoleTitle)
|
76
|
+
assert_respond_to(self, :SetConsoleWindowInfo)
|
77
|
+
assert_respond_to(self, :SetStdHandle)
|
78
|
+
assert_respond_to(self, :WriteConsole)
|
79
|
+
assert_respond_to(self, :WriteConsoleInput)
|
80
|
+
assert_respond_to(self, :WriteConsoleOutput)
|
81
|
+
assert_respond_to(self, :WriteConsoleOutputAttribute)
|
82
|
+
assert_respond_to(self, :WriteConsoleOutputCharacter)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_method_constants_xp_or_later
|
86
|
+
if @ver =~ /XP/
|
87
|
+
assert_respond_to(self, :AttachConsole)
|
88
|
+
assert_respond_to(self, :GetConsoleDisplayMode)
|
89
|
+
assert_respond_to(self, :GetConsoleFontSize)
|
90
|
+
assert_respond_to(self, :GetConsoleProcessList)
|
91
|
+
assert_respond_to(self, :GetConsoleSelectionInfo)
|
92
|
+
assert_respond_to(self, :GetCurrentConsoleFont)
|
93
|
+
assert_respond_to(self, :SetConsoleDisplayMode)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_explicit_ansi
|
98
|
+
assert_respond_to(self, :GetConsoleAliasA)
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_explicit_unicode
|
102
|
+
assert_respond_to(self, :GetConsoleAliasW)
|
103
|
+
end
|
104
|
+
|
105
|
+
def teardown
|
106
|
+
@ver = nil
|
107
|
+
end
|
108
|
+
end
|
data/test/tc_debug.rb
CHANGED
@@ -1,48 +1,48 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_debug.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Debug module.
|
5
|
-
#####################################################################
|
6
|
-
require "windows/debug"
|
7
|
-
require "test/unit"
|
8
|
-
|
9
|
-
class DebugFoo
|
10
|
-
include Windows::Debug
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Debug < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = DebugFoo.new
|
16
|
-
@ver = `ver`.chomp
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_method_constants
|
20
|
-
assert_not_nil(DebugFoo::ContinueDebugEvent)
|
21
|
-
assert_not_nil(DebugFoo::DebugActiveProcess)
|
22
|
-
assert_not_nil(DebugFoo::DebugBreak)
|
23
|
-
assert_not_nil(DebugFoo::FatalExit)
|
24
|
-
assert_not_nil(DebugFoo::FlushInstructionCache)
|
25
|
-
assert_not_nil(DebugFoo::GetThreadContext)
|
26
|
-
assert_not_nil(DebugFoo::GetThreadSelectorEntry)
|
27
|
-
assert_not_nil(DebugFoo::IsDebuggerPresent)
|
28
|
-
assert_not_nil(DebugFoo::OutputDebugString)
|
29
|
-
assert_not_nil(DebugFoo::ReadProcessMemory)
|
30
|
-
assert_not_nil(DebugFoo::SetThreadContext)
|
31
|
-
assert_not_nil(DebugFoo::WaitForDebugEvent)
|
32
|
-
assert_not_nil(DebugFoo::WriteProcessMemory)
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_method_constants_xp_or_later
|
36
|
-
if @ver =~ /XP/
|
37
|
-
assert_not_nil(DebugFoo::CheckRemoteDebuggerPresent)
|
38
|
-
assert_not_nil(DebugFoo::DebugActiveProcessStop)
|
39
|
-
assert_not_nil(DebugFoo::DebugBreakProcess)
|
40
|
-
assert_not_nil(DebugFoo::DebugSetProcessKillOnExit)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def teardown
|
45
|
-
@foo = nil
|
46
|
-
@ver = nil
|
47
|
-
end
|
48
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_debug.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Debug module.
|
5
|
+
#####################################################################
|
6
|
+
require "windows/debug"
|
7
|
+
require "test/unit"
|
8
|
+
|
9
|
+
class DebugFoo
|
10
|
+
include Windows::Debug
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Debug < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = DebugFoo.new
|
16
|
+
@ver = `ver`.chomp
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_method_constants
|
20
|
+
assert_not_nil(DebugFoo::ContinueDebugEvent)
|
21
|
+
assert_not_nil(DebugFoo::DebugActiveProcess)
|
22
|
+
assert_not_nil(DebugFoo::DebugBreak)
|
23
|
+
assert_not_nil(DebugFoo::FatalExit)
|
24
|
+
assert_not_nil(DebugFoo::FlushInstructionCache)
|
25
|
+
assert_not_nil(DebugFoo::GetThreadContext)
|
26
|
+
assert_not_nil(DebugFoo::GetThreadSelectorEntry)
|
27
|
+
assert_not_nil(DebugFoo::IsDebuggerPresent)
|
28
|
+
assert_not_nil(DebugFoo::OutputDebugString)
|
29
|
+
assert_not_nil(DebugFoo::ReadProcessMemory)
|
30
|
+
assert_not_nil(DebugFoo::SetThreadContext)
|
31
|
+
assert_not_nil(DebugFoo::WaitForDebugEvent)
|
32
|
+
assert_not_nil(DebugFoo::WriteProcessMemory)
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_method_constants_xp_or_later
|
36
|
+
if @ver =~ /XP/
|
37
|
+
assert_not_nil(DebugFoo::CheckRemoteDebuggerPresent)
|
38
|
+
assert_not_nil(DebugFoo::DebugActiveProcessStop)
|
39
|
+
assert_not_nil(DebugFoo::DebugBreakProcess)
|
40
|
+
assert_not_nil(DebugFoo::DebugSetProcessKillOnExit)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def teardown
|
45
|
+
@foo = nil
|
46
|
+
@ver = nil
|
47
|
+
end
|
48
|
+
end
|
data/test/tc_device_io.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_device_io.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::DeviceIO module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/device_io'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class DeviceIOFoo
|
10
|
-
include Windows::DeviceIO
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_DeviceIO < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = DeviceIOFoo.new
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_numeric_constants
|
19
|
-
assert_equal(0x00000001, DeviceIOFoo::FILE_DEVICE_BEEP)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_method_constants
|
23
|
-
assert_not_nil(DeviceIOFoo::DeviceIoControl)
|
24
|
-
end
|
25
|
-
|
26
|
-
def teardown
|
27
|
-
@foo = nil
|
28
|
-
end
|
29
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_device_io.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::DeviceIO module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/device_io'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class DeviceIOFoo
|
10
|
+
include Windows::DeviceIO
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_DeviceIO < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = DeviceIOFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0x00000001, DeviceIOFoo::FILE_DEVICE_BEEP)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_constants
|
23
|
+
assert_not_nil(DeviceIOFoo::DeviceIoControl)
|
24
|
+
end
|
25
|
+
|
26
|
+
def teardown
|
27
|
+
@foo = nil
|
28
|
+
end
|
29
|
+
end
|
data/test/tc_directory.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_directory.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Directory module.
|
5
|
-
#####################################################################
|
6
|
-
require 'windows/directory'
|
7
|
-
require 'test/unit'
|
8
|
-
|
9
|
-
class DirectoryFoo
|
10
|
-
include Windows::Directory
|
11
|
-
end
|
12
|
-
|
13
|
-
class TC_Windows_Directory < Test::Unit::TestCase
|
14
|
-
def setup
|
15
|
-
@foo = DirectoryFoo.new
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_method_constants
|
19
|
-
assert_not_nil(DirectoryFoo::CreateDirectory)
|
20
|
-
end
|
21
|
-
|
22
|
-
def teardown
|
23
|
-
@foo = nil
|
24
|
-
end
|
25
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_directory.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Directory module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/directory'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class DirectoryFoo
|
10
|
+
include Windows::Directory
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Directory < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = DirectoryFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_method_constants
|
19
|
+
assert_not_nil(DirectoryFoo::CreateDirectory)
|
20
|
+
end
|
21
|
+
|
22
|
+
def teardown
|
23
|
+
@foo = nil
|
24
|
+
end
|
25
|
+
end
|
data/test/tc_error.rb
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
#####################################################################
|
2
|
-
# tc_error.rb
|
3
|
-
#
|
4
|
-
# Test case for the Windows::Error module.
|
5
|
-
#####################################################################
|
6
|
-
require "windows/error"
|
7
|
-
require "test/unit"
|
8
|
-
|
9
|
-
class TC_Windows_Error < Test::Unit::TestCase
|
10
|
-
include Windows::Error
|
11
|
-
|
12
|
-
def test_numeric_constants
|
13
|
-
assert_equal(0x00000100, FORMAT_MESSAGE_ALLOCATE_BUFFER)
|
14
|
-
assert_equal(0x00000200, FORMAT_MESSAGE_IGNORE_INSERTS)
|
15
|
-
assert_equal(0x00000400, FORMAT_MESSAGE_FROM_STRING)
|
16
|
-
assert_equal(0x00000800, FORMAT_MESSAGE_FROM_HMODULE)
|
17
|
-
assert_equal(0x00001000, FORMAT_MESSAGE_FROM_SYSTEM)
|
18
|
-
assert_equal(0x00002000, FORMAT_MESSAGE_ARGUMENT_ARRAY)
|
19
|
-
assert_equal(0x000000FF, FORMAT_MESSAGE_MAX_WIDTH_MASK)
|
20
|
-
assert_equal(0x0001, SEM_FAILCRITICALERRORS)
|
21
|
-
assert_equal(0x0004, SEM_NOALIGNMENTFAULTEXCEPT)
|
22
|
-
assert_equal(0x0002, SEM_NOGPFAULTERRORBOX)
|
23
|
-
assert_equal(0x8000, SEM_NOOPENFILEERRORBOX)
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_method_constants
|
27
|
-
assert_not_nil(GetLastError)
|
28
|
-
assert_not_nil(SetLastError)
|
29
|
-
assert_not_nil(SetLastErrorEx)
|
30
|
-
assert_not_nil(SetErrorMode)
|
31
|
-
assert_not_nil(FormatMessage)
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_get_last_error
|
35
|
-
assert_nothing_raised{ get_last_error }
|
36
|
-
assert_kind_of(String, get_last_error)
|
37
|
-
end
|
38
|
-
end
|
1
|
+
#####################################################################
|
2
|
+
# tc_error.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Error module.
|
5
|
+
#####################################################################
|
6
|
+
require "windows/error"
|
7
|
+
require "test/unit"
|
8
|
+
|
9
|
+
class TC_Windows_Error < Test::Unit::TestCase
|
10
|
+
include Windows::Error
|
11
|
+
|
12
|
+
def test_numeric_constants
|
13
|
+
assert_equal(0x00000100, FORMAT_MESSAGE_ALLOCATE_BUFFER)
|
14
|
+
assert_equal(0x00000200, FORMAT_MESSAGE_IGNORE_INSERTS)
|
15
|
+
assert_equal(0x00000400, FORMAT_MESSAGE_FROM_STRING)
|
16
|
+
assert_equal(0x00000800, FORMAT_MESSAGE_FROM_HMODULE)
|
17
|
+
assert_equal(0x00001000, FORMAT_MESSAGE_FROM_SYSTEM)
|
18
|
+
assert_equal(0x00002000, FORMAT_MESSAGE_ARGUMENT_ARRAY)
|
19
|
+
assert_equal(0x000000FF, FORMAT_MESSAGE_MAX_WIDTH_MASK)
|
20
|
+
assert_equal(0x0001, SEM_FAILCRITICALERRORS)
|
21
|
+
assert_equal(0x0004, SEM_NOALIGNMENTFAULTEXCEPT)
|
22
|
+
assert_equal(0x0002, SEM_NOGPFAULTERRORBOX)
|
23
|
+
assert_equal(0x8000, SEM_NOOPENFILEERRORBOX)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_method_constants
|
27
|
+
assert_not_nil(GetLastError)
|
28
|
+
assert_not_nil(SetLastError)
|
29
|
+
assert_not_nil(SetLastErrorEx)
|
30
|
+
assert_not_nil(SetErrorMode)
|
31
|
+
assert_not_nil(FormatMessage)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_get_last_error
|
35
|
+
assert_nothing_raised{ get_last_error }
|
36
|
+
assert_kind_of(String, get_last_error)
|
37
|
+
end
|
38
|
+
end
|