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.
Files changed (123) hide show
  1. data/CHANGES +15 -0
  2. data/MANIFEST +65 -65
  3. data/README +149 -149
  4. data/Rakefile +37 -52
  5. data/doc/conversion_guide.txt +37 -37
  6. data/lib/windows/clipboard.rb +2 -0
  7. data/lib/windows/com.rb +2 -0
  8. data/lib/windows/com/accessibility.rb +12 -10
  9. data/lib/windows/com/automation.rb +149 -147
  10. data/lib/windows/com/variant.rb +24 -22
  11. data/lib/windows/console.rb +114 -112
  12. data/lib/windows/debug.rb +35 -33
  13. data/lib/windows/device_io.rb +248 -246
  14. data/lib/windows/directory.rb +2 -0
  15. data/lib/windows/error.rb +2 -0
  16. data/lib/windows/eventlog.rb +2 -0
  17. data/lib/windows/file.rb +264 -262
  18. data/lib/windows/file_mapping.rb +25 -23
  19. data/lib/windows/filesystem.rb +2 -0
  20. data/lib/windows/gdi/bitmap.rb +65 -63
  21. data/lib/windows/gdi/device_context.rb +46 -44
  22. data/lib/windows/gdi/metafile.rb +40 -38
  23. data/lib/windows/gdi/painting_drawing.rb +115 -113
  24. data/lib/windows/handle.rb +2 -0
  25. data/lib/windows/library.rb +2 -0
  26. data/lib/windows/limits.rb +34 -31
  27. data/lib/windows/mailslot.rb +2 -0
  28. data/lib/windows/memory.rb +2 -0
  29. data/lib/windows/msvcrt/buffer.rb +75 -73
  30. data/lib/windows/msvcrt/directory.rb +31 -29
  31. data/lib/windows/msvcrt/file.rb +47 -45
  32. data/lib/windows/msvcrt/io.rb +62 -60
  33. data/lib/windows/msvcrt/string.rb +2 -0
  34. data/lib/windows/msvcrt/time.rb +169 -167
  35. data/lib/windows/national.rb +580 -578
  36. data/lib/windows/network/management.rb +525 -523
  37. data/lib/windows/network/snmp.rb +92 -90
  38. data/lib/windows/network/winsock.rb +128 -126
  39. data/lib/windows/nio.rb +2 -0
  40. data/lib/windows/ntfs/winternl.rb +96 -82
  41. data/lib/windows/path.rb +143 -141
  42. data/lib/windows/pipe.rb +42 -40
  43. data/lib/windows/process.rb +2 -0
  44. data/lib/windows/registry.rb +171 -126
  45. data/lib/windows/security.rb +479 -477
  46. data/lib/windows/security/authentication.rb +32 -30
  47. data/lib/windows/service.rb +142 -140
  48. data/lib/windows/shell.rb +171 -169
  49. data/lib/windows/socket.rb +86 -0
  50. data/lib/windows/sound.rb +39 -37
  51. data/lib/windows/synchronize.rb +133 -131
  52. data/lib/windows/system_info.rb +4 -2
  53. data/lib/windows/thread.rb +2 -0
  54. data/lib/windows/time.rb +48 -46
  55. data/lib/windows/tool_helper.rb +36 -34
  56. data/lib/windows/unicode.rb +2 -0
  57. data/lib/windows/volume.rb +61 -59
  58. data/lib/windows/window.rb +81 -79
  59. data/lib/windows/window/classes.rb +59 -57
  60. data/lib/windows/window/dialog.rb +91 -89
  61. data/lib/windows/window/menu.rb +102 -100
  62. data/lib/windows/window/message.rb +297 -295
  63. data/lib/windows/window/properties.rb +20 -18
  64. data/lib/windows/window/timer.rb +19 -17
  65. data/lib/windows/wsa.rb +102 -0
  66. data/test/tc_clipboard.rb +41 -41
  67. data/test/tc_com.rb +32 -32
  68. data/test/tc_com_automation.rb +15 -15
  69. data/test/tc_console.rb +108 -108
  70. data/test/tc_debug.rb +48 -48
  71. data/test/tc_device_io.rb +29 -29
  72. data/test/tc_directory.rb +25 -25
  73. data/test/tc_error.rb +38 -50
  74. data/test/tc_eventlog.rb +58 -58
  75. data/test/tc_file.rb +67 -67
  76. data/test/tc_file_mapping.rb +38 -38
  77. data/test/tc_filesystem.rb +27 -27
  78. data/test/tc_gdi_bitmap.rb +25 -25
  79. data/test/tc_gdi_metafile.rb +23 -23
  80. data/test/tc_handle.rb +36 -36
  81. data/test/tc_library.rb +37 -37
  82. data/test/tc_limits.rb +34 -34
  83. data/test/tc_mailslot.rb +22 -22
  84. data/test/tc_memory.rb +44 -44
  85. data/test/tc_msvcrt_buffer.rb +59 -68
  86. data/test/tc_msvcrt_directory.rb +96 -98
  87. data/test/tc_msvcrt_file.rb +80 -80
  88. data/test/tc_msvcrt_io.rb +48 -48
  89. data/test/tc_msvcrt_string.rb +94 -93
  90. data/test/tc_msvcrt_time.rb +19 -29
  91. data/test/tc_national.rb +38 -38
  92. data/test/tc_network_management.rb +32 -32
  93. data/test/tc_network_snmp.rb +31 -31
  94. data/test/tc_network_winsock.rb +34 -34
  95. data/test/tc_nio.rb +32 -32
  96. data/test/tc_ntfs_winternl.rb +33 -18
  97. data/test/tc_path.rb +90 -90
  98. data/test/tc_pipe.rb +53 -53
  99. data/test/tc_process.rb +24 -24
  100. data/test/tc_registry.rb +29 -29
  101. data/test/tc_security.rb +104 -104
  102. data/test/tc_security_authentication.rb +34 -34
  103. data/test/tc_service.rb +57 -57
  104. data/test/tc_shell.rb +34 -34
  105. data/test/tc_socket.rb +20 -0
  106. data/test/tc_sound.rb +37 -37
  107. data/test/tc_synchronize.rb +75 -75
  108. data/test/tc_system_info.rb +33 -43
  109. data/test/tc_thread.rb +29 -29
  110. data/test/tc_time.rb +32 -32
  111. data/test/tc_tool_helper.rb +29 -29
  112. data/test/tc_unicode.rb +62 -62
  113. data/test/tc_volume.rb +47 -47
  114. data/test/tc_window.rb +45 -45
  115. data/test/tc_window_classes.rb +33 -33
  116. data/test/tc_window_dialog.rb +33 -33
  117. data/test/tc_window_menu.rb +29 -29
  118. data/test/tc_window_message.rb +33 -33
  119. data/test/tc_window_properties.rb +29 -29
  120. data/test/tc_window_timer.rb +29 -29
  121. data/test/tc_wsa.rb +19 -0
  122. data/windows-pr.gemspec +1 -1
  123. metadata +13 -7
data/test/tc_thread.rb CHANGED
@@ -1,29 +1,29 @@
1
- #####################################################################
2
- # tc_thread.rb
3
- #
4
- # Test case for the Windows::Thread module.
5
- #####################################################################
6
- require 'windows/thread'
7
- require 'test/unit'
8
-
9
- class ThreadFoo
10
- include Windows::Thread
11
- end
12
-
13
- class TC_Windows_Thread < Test::Unit::TestCase
14
- def setup
15
- @foo = ThreadFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0x00100000, ThreadFoo::SYNCHRONIZE)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(ThreadFoo::CreateThread)
24
- end
25
-
26
- def teardown
27
- @foo = nil
28
- end
29
- end
1
+ #####################################################################
2
+ # tc_thread.rb
3
+ #
4
+ # Test case for the Windows::Thread module.
5
+ #####################################################################
6
+ require 'windows/thread'
7
+ require 'test/unit'
8
+
9
+ class ThreadFoo
10
+ include Windows::Thread
11
+ end
12
+
13
+ class TC_Windows_Thread < Test::Unit::TestCase
14
+ def setup
15
+ @foo = ThreadFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0x00100000, ThreadFoo::SYNCHRONIZE)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(ThreadFoo::CreateThread)
24
+ end
25
+
26
+ def teardown
27
+ @foo = nil
28
+ end
29
+ end
data/test/tc_time.rb CHANGED
@@ -1,32 +1,32 @@
1
- #####################################################################
2
- # tc_time.rb
3
- #
4
- # Test case for the Windows::Time module.
5
- #####################################################################
6
- require 'windows/time'
7
- require 'test/unit'
8
-
9
- class TimeFoo
10
- include Windows::Time
11
- end
12
-
13
- class TC_Windows_Time < Test::Unit::TestCase
14
- def setup
15
- @foo = TimeFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, TimeFoo::TIME_ZONE_ID_UNKNOWN)
20
- assert_equal(1, TimeFoo::TIME_ZONE_ID_STANDARD)
21
- assert_equal(2, TimeFoo::TIME_ZONE_ID_DAYLIGHT)
22
- end
23
-
24
- def test_method_constants
25
- assert_not_nil(TimeFoo::CompareFileTime)
26
- assert_not_nil(TimeFoo::GetLocalTime)
27
- end
28
-
29
- def teardown
30
- @foo = nil
31
- end
32
- end
1
+ #####################################################################
2
+ # tc_time.rb
3
+ #
4
+ # Test case for the Windows::Time module.
5
+ #####################################################################
6
+ require 'windows/time'
7
+ require 'test/unit'
8
+
9
+ class TimeFoo
10
+ include Windows::Time
11
+ end
12
+
13
+ class TC_Windows_Time < Test::Unit::TestCase
14
+ def setup
15
+ @foo = TimeFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, TimeFoo::TIME_ZONE_ID_UNKNOWN)
20
+ assert_equal(1, TimeFoo::TIME_ZONE_ID_STANDARD)
21
+ assert_equal(2, TimeFoo::TIME_ZONE_ID_DAYLIGHT)
22
+ end
23
+
24
+ def test_method_constants
25
+ assert_not_nil(TimeFoo::CompareFileTime)
26
+ assert_not_nil(TimeFoo::GetLocalTime)
27
+ end
28
+
29
+ def teardown
30
+ @foo = nil
31
+ end
32
+ end
@@ -1,29 +1,29 @@
1
- #####################################################################
2
- # tc_tool_helper.rb
3
- #
4
- # Test case for the Windows::ToolHelper module.
5
- #####################################################################
6
- require 'windows/tool_helper'
7
- require 'test/unit'
8
-
9
- class ToolHelperFoo
10
- include Windows::ToolHelper
11
- end
12
-
13
- class TC_Windows_ToolHelper < Test::Unit::TestCase
14
- def setup
15
- @foo = ToolHelperFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0x00000001, ToolHelperFoo::TH32CS_SNAPHEAPLIST)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(ToolHelperFoo::Process32First)
24
- end
25
-
26
- def teardown
27
- @foo = nil
28
- end
29
- end
1
+ #####################################################################
2
+ # tc_tool_helper.rb
3
+ #
4
+ # Test case for the Windows::ToolHelper module.
5
+ #####################################################################
6
+ require 'windows/tool_helper'
7
+ require 'test/unit'
8
+
9
+ class ToolHelperFoo
10
+ include Windows::ToolHelper
11
+ end
12
+
13
+ class TC_Windows_ToolHelper < Test::Unit::TestCase
14
+ def setup
15
+ @foo = ToolHelperFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0x00000001, ToolHelperFoo::TH32CS_SNAPHEAPLIST)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(ToolHelperFoo::Process32First)
24
+ end
25
+
26
+ def teardown
27
+ @foo = nil
28
+ end
29
+ end
data/test/tc_unicode.rb CHANGED
@@ -8,76 +8,76 @@ require "windows/unicode"
8
8
  require "test/unit"
9
9
 
10
10
  class TC_Windows_Unicode < Test::Unit::TestCase
11
- include Windows::Unicode
11
+ include Windows::Unicode
12
12
 
13
- def test_numeric_constants
14
- assert_equal(0, CP_ACP)
15
- assert_equal(1, CP_OEMCP)
16
- assert_equal(2, CP_MACCP)
17
- assert_equal(3, CP_THREAD_ACP)
18
- assert_equal(42, CP_SYMBOL)
19
- assert_equal(65000, CP_UTF7)
20
- assert_equal(65001, CP_UTF8)
13
+ def test_numeric_constants
14
+ assert_equal(0, CP_ACP)
15
+ assert_equal(1, CP_OEMCP)
16
+ assert_equal(2, CP_MACCP)
17
+ assert_equal(3, CP_THREAD_ACP)
18
+ assert_equal(42, CP_SYMBOL)
19
+ assert_equal(65000, CP_UTF7)
20
+ assert_equal(65001, CP_UTF8)
21
21
 
22
- assert_equal(0x00000001, MB_PRECOMPOSED)
23
- assert_equal(0x00000002, MB_COMPOSITE)
24
- assert_equal(0x00000004, MB_USEGLYPHCHARS)
25
- assert_equal(0x00000008, MB_ERR_INVALID_CHARS)
22
+ assert_equal(0x00000001, MB_PRECOMPOSED)
23
+ assert_equal(0x00000002, MB_COMPOSITE)
24
+ assert_equal(0x00000004, MB_USEGLYPHCHARS)
25
+ assert_equal(0x00000008, MB_ERR_INVALID_CHARS)
26
26
 
27
- assert_equal(0x00000200, WC_COMPOSITECHECK)
28
- assert_equal(0x00000010, WC_DISCARDNS)
29
- assert_equal(0x00000020, WC_SEPCHARS)
30
- assert_equal(0x00000040, WC_DEFAULTCHAR)
31
- assert_equal(0x00000400, WC_NO_BEST_FIT_CHARS)
32
- end
27
+ assert_equal(0x00000200, WC_COMPOSITECHECK)
28
+ assert_equal(0x00000010, WC_DISCARDNS)
29
+ assert_equal(0x00000020, WC_SEPCHARS)
30
+ assert_equal(0x00000040, WC_DEFAULTCHAR)
31
+ assert_equal(0x00000400, WC_NO_BEST_FIT_CHARS)
32
+ end
33
33
 
34
- def test_method_constants
35
- assert_respond_to(self, :GetTextCharset)
36
- assert_respond_to(self, :GetTextCharsetInfo)
37
- assert_respond_to(self, :IsDBCSLeadByte)
38
- assert_respond_to(self, :IsDBCSLeadByteEx)
39
- assert_respond_to(self, :IsTextUnicode)
40
- assert_respond_to(self, :MultiByteToWideChar)
41
- assert_respond_to(self, :TranslateCharsetInfo)
42
- assert_respond_to(self, :WideCharToMultiByte)
43
- end
34
+ def test_method_constants
35
+ assert_respond_to(self, :GetTextCharset)
36
+ assert_respond_to(self, :GetTextCharsetInfo)
37
+ assert_respond_to(self, :IsDBCSLeadByte)
38
+ assert_respond_to(self, :IsDBCSLeadByteEx)
39
+ assert_respond_to(self, :IsTextUnicode)
40
+ assert_respond_to(self, :MultiByteToWideChar)
41
+ assert_respond_to(self, :TranslateCharsetInfo)
42
+ assert_respond_to(self, :WideCharToMultiByte)
43
+ end
44
44
 
45
- def test_multi_to_wide
46
- assert_respond_to(self, :multi_to_wide)
47
- assert_equal("\000\000", multi_to_wide(''))
48
- assert_equal("h\000e\000l\000l\000o\000\000\000", multi_to_wide('hello'))
49
- assert_equal("\316\000\" \316\000\273\000\316\000\273\000\316\000\254\000\317\000\222\001\000\000", multi_to_wide("Ελλάσ"))
50
- end
45
+ def test_multi_to_wide
46
+ assert(self.respond_to?(:multi_to_wide, true))
47
+ assert_equal("\000\000", multi_to_wide(''))
48
+ assert_equal("h\000e\000l\000l\000o\000\000\000", multi_to_wide('hello'))
49
+ assert_equal(
50
+ "\316\000\" \316\000\273\000\316\000\273\000\316\000\254\000\317\000\222\001\000\000",
51
+ multi_to_wide("Ελλάσ")
52
+ )
53
+ end
51
54
 
52
- def test_multi_to_wide_with_encoding
53
- assert_equal("h\000e\000l\000l\000o\000\000\000", multi_to_wide('hello', CP_UTF8))
54
- assert_equal("\225\003\273\003\273\003\254\003\303\003\000\000", multi_to_wide("Ελλάσ", CP_UTF8))
55
- end
55
+ def test_multi_to_wide_with_encoding
56
+ assert_equal("h\000e\000l\000l\000o\000\000\000", multi_to_wide('hello', CP_UTF8))
57
+ assert_equal("\225\003\273\003\273\003\254\003\303\003\000\000", multi_to_wide("Ελλάσ", CP_UTF8))
58
+ end
56
59
 
57
- def test_multi_to_wide_expected_errors
58
- assert_raise(TypeError){ multi_to_wide(1) }
59
- assert_raise(TypeError){ multi_to_wide([]) }
60
- end
60
+ def test_multi_to_wide_expected_errors
61
+ assert_raise(TypeError){ multi_to_wide(1) }
62
+ assert_raise(TypeError){ multi_to_wide([]) }
63
+ end
61
64
 
62
- def test_wide_to_multi
63
- assert_respond_to(self, :wide_to_multi)
64
- assert_equal('', wide_to_multi("\000\000"))
65
- assert_equal('hello', wide_to_multi("h\000e\000l\000l\000o\000\000\000"))
66
- assert_equal("Ελλάσ", wide_to_multi("\316\000\" \316\000\273\000\316\000\273\000\316\000\254\000\317\000\222\001\000\000"))
67
- end
65
+ def test_wide_to_multi
66
+ assert(self.respond_to?(:wide_to_multi, true))
67
+ assert_equal('', wide_to_multi("\000\000"))
68
+ assert_equal('hello', wide_to_multi("h\000e\000l\000l\000o\000\000\000"))
69
+ assert_equal("Ελλάσ",
70
+ wide_to_multi("\316\000\" \316\000\273\000\316\000\273\000\316\000\254\000\317\000\222\001\000\000")
71
+ )
72
+ end
68
73
 
69
- def test_wide_to_multi_with_encoding
70
- assert_equal('hello', wide_to_multi("h\000e\000l\000l\000o\000\000\000"), CP_UTF8)
71
- assert_equal("Ελλάσ", wide_to_multi("\225\003\273\003\273\003\254\003\303\003\000\000", CP_UTF8))
72
- end
74
+ def test_wide_to_multi_with_encoding
75
+ assert_equal('hello', wide_to_multi("h\000e\000l\000l\000o\000\000\000"), CP_UTF8)
76
+ assert_equal("Ελλάσ", wide_to_multi("\225\003\273\003\273\003\254\003\303\003\000\000", CP_UTF8))
77
+ end
73
78
 
74
- def test_wide_to_multi_expected_errors
75
- assert_raise(TypeError){ wide_to_multi(1) }
76
- assert_raise(TypeError){ wide_to_multi([]) }
77
- end
78
-
79
- def teardown
80
- @foo = nil
81
- @unicode = nil
82
- end
79
+ def test_wide_to_multi_expected_errors
80
+ assert_raise(TypeError){ wide_to_multi(1) }
81
+ assert_raise(TypeError){ wide_to_multi([]) }
82
+ end
83
83
  end
data/test/tc_volume.rb CHANGED
@@ -1,47 +1,47 @@
1
- #####################################################################
2
- # tc_volume.rb
3
- #
4
- # Test case for the Windows::Volume module.
5
- #####################################################################
6
- require 'windows/volume'
7
- require 'test/unit'
8
-
9
- class TC_Windows_Volume < Test::Unit::TestCase
10
- include Windows::Volume
11
-
12
- def test_constants
13
- assert_equal(0, DRIVE_UNKNOWN)
14
- assert_equal(1, DRIVE_NO_ROOT_DIR)
15
- assert_equal(2, DRIVE_REMOVABLE)
16
- assert_equal(3, DRIVE_FIXED)
17
- assert_equal(4, DRIVE_REMOTE)
18
- assert_equal(5, DRIVE_CDROM)
19
- assert_equal(6, DRIVE_RAMDISK)
20
- end
21
-
22
- def test_method_constants
23
- assert_not_nil(DefineDosDevice)
24
- assert_not_nil(DeleteVolumeMountPoint)
25
- assert_not_nil(FindFirstVolume)
26
- assert_not_nil(FindFirstVolumeMountPoint)
27
- assert_not_nil(FindNextVolume)
28
- assert_not_nil(FindNextVolumeMountPoint)
29
- assert_not_nil(FindVolumeClose)
30
- assert_not_nil(FindVolumeMountPointClose)
31
- assert_not_nil(GetDriveType)
32
- assert_not_nil(GetLogicalDrives)
33
- assert_not_nil(GetLogicalDriveStrings)
34
- assert_not_nil(GetVolumeInformation)
35
- assert_not_nil(GetVolumeNameForVolumeMountPoint)
36
- assert_not_nil(GetVolumePathName)
37
- assert_not_nil(QueryDosDevice)
38
- assert_not_nil(SetVolumeLabel)
39
- assert_not_nil(SetVolumeMountPoint)
40
- end
41
-
42
- def test_get_volume_type
43
- assert_respond_to(self, :get_volume_type)
44
- assert_nothing_raised{ get_volume_type }
45
- assert_kind_of(String, get_volume_type)
46
- end
47
- end
1
+ #####################################################################
2
+ # tc_volume.rb
3
+ #
4
+ # Test case for the Windows::Volume module.
5
+ #####################################################################
6
+ require 'windows/volume'
7
+ require 'test/unit'
8
+
9
+ class TC_Windows_Volume < Test::Unit::TestCase
10
+ include Windows::Volume
11
+
12
+ def test_constants
13
+ assert_equal(0, DRIVE_UNKNOWN)
14
+ assert_equal(1, DRIVE_NO_ROOT_DIR)
15
+ assert_equal(2, DRIVE_REMOVABLE)
16
+ assert_equal(3, DRIVE_FIXED)
17
+ assert_equal(4, DRIVE_REMOTE)
18
+ assert_equal(5, DRIVE_CDROM)
19
+ assert_equal(6, DRIVE_RAMDISK)
20
+ end
21
+
22
+ def test_method_constants
23
+ assert_not_nil(DefineDosDevice)
24
+ assert_not_nil(DeleteVolumeMountPoint)
25
+ assert_not_nil(FindFirstVolume)
26
+ assert_not_nil(FindFirstVolumeMountPoint)
27
+ assert_not_nil(FindNextVolume)
28
+ assert_not_nil(FindNextVolumeMountPoint)
29
+ assert_not_nil(FindVolumeClose)
30
+ assert_not_nil(FindVolumeMountPointClose)
31
+ assert_not_nil(GetDriveType)
32
+ assert_not_nil(GetLogicalDrives)
33
+ assert_not_nil(GetLogicalDriveStrings)
34
+ assert_not_nil(GetVolumeInformation)
35
+ assert_not_nil(GetVolumeNameForVolumeMountPoint)
36
+ assert_not_nil(GetVolumePathName)
37
+ assert_not_nil(QueryDosDevice)
38
+ assert_not_nil(SetVolumeLabel)
39
+ assert_not_nil(SetVolumeMountPoint)
40
+ end
41
+
42
+ def test_get_volume_type
43
+ assert(self.respond_to?(:get_volume_type, true))
44
+ assert_nothing_raised{ get_volume_type }
45
+ assert_kind_of(String, get_volume_type)
46
+ end
47
+ end
data/test/tc_window.rb CHANGED
@@ -1,45 +1,45 @@
1
- #####################################################################
2
- # tc_window.rb
3
- #
4
- # Test case for the Windows::Window module.
5
- #####################################################################
6
- require 'windows/window'
7
- require 'test/unit'
8
-
9
- class WindowFoo
10
- include Windows::Window
11
- end
12
-
13
- class TC_Windows_Window < Test::Unit::TestCase
14
- def setup
15
- @foo = WindowFoo.new
16
- end
17
-
18
- def test_numeric_constants
19
- assert_equal(0, WindowFoo::SW_HIDE)
20
- assert_equal(1, WindowFoo::SW_SHOWNORMAL)
21
- assert_equal(1, WindowFoo::SW_NORMAL)
22
- assert_equal(2, WindowFoo::SW_SHOWMINIMIZED)
23
- assert_equal(3, WindowFoo::SW_SHOWMAXIMIZED)
24
- assert_equal(3, WindowFoo::SW_MAXIMIZE)
25
- assert_equal(4, WindowFoo::SW_SHOWNOACTIVATE)
26
- assert_equal(5, WindowFoo::SW_SHOW)
27
- assert_equal(6, WindowFoo::SW_MINIMIZE)
28
- assert_equal(7, WindowFoo::SW_SHOWMINNOACTIVE)
29
- assert_equal(8, WindowFoo::SW_SHOWNA)
30
- assert_equal(9, WindowFoo::SW_RESTORE)
31
- assert_equal(10, WindowFoo::SW_SHOWDEFAULT)
32
- assert_equal(11, WindowFoo::SW_FORCEMINIMIZE)
33
- assert_equal(11, WindowFoo::SW_MAX)
34
- end
35
-
36
- def test_method_constants
37
- assert_not_nil(WindowFoo::GetClientRect)
38
- assert_not_nil(WindowFoo::GetForegroundWindow)
39
- assert_not_nil(WindowFoo::GetWindowRect)
40
- end
41
-
42
- def teardown
43
- @foo = nil
44
- end
45
- end
1
+ #####################################################################
2
+ # tc_window.rb
3
+ #
4
+ # Test case for the Windows::Window module.
5
+ #####################################################################
6
+ require 'windows/window'
7
+ require 'test/unit'
8
+
9
+ class WindowFoo
10
+ include Windows::Window
11
+ end
12
+
13
+ class TC_Windows_Window < Test::Unit::TestCase
14
+ def setup
15
+ @foo = WindowFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, WindowFoo::SW_HIDE)
20
+ assert_equal(1, WindowFoo::SW_SHOWNORMAL)
21
+ assert_equal(1, WindowFoo::SW_NORMAL)
22
+ assert_equal(2, WindowFoo::SW_SHOWMINIMIZED)
23
+ assert_equal(3, WindowFoo::SW_SHOWMAXIMIZED)
24
+ assert_equal(3, WindowFoo::SW_MAXIMIZE)
25
+ assert_equal(4, WindowFoo::SW_SHOWNOACTIVATE)
26
+ assert_equal(5, WindowFoo::SW_SHOW)
27
+ assert_equal(6, WindowFoo::SW_MINIMIZE)
28
+ assert_equal(7, WindowFoo::SW_SHOWMINNOACTIVE)
29
+ assert_equal(8, WindowFoo::SW_SHOWNA)
30
+ assert_equal(9, WindowFoo::SW_RESTORE)
31
+ assert_equal(10, WindowFoo::SW_SHOWDEFAULT)
32
+ assert_equal(11, WindowFoo::SW_FORCEMINIMIZE)
33
+ assert_equal(11, WindowFoo::SW_MAX)
34
+ end
35
+
36
+ def test_method_constants
37
+ assert_not_nil(WindowFoo::GetClientRect)
38
+ assert_not_nil(WindowFoo::GetForegroundWindow)
39
+ assert_not_nil(WindowFoo::GetWindowRect)
40
+ end
41
+
42
+ def teardown
43
+ @foo = nil
44
+ end
45
+ end