summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-01 02:05:22 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-01 02:05:22 +0000
commit391fb9ecbfbb2e7cca531ec45bfdc065b646084c (patch)
treef9cf453b23499d5e017e5283313078ee0e14a0ec
parentba87ab3a7e05e157ef7d29c9f6dc1e40e1f087d2 (diff)
merges r28442 from trunk into ruby_1_9_2.
-- * test/win32ole/test_win32ole_method.rb (test_offset_vtbl): check that OS is Windows 32bit or Windows 64bit in order to get correct offset value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/win32ole/test_win32ole_method.rb23
2 files changed, 28 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1bd3c0fab2..4dfb0703e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jun 26 07:59:18 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_method.rb (test_offset_vtbl): check
+ that OS is Windows 32bit or Windows 64bit in order to get
+ correct offset value.
+
Fri Jun 25 11:45:36 2010 James Edward Gray II <jeg2@ruby-lang.org>
* lib/csv.rb: Fixing a bug that prevented CSV from parsing
diff --git a/test/win32ole/test_win32ole_method.rb b/test/win32ole/test_win32ole_method.rb
index 762ef1d795..2be93ab070 100644
--- a/test/win32ole/test_win32ole_method.rb
+++ b/test/win32ole/test_win32ole_method.rb
@@ -108,8 +108,29 @@ 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
+ end
+
def test_offset_vtbl
- assert_equal(24, @m_invoke.offset_vtbl)
+ exp = is_win64? ? 48 : 24
+ assert_equal(exp, @m_invoke.offset_vtbl)
end
def test_size_params