зеркало из https://github.com/github/ruby.git
* 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:
Родитель
e1c40b1967
Коммит
9e5f063138
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.)")
|
||||
|
|
Загрузка…
Ссылка в новой задаче