summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-11 09:53:10 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-11 09:53:10 +0000
commit70db47aadb2b353a46d7040e048534ad405bfb5b (patch)
tree5fe0af3ff8fb66253e896a5e1b8d0693d4032093 /test/win32ole
parent8833abd5564896d0d49f1715c069f6753747ae4a (diff)
* ext/win32ole/win32ole.c (ole_val2olevariantdata):
WIN32OLE_VARIANT#new accepts nil when variant type is VT_ARRAY. * test/win32ole/test_win32ole_variant.rb: ditto. * ext/win32ole/win32ole.c: small refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_win32ole_variant.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
index b84f585..8bb81cc 100644
--- a/test/win32ole/test_win32ole_variant.rb
+++ b/test/win32ole/test_win32ole_variant.rb
@@ -146,6 +146,18 @@ if defined?(WIN32OLE_VARIANT)
assert_equal([[],[]], obj.value)
end
+ def test_create_vt_array_nil
+ vartype = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_DISPATCH|WIN32OLE::VARIANT::VT_BYREF
+ obj = WIN32OLE_VARIANT.new(nil, vartype)
+ assert_nil(obj.value)
+ assert_equal(vartype, obj.vartype)
+
+ vartype = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_DISPATCH
+ obj = WIN32OLE_VARIANT.new(nil, vartype)
+ assert_nil(obj.value)
+ assert_equal(vartype, obj.vartype)
+ end
+
def test_create_vt_array_exc
exc = assert_raise(TypeError) {
obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_ARRAY);