diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-01 07:42:01 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-01 07:42:01 +0000 |
commit | 509e3e9d31059b06ed40b886e1c03095236413b5 (patch) | |
tree | 984761f1af20282a7d80bae755fd375b99a725f5 /test | |
parent | 83f1241ad5a791df2c2dfbf0be3a316e37c70c67 (diff) |
merges r28456 and r28476 from trunk into ruby_1_9_2.
--
* test/win32ole/test_win32ole_method.rb (test_offset_vtbl): check
that Ruby is 32bit or 64bit binary in order to get correct offset
value. [ruby-dev:41741]
--
* test/win32ole/test_win32ole_method.rb (is_ruby64): check
ruby binary is mswin64 or mingw64. [ruby-dev:41756]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/win32ole/test_win32ole_method.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/test/win32ole/test_win32ole_method.rb b/test/win32ole/test_win32ole_method.rb index 2be93ab070..e4f38eac61 100644 --- a/test/win32ole/test_win32ole_method.rb +++ b/test/win32ole/test_win32ole_method.rb @@ -108,28 +108,12 @@ if defined?(WIN32OLE_METHOD) assert_equal(1610743810, @m_namespace.dispid) end - def is_win64? - if /win64$/ =~ RUBY_PLATFORM - return true - end - require 'Win32API' - get_current_process = Win32API.new('kernel32', 'GetCurrentProcess', nil, 'i') - handle = get_current_process.call - is_wow64 = false - begin - is_wow64_process = Win32API.new('Kernel32', 'IsWow64Process', ['i', 'p'], 'i') - bool = "\0\0\0\0" - if is_wow64_process.call(handle, bool) != 0 - is_wow64 = bool != "\0\0\0\0" - end - rescue RuntimeError - # no IsWow64Process - end - is_wow64 + def is_ruby64? + /mswin64|mingw64/ =~ RUBY_PLATFORM end def test_offset_vtbl - exp = is_win64? ? 48 : 24 + exp = is_ruby64? ? 48 : 24 assert_equal(exp, @m_invoke.offset_vtbl) end |