1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/win32ole: get rid of warnings (unused variable).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2014-03-02 19:21:57 +00:00
parent e1c40b1967
commit 9e5f063138
8 changed files with 20 additions and 17 deletions

View file

@ -1,3 +1,7 @@
Mon Mar 3 04:21:34 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* test/win32ole: get rid of warnings (unused variable).
Mon Mar 3 02:53:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (rb_io_flush_raw): [EXPERIMENTAL] remove force syncing for Win32

View file

@ -29,7 +29,7 @@ if defined?(WIN32OLE)
def available_adodb?
begin
db = WIN32OLE.new('ADODB.Connection')
WIN32OLE.new('ADODB.Connection')
rescue WIN32OLERuntimeError
return false
end
@ -42,7 +42,7 @@ if defined?(WIN32OLE)
Dir.mktmpdir do |tmpdir|
logfile = File.join(tmpdir, "test_err_in_callback.log")
cmd = "#{@ruby} -v #{@iopt} #{@script} > #{logfile.gsub(%r(/), '\\')} 2>&1"
result = system(cmd)
system(cmd)
str = ""
open(logfile) {|ifs|
str = ifs.read

View file

@ -228,7 +228,7 @@ if defined?(WIN32OLE)
def test_invoke_hash_key_non_str_sym
fso = WIN32OLE.new('Scripting.FileSystemObject')
begin
bfolder = fso.getFolder({1 => "."})
fso.getFolder({1 => "."})
assert(false)
rescue TypeError
assert(true)
@ -270,7 +270,7 @@ if defined?(WIN32OLE)
def test_ole_query_interface
shell=WIN32OLE.new('Shell.Application')
assert_raise(ArgumentError) {
shell2 = shell.ole_query_interface
shell.ole_query_interface
}
shell2 = shell.ole_query_interface('{A4C6892C-3BA9-11D2-9DEA-00C04FB16162}')
assert_instance_of(WIN32OLE, shell2)

View file

@ -52,7 +52,7 @@ if defined?(WIN32OLE_EVENT)
def test_s_new
assert_raise(TypeError) {
ev = WIN32OLE_EVENT.new("A")
WIN32OLE_EVENT.new("A")
}
end
@ -149,11 +149,11 @@ if defined?(WIN32OLE_EVENT)
def test_non_exist_event
assert_raise(RuntimeError) {
ev = WIN32OLE_EVENT.new(@db, 'XXXX')
WIN32OLE_EVENT.new(@db, 'XXXX')
}
dict = WIN32OLE.new('Scripting.Dictionary')
assert_raise(RuntimeError) {
ev = WIN32OLE_EVENT.new(dict)
WIN32OLE_EVENT.new(dict)
}
end

View file

@ -28,16 +28,16 @@ if defined?(WIN32OLE_METHOD)
WIN32OLE_METHOD.new(1, 2)
}
assert_raise(ArgumentError) {
method = WIN32OLE_METHOD.new("foo")
WIN32OLE_METHOD.new("foo")
}
assert_raise(ArgumentError) {
method = WIN32OLE_METHOD.new(ole_type)
WIN32OLE_METHOD.new(ole_type)
}
assert_raise(WIN32OLERuntimeError) {
method = WIN32OLE_METHOD.new(ole_type, "NonExistMethod")
WIN32OLE_METHOD.new(ole_type, "NonExistMethod")
}
assert_raise(TypeError) {
method = WIN32OLE_METHOD.new(ole_type, 1)
WIN32OLE_METHOD.new(ole_type, 1)
}
method = WIN32OLE_METHOD.new(ole_type, "Open")
assert_instance_of(WIN32OLE_METHOD, method)

View file

@ -38,7 +38,7 @@ if defined?(WIN32OLE_VARIANT)
def test_s_new_no_argument
ex = nil
begin
obj = WIN32OLE_VARIANT.new
WIN32OLE_VARIANT.new
rescue ArgumentError
ex = $!
end
@ -49,7 +49,7 @@ if defined?(WIN32OLE_VARIANT)
def test_s_new_one_argument
ex = nil
begin
obj = WIN32OLE_VARIANT.new('foo')
WIN32OLE_VARIANT.new('foo')
rescue
ex = $!
end
@ -343,7 +343,7 @@ if defined?(WIN32OLE_VARIANT)
def test_s_array_exc
assert_raise(TypeError) {
obj = WIN32OLE_VARIANT.array(2, WIN32OLE::VARIANT::VT_I4)
WIN32OLE_VARIANT.array(2, WIN32OLE::VARIANT::VT_I4)
}
end
@ -485,7 +485,7 @@ if defined?(WIN32OLE_VARIANT)
def test_create_vt_array_exc
exc = assert_raise(TypeError) {
obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_ARRAY);
WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_ARRAY);
}
assert_match(/wrong argument type Fixnum \(expected Array\)/, exc.message)
end

View file

@ -46,7 +46,7 @@ if defined?(WIN32OLE_VARIANT)
sql = "INSERT INTO data.csv VALUES (5, 'E')"
@db.execute(sql, -1)
c = WIN32OLE::ARGV[1]
assert_equal(1, WIN32OLE::ARGV[1])
assert_equal(1, c)
obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_VARIANT|WIN32OLE::VARIANT::VT_BYREF)
assert_equal(nil, obj.value)
@db.execute(sql , obj)

View file

@ -26,7 +26,6 @@ def word_installed?
end
if defined?(WIN32OLE)
w = nil
dotest = word_installed?
if !dotest
STDERR.puts("\n#{__FILE__} skipped(Microsoft Word not found.)")