summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-10 12:22:16 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-10 12:22:16 +0000
commit4f1b06aabd54b86f08cac13498c73fcb0237fe05 (patch)
treec5ab00a9410bd3fa9e1df4780e4c8a7b97c8112d
parent86714f5b160a5342f6ed9564fe9db30be120100c (diff)
* test/win32ole/test_win32ole_typelib.rb: add some illegal argument test.
* test/win32ole/test_win32ole_type.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. * test/win32ole/test_win32ole_param.rb: ditto. * test/win32ole/test_win32ole_method.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog13
-rw-r--r--test/win32ole/test_win32ole_event.rb6
-rw-r--r--test/win32ole/test_win32ole_method.rb3
-rw-r--r--test/win32ole/test_win32ole_param.rb7
-rw-r--r--test/win32ole/test_win32ole_type.rb6
-rw-r--r--test/win32ole/test_win32ole_typelib.rb5
6 files changed, 40 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c8d182cb6a0..aed1560f5c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Thu Jul 10 21:15:49 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_typelib.rb: add some illegal argument
+ test.
+
+ * test/win32ole/test_win32ole_type.rb: ditto.
+
+ * test/win32ole/test_win32ole_event.rb: ditto.
+
+ * test/win32ole/test_win32ole_param.rb: ditto.
+
+ * test/win32ole/test_win32ole_method.rb: ditto.
+
Thu Jul 10 19:38:35 2008 wanabe <s.wanabe@gmail.com>
* test/ruby/envutil.rb (assert_normal_exit): r17993 revert.
diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb
index 48885393618..02eaec557ae 100644
--- a/test/win32ole/test_win32ole_event.rb
+++ b/test/win32ole/test_win32ole_event.rb
@@ -30,6 +30,12 @@ if defined?(WIN32OLE_EVENT)
@event += event
end
+ def test_s_new
+ assert_raise(TypeError) {
+ ev = WIN32OLE_EVENT.new("A")
+ }
+ end
+
def test_s_new_without_itf
ev = WIN32OLE_EVENT.new(@ie)
ev.on_event {|*args| default_handler(*args)}
diff --git a/test/win32ole/test_win32ole_method.rb b/test/win32ole/test_win32ole_method.rb
index 31eff879371..161b10233f1 100644
--- a/test/win32ole/test_win32ole_method.rb
+++ b/test/win32ole/test_win32ole_method.rb
@@ -33,6 +33,9 @@ if defined?(WIN32OLE_METHOD)
assert_raise(WIN32OLERuntimeError) {
method = WIN32OLE_METHOD.new(ole_type, "NonExistMethod")
}
+ assert_raise(TypeError) {
+ method = WIN32OLE_METHOD.new(ole_type, 1)
+ }
method = WIN32OLE_METHOD.new(ole_type, "Open")
assert_instance_of(WIN32OLE_METHOD, method)
method = WIN32OLE_METHOD.new(ole_type, "open")
diff --git a/test/win32ole/test_win32ole_param.rb b/test/win32ole/test_win32ole_param.rb
index 4374f9a426a..1c866ca53ef 100644
--- a/test/win32ole/test_win32ole_param.rb
+++ b/test/win32ole/test_win32ole_param.rb
@@ -29,6 +29,13 @@ if defined?(WIN32OLE_PARAM)
@param_overwritefiles = m_copyfile.params[2]
end
+ def test_s_new
+ assert_raise(ArgumentError) {
+ WIN32OLE_PARAM.new("hoge")
+ }
+ end
+
+
def test_name
assert_equal('URL', @param_url.name)
assert_equal('Flags', @param_flags.name)
diff --git a/test/win32ole/test_win32ole_type.rb b/test/win32ole/test_win32ole_type.rb
index 1aff42a45a0..f8ea525ea9c 100644
--- a/test/win32ole/test_win32ole_type.rb
+++ b/test/win32ole/test_win32ole_type.rb
@@ -22,6 +22,12 @@ if defined?(WIN32OLE_TYPE)
assert_raise(ArgumentError) {
WIN32OLE_TYPE.new("foo")
}
+ assert_raise(TypeError) {
+ WIN32OLE_TYPE.new(1, 2)
+ }
+ assert_raise(TypeError) {
+ WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", 1)
+ }
assert_raise(WIN32OLERuntimeError) {
WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "foo")
}
diff --git a/test/win32ole/test_win32ole_typelib.rb b/test/win32ole/test_win32ole_typelib.rb
index 16e6c1a6630..a1c38913966 100644
--- a/test/win32ole/test_win32ole_typelib.rb
+++ b/test/win32ole/test_win32ole_typelib.rb
@@ -18,6 +18,11 @@ if defined?(WIN32OLE_TYPELIB)
assert_raise(ArgumentError) {
WIN32OLE_TYPELIB.new(1,2,3,4)
}
+
+ assert_raise(TypeError) {
+ WIN32OLE_TYPELIB.new(100)
+ }
+
tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
assert_instance_of(WIN32OLE_TYPELIB, tlib)