windows-pr 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +5 -0
- data/Rakefile +3 -3
- data/test/helper.rb +13 -0
- data/test/tc_clipboard.rb +2 -2
- data/test/tc_com.rb +2 -2
- data/test/tc_com_automation.rb +2 -2
- data/test/tc_console.rb +2 -2
- data/test/tc_debug.rb +3 -3
- data/test/tc_device_io.rb +2 -2
- data/test/tc_directory.rb +2 -2
- data/test/tc_error.rb +7 -7
- data/test/tc_eventlog.rb +5 -5
- data/test/tc_file.rb +18 -18
- data/test/tc_file_mapping.rb +7 -7
- data/test/tc_filesystem.rb +6 -6
- data/test/tc_gdi_bitmap.rb +2 -2
- data/test/tc_gdi_metafile.rb +2 -2
- data/test/tc_handle.rb +5 -6
- data/test/tc_library.rb +3 -3
- data/test/tc_limits.rb +4 -5
- data/test/tc_mailslot.rb +2 -2
- data/test/tc_memory.rb +2 -2
- data/test/tc_msvcrt_buffer.rb +2 -2
- data/test/tc_msvcrt_directory.rb +7 -7
- data/test/tc_msvcrt_file.rb +5 -5
- data/test/tc_msvcrt_io.rb +5 -5
- data/test/tc_msvcrt_string.rb +2 -2
- data/test/tc_msvcrt_time.rb +3 -3
- data/test/tc_national.rb +5 -5
- data/test/tc_network_management.rb +5 -5
- data/test/tc_network_snmp.rb +4 -4
- data/test/tc_network_winsock.rb +4 -4
- data/test/tc_nio.rb +4 -4
- data/test/tc_ntfs_winternl.rb +3 -3
- data/test/tc_path.rb +2 -2
- data/test/tc_pipe.rb +5 -6
- data/test/tc_process.rb +2 -2
- data/test/tc_registry.rb +2 -2
- data/test/tc_security.rb +2 -2
- data/test/tc_security_authentication.rb +2 -2
- data/test/tc_security_sspi.rb +2 -2
- data/test/tc_service.rb +4 -4
- data/test/tc_shell.rb +4 -4
- data/test/tc_socket.rb +15 -5
- data/test/tc_sound.rb +4 -4
- data/test/tc_synchronize.rb +5 -5
- data/test/tc_system_info.rb +3 -3
- data/test/tc_thread.rb +2 -2
- data/test/tc_time.rb +4 -4
- data/test/tc_tool_helper.rb +2 -2
- data/test/tc_unicode.rb +8 -8
- data/test/tc_volume.rb +2 -2
- data/test/tc_window.rb +4 -4
- data/test/tc_window_classes.rb +4 -4
- data/test/tc_window_dialog.rb +4 -4
- data/test/tc_window_menu.rb +4 -4
- data/test/tc_window_message.rb +4 -4
- data/test/tc_window_properties.rb +3 -3
- data/test/tc_window_timer.rb +3 -3
- data/test/tc_wsa.rb +2 -2
- data/windows-pr.gemspec +1 -3
- metadata +13 -12
data/test/tc_process.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
# Test case for the Windows::Process module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/process'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
|
-
class TC_Windows_Process <
|
9
|
+
class TC_Windows_Process < MiniTest::Unit::TestCase
|
10
10
|
include Windows::Process
|
11
11
|
|
12
12
|
def test_constants
|
data/test/tc_registry.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Registry module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/registry'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class RegistryFoo
|
10
10
|
include Windows::Registry
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Registry <
|
13
|
+
class TC_Windows_Registry < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = RegistryFoo.new
|
16
16
|
end
|
data/test/tc_security.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Security module.
|
5
5
|
#####################################################################
|
6
6
|
require "windows/security"
|
7
|
-
require "
|
7
|
+
require "minitest/autorun"
|
8
8
|
|
9
9
|
class SecurityFoo
|
10
10
|
include Windows::Security
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Security <
|
13
|
+
class TC_Windows_Security < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = SecurityFoo.new
|
16
16
|
end
|
@@ -4,9 +4,9 @@
|
|
4
4
|
# Test case for the Windows::Security::Authentication module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/security/authentication'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
|
-
class TC_Windows_Security_Authentication <
|
9
|
+
class TC_Windows_Security_Authentication < MiniTest::Unit::TestCase
|
10
10
|
|
11
11
|
include Windows::Security::Authentication
|
12
12
|
|
data/test/tc_security_sspi.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
# Test case for the Windows::Security::SSPI module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/security/SSPI'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
|
-
class TC_Windows_Security_SSPI <
|
9
|
+
class TC_Windows_Security_SSPI < MiniTest::Unit::TestCase
|
10
10
|
include Windows::Security::SSPI
|
11
11
|
|
12
12
|
def test_methods
|
data/test/tc_service.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Service module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/service'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class ServiceFoo
|
10
10
|
include Windows::Service
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Service <
|
13
|
+
class TC_Windows_Service < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = ServiceFoo.new
|
16
16
|
end
|
@@ -21,7 +21,7 @@ class TC_Windows_Service < Test::Unit::TestCase
|
|
21
21
|
assert_equal(2, ServiceFoo::SC_ACTION_REBOOT)
|
22
22
|
assert_equal(3, ServiceFoo::SC_ACTION_RUN_COMMAND)
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def test_method_constants
|
26
26
|
assert_not_nil(ServiceFoo::ChangeServiceConfig)
|
27
27
|
assert_not_nil(ServiceFoo::ChangeServiceConfig2)
|
@@ -50,7 +50,7 @@ class TC_Windows_Service < Test::Unit::TestCase
|
|
50
50
|
assert_not_nil(ServiceFoo::StartServiceCtrlDispatcher)
|
51
51
|
assert_not_nil(ServiceFoo::UnlockServiceDatabase)
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
def teardown
|
55
55
|
@foo = nil
|
56
56
|
end
|
data/test/tc_shell.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Shell module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/shell'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class ShellFoo
|
10
10
|
include Windows::Shell
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Shell <
|
13
|
+
class TC_Windows_Shell < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = ShellFoo.new
|
16
16
|
end
|
@@ -20,14 +20,14 @@ class TC_Windows_Shell < Test::Unit::TestCase
|
|
20
20
|
assert_equal(1, ShellFoo::CSIDL_INTERNET)
|
21
21
|
assert_equal(2, ShellFoo::CSIDL_PROGRAMS)
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
def test_method_constants
|
25
25
|
assert_not_nil(ShellFoo::DragQueryFile)
|
26
26
|
assert_not_nil(ShellFoo::ExtractIcon)
|
27
27
|
assert_not_nil(ShellFoo::ExtractIconEx)
|
28
28
|
assert_not_nil(ShellFoo::ShellAbout)
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def teardown
|
32
32
|
@foo = nil
|
33
33
|
end
|
data/test/tc_socket.rb
CHANGED
@@ -4,17 +4,27 @@
|
|
4
4
|
# Test case for the Windows::Socket module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/socket'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
|
-
class
|
9
|
+
class SocketFoo
|
10
10
|
include Windows::Socket
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Socket < MiniTest::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@socket = SocketFoo.new
|
16
|
+
end
|
11
17
|
|
12
18
|
def test_methods
|
13
|
-
assert_respond_to(
|
14
|
-
assert_respond_to(
|
19
|
+
assert_respond_to(@socket, :accept)
|
20
|
+
assert_respond_to(@socket, :AcceptEx)
|
15
21
|
end
|
16
22
|
|
17
23
|
def test_constants
|
18
|
-
assert_equal(0, IPPROTO_IP)
|
24
|
+
assert_equal(0, SocketFoo::IPPROTO_IP)
|
25
|
+
end
|
26
|
+
|
27
|
+
def teardown
|
28
|
+
@socket = nil
|
19
29
|
end
|
20
30
|
end
|
data/test/tc_sound.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Sound module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/sound'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class SoundFoo
|
10
10
|
include Windows::Sound
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Sound <
|
13
|
+
class TC_Windows_Sound < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = SoundFoo.new
|
16
16
|
end
|
@@ -23,14 +23,14 @@ class TC_Windows_Sound < Test::Unit::TestCase
|
|
23
23
|
assert_equal(8, SoundFoo::SND_LOOP)
|
24
24
|
assert_equal(16, SoundFoo::SND_NOSTOP)
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def test_method_constants
|
28
28
|
assert_not_nil(SoundFoo::Beep)
|
29
29
|
assert_not_nil(SoundFoo::PlaySound)
|
30
30
|
assert_not_nil(SoundFoo::WaveOutSetVolume)
|
31
31
|
assert_not_nil(SoundFoo::WaveOutGetVolume)
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def teardown
|
35
35
|
@foo = nil
|
36
36
|
end
|
data/test/tc_synchronize.rb
CHANGED
@@ -4,15 +4,15 @@
|
|
4
4
|
# Test case for the windows/synchronize package.
|
5
5
|
##################################################################
|
6
6
|
require "windows/synchronize"
|
7
|
-
require "
|
7
|
+
require "minitest/autorun"
|
8
8
|
|
9
|
-
class TC_Windows_Synchronize <
|
9
|
+
class TC_Windows_Synchronize < MiniTest::Unit::TestCase
|
10
10
|
include Windows::Synchronize
|
11
11
|
|
12
12
|
def setup
|
13
13
|
@handle = (0.chr * 16).unpack('LLLL')
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
def test_numeric_constants
|
17
17
|
assert_not_nil(INFINITE)
|
18
18
|
assert_not_nil(WAIT_OBJECT_0)
|
@@ -43,7 +43,7 @@ class TC_Windows_Synchronize < Test::Unit::TestCase
|
|
43
43
|
assert_not_nil(SEMAPHORE_ALL_ACCESS)
|
44
44
|
assert_not_nil(SEMAPHORE_MODIFY_STATE)
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
def test_method_constants
|
48
48
|
assert_not_nil(CreateEvent)
|
49
49
|
assert_not_nil(CreateMutex)
|
@@ -68,7 +68,7 @@ class TC_Windows_Synchronize < Test::Unit::TestCase
|
|
68
68
|
assert_not_nil(WaitForSingleObject)
|
69
69
|
assert_not_nil(WaitForSingleObjectEx)
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
def teardown
|
73
73
|
@handle = nil
|
74
74
|
end
|
data/test/tc_system_info.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
# Test case for the Windows::SystemInfo module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/system_info'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
|
-
class TC_Windows_SystemInfo <
|
9
|
+
class TC_Windows_SystemInfo < MiniTest::Unit::TestCase
|
10
10
|
include Windows::SystemInfo
|
11
11
|
|
12
12
|
def test_numeric_constants
|
@@ -16,7 +16,7 @@ class TC_Windows_SystemInfo < Test::Unit::TestCase
|
|
16
16
|
assert_equal(2200, PROCESSOR_INTEL_IA64)
|
17
17
|
assert_equal(8664, PROCESSOR_AMD_X8664)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def test_method_constants
|
21
21
|
assert_not_nil(ExpandEnvironmentStrings)
|
22
22
|
assert_not_nil(GetComputerName)
|
data/test/tc_thread.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Thread module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/thread'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class ThreadFoo
|
10
10
|
include Windows::Thread
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Thread <
|
13
|
+
class TC_Windows_Thread < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = ThreadFoo.new
|
16
16
|
end
|
data/test/tc_time.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Time module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/time'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class TimeFoo
|
10
10
|
include Windows::Time
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Time <
|
13
|
+
class TC_Windows_Time < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = TimeFoo.new
|
16
16
|
end
|
@@ -20,12 +20,12 @@ class TC_Windows_Time < Test::Unit::TestCase
|
|
20
20
|
assert_equal(1, TimeFoo::TIME_ZONE_ID_STANDARD)
|
21
21
|
assert_equal(2, TimeFoo::TIME_ZONE_ID_DAYLIGHT)
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
def test_method_constants
|
25
25
|
assert_not_nil(TimeFoo::CompareFileTime)
|
26
26
|
assert_not_nil(TimeFoo::GetLocalTime)
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def teardown
|
30
30
|
@foo = nil
|
31
31
|
end
|
data/test/tc_tool_helper.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::ToolHelper module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/tool_helper'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class ToolHelperFoo
|
10
10
|
include Windows::ToolHelper
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_ToolHelper <
|
13
|
+
class TC_Windows_ToolHelper < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = ToolHelperFoo.new
|
16
16
|
end
|
data/test/tc_unicode.rb
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
# Test case for the Windows::Unicode module.
|
6
6
|
#####################################################################
|
7
7
|
require "windows/unicode"
|
8
|
-
require "
|
8
|
+
require "minitest/autorun"
|
9
9
|
|
10
|
-
class TC_Windows_Unicode <
|
10
|
+
class TC_Windows_Unicode < MiniTest::Unit::TestCase
|
11
11
|
include Windows::Unicode
|
12
12
|
|
13
13
|
def test_numeric_constants
|
@@ -51,17 +51,17 @@ class TC_Windows_Unicode < Test::Unit::TestCase
|
|
51
51
|
multi_to_wide("Ελλάσ")
|
52
52
|
)
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
def test_multi_to_wide_with_encoding
|
56
56
|
assert_equal("h\000e\000l\000l\000o\000\000\000", multi_to_wide('hello', CP_UTF8))
|
57
57
|
assert_equal("\225\003\273\003\273\003\254\003\303\003\000\000", multi_to_wide("Ελλάσ", CP_UTF8))
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
def test_multi_to_wide_expected_errors
|
61
61
|
assert_raise(TypeError){ multi_to_wide(1) }
|
62
62
|
assert_raise(TypeError){ multi_to_wide([]) }
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def test_wide_to_multi
|
66
66
|
assert(self.respond_to?(:wide_to_multi, true))
|
67
67
|
assert_equal('', wide_to_multi("\000\000"))
|
@@ -70,14 +70,14 @@ class TC_Windows_Unicode < Test::Unit::TestCase
|
|
70
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
71
|
)
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
def test_wide_to_multi_with_encoding
|
75
75
|
assert_equal('hello', wide_to_multi("h\000e\000l\000l\000o\000\000\000"), CP_UTF8)
|
76
76
|
assert_equal("Ελλάσ", wide_to_multi("\225\003\273\003\273\003\254\003\303\003\000\000", CP_UTF8))
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
def test_wide_to_multi_expected_errors
|
80
80
|
assert_raise(TypeError){ wide_to_multi(1) }
|
81
|
-
assert_raise(TypeError){ wide_to_multi([]) }
|
81
|
+
assert_raise(TypeError){ wide_to_multi([]) }
|
82
82
|
end
|
83
83
|
end
|
data/test/tc_volume.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
# Test case for the Windows::Volume module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/volume'
|
7
|
-
require '
|
7
|
+
require 'minitest/unit'
|
8
8
|
|
9
|
-
class TC_Windows_Volume <
|
9
|
+
class TC_Windows_Volume < MiniTest::Unit::TestCase
|
10
10
|
include Windows::Volume
|
11
11
|
|
12
12
|
def test_constants
|
data/test/tc_window.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Window module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/window'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class WindowFoo
|
10
10
|
include Windows::Window
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Window <
|
13
|
+
class TC_Windows_Window < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = WindowFoo.new
|
16
16
|
end
|
@@ -32,13 +32,13 @@ class TC_Windows_Window < Test::Unit::TestCase
|
|
32
32
|
assert_equal(11, WindowFoo::SW_FORCEMINIMIZE)
|
33
33
|
assert_equal(11, WindowFoo::SW_MAX)
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def test_method_constants
|
37
37
|
assert_not_nil(WindowFoo::GetClientRect)
|
38
38
|
assert_not_nil(WindowFoo::GetForegroundWindow)
|
39
39
|
assert_not_nil(WindowFoo::GetWindowRect)
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def teardown
|
43
43
|
@foo = nil
|
44
44
|
end
|
data/test/tc_window_classes.rb
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# Test case for the Windows::Window::Classes module.
|
5
5
|
#####################################################################
|
6
6
|
require 'windows/window/classes'
|
7
|
-
require '
|
7
|
+
require 'minitest/autorun'
|
8
8
|
|
9
9
|
class WindowClassesFoo
|
10
10
|
include Windows::Window::Classes
|
11
11
|
end
|
12
12
|
|
13
|
-
class TC_Windows_Window_Classes <
|
13
|
+
class TC_Windows_Window_Classes < MiniTest::Unit::TestCase
|
14
14
|
def setup
|
15
15
|
@foo = WindowClassesFoo.new
|
16
16
|
end
|
@@ -18,7 +18,7 @@ class TC_Windows_Window_Classes < Test::Unit::TestCase
|
|
18
18
|
def test_numeric_constants
|
19
19
|
assert_equal(-8, WindowClassesFoo::GCL_MENUNAME)
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def test_method_constants
|
23
23
|
assert_not_nil(WindowClassesFoo::GetClassInfo)
|
24
24
|
end
|
@@ -26,7 +26,7 @@ class TC_Windows_Window_Classes < Test::Unit::TestCase
|
|
26
26
|
def test_method_mixin
|
27
27
|
assert_respond_to(@foo, :GetClassInfo)
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def teardown
|
31
31
|
@foo = nil
|
32
32
|
end
|