[前][次][番号順一覧][スレッド一覧]

ruby-changes:33178

From: usa <ko1@a...>
Date: Mon, 3 Mar 2014 04:22:04 +0900 (JST)
Subject: [ruby-changes:33178] usa:r45257 (trunk): * test/win32ole: get rid of warnings (unused variable).

usa	2014-03-03 04:21:57 +0900 (Mon, 03 Mar 2014)

  New Revision: 45257

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45257

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

  Modified files:
    trunk/ChangeLog
    trunk/test/win32ole/test_err_in_callback.rb
    trunk/test/win32ole/test_win32ole.rb
    trunk/test/win32ole/test_win32ole_event.rb
    trunk/test/win32ole/test_win32ole_method.rb
    trunk/test/win32ole/test_win32ole_variant.rb
    trunk/test/win32ole/test_win32ole_variant_outarg.rb
    trunk/test/win32ole/test_word.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45256)
+++ ChangeLog	(revision 45257)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Mar  3 04:21:34 2014  NAKAMURA Usaku  <usa@r...>
+
+	* test/win32ole: get rid of warnings (unused variable).
+
 Mon Mar  3 02:53:53 2014  NAKAMURA Usaku  <usa@r...>
 
 	* io.c (rb_io_flush_raw): [EXPERIMENTAL] remove force syncing for Win32
Index: test/win32ole/test_win32ole_variant.rb
===================================================================
--- test/win32ole/test_win32ole_variant.rb	(revision 45256)
+++ test/win32ole/test_win32ole_variant.rb	(revision 45257)
@@ -38,7 +38,7 @@ if defined?(WIN32OLE_VARIANT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_variant.rb#L38
     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) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_variant.rb#L49
     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) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_variant.rb#L343
 
     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) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_variant.rb#L485
 
     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
Index: test/win32ole/test_err_in_callback.rb
===================================================================
--- test/win32ole/test_err_in_callback.rb	(revision 45256)
+++ test/win32ole/test_err_in_callback.rb	(revision 45257)
@@ -29,7 +29,7 @@ if defined?(WIN32OLE) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_err_in_callback.rb#L29
 
     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) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_err_in_callback.rb#L42
         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
Index: test/win32ole/test_win32ole.rb
===================================================================
--- test/win32ole/test_win32ole.rb	(revision 45256)
+++ test/win32ole/test_win32ole.rb	(revision 45257)
@@ -228,7 +228,7 @@ if defined?(WIN32OLE) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole.rb#L228
     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) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole.rb#L270
     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)
Index: test/win32ole/test_win32ole_method.rb
===================================================================
--- test/win32ole/test_win32ole_method.rb	(revision 45256)
+++ test/win32ole/test_win32ole_method.rb	(revision 45257)
@@ -28,16 +28,16 @@ if defined?(WIN32OLE_METHOD) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_method.rb#L28
         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)
Index: test/win32ole/test_win32ole_event.rb
===================================================================
--- test/win32ole/test_win32ole_event.rb	(revision 45256)
+++ test/win32ole/test_win32ole_event.rb	(revision 45257)
@@ -52,7 +52,7 @@ if defined?(WIN32OLE_EVENT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L52
 
       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) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L149
 
       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
 
Index: test/win32ole/test_win32ole_variant_outarg.rb
===================================================================
--- test/win32ole/test_win32ole_variant_outarg.rb	(revision 45256)
+++ test/win32ole/test_win32ole_variant_outarg.rb	(revision 45257)
@@ -46,7 +46,7 @@ if defined?(WIN32OLE_VARIANT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_variant_outarg.rb#L46
         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)
Index: test/win32ole/test_word.rb
===================================================================
--- test/win32ole/test_word.rb	(revision 45256)
+++ test/win32ole/test_word.rb	(revision 45257)
@@ -26,7 +26,6 @@ def word_installed? https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_word.rb#L26
 end
 
 if defined?(WIN32OLE)
-  w = nil
   dotest = word_installed?
   if !dotest
     STDERR.puts("\n#{__FILE__} skipped(Microsoft Word not found.)")

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]