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

ruby-changes:4808

From: ko1@a...
Date: Tue, 6 May 2008 02:18:28 +0900 (JST)
Subject: [ruby-changes:4808] akr - Ruby:r16302 (trunk): * test/io/nonblock/test_flush.rb: don't set Thread.abort_on_exception.

akr	2008-05-06 02:18:09 +0900 (Tue, 06 May 2008)

  New Revision: 16302

  Modified files:
    trunk/ChangeLog
    trunk/test/io/nonblock/test_flush.rb
    trunk/test/net/imap/test_imap.rb

  Log:
    * test/io/nonblock/test_flush.rb: don't set Thread.abort_on_exception.
    
    * test/net/imap/test_imap.rb: ensure disconnecting imap to terminate
      receiver thread..


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/io/nonblock/test_flush.rb?r1=16302&r2=16301&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16302&r2=16301&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/net/imap/test_imap.rb?r1=16302&r2=16301&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16301)
+++ ChangeLog	(revision 16302)
@@ -1,3 +1,10 @@
+Tue May  6 02:08:18 2008  Tanaka Akira  <akr@f...>
+
+	* test/io/nonblock/test_flush.rb: don't set Thread.abort_on_exception.
+
+	* test/net/imap/test_imap.rb: ensure disconnecting imap to terminate
+	  receiver thread..
+
 Tue May  6 00:29:21 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* iseq.c (insn_operand_intern): should handle Qundef embedded in
Index: test/net/imap/test_imap.rb
===================================================================
--- test/net/imap/test_imap.rb	(revision 16301)
+++ test/net/imap/test_imap.rb	(revision 16302)
@@ -67,6 +67,7 @@
   end
 
   def test_starttls
+    imap = nil
     if defined?(OpenSSL)
       starttls_test do |port|
         imap = Net::IMAP.new("localhost", :port => port)
@@ -74,6 +75,10 @@
         imap
       end
     end
+  ensure
+    if imap && !imap.disconnected?
+      imap.disconnect
+    end
   end
 
   private
@@ -105,9 +110,12 @@
       end
     end
     begin
-      imap = yield(port)
-      imap.logout
-      imap.disconnect
+      begin
+        imap = yield(port)
+        imap.logout
+      ensure
+        imap.disconnect if imap
+      end
     ensure
       ssl_server.close
     end
@@ -143,9 +151,12 @@
       end
     end
     begin
-      imap = yield(port)
-      imap.logout
-      imap.disconnect
+      begin
+        imap = yield(port)
+        imap.logout
+      ensure
+        imap.disconnect if imap
+      end
     ensure
       server.close
     end
Index: test/io/nonblock/test_flush.rb
===================================================================
--- test/io/nonblock/test_flush.rb	(revision 16301)
+++ test/io/nonblock/test_flush.rb	(revision 16302)
@@ -5,7 +5,6 @@
 rescue LoadError
 end
 
-Thread.abort_on_exception = true
 class TestIONonblock < Test::Unit::TestCase
   def test_flush
     r,w = IO.pipe

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

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