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

ruby-changes:33814

From: nobu <ko1@a...>
Date: Sat, 10 May 2014 09:33:05 +0900 (JST)
Subject: [ruby-changes:33814] nobu:r45895 (trunk): test_thread.rb: run with default handler

nobu	2014-05-10 09:32:58 +0900 (Sat, 10 May 2014)

  New Revision: 45895

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

  Log:
    test_thread.rb: run with default handler
    
    * test/ruby/test_thread.rb (test_thread_timer_and_interrupt): run
      with default handler.
    
    * test/ruby/test_thread.rb (test_thread_{join,value}_in_trap):
      ditto.

  Modified files:
    trunk/test/ruby/test_thread.rb
Index: test/ruby/test_thread.rb
===================================================================
--- test/ruby/test_thread.rb	(revision 45894)
+++ test/ruby/test_thread.rb	(revision 45895)
@@ -730,7 +730,7 @@ _eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L730
     bug5757 = '[ruby-dev:44985]'
     t0 = Time.now.to_f
     pid = nil
-    cmd = 'r,=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; r.read'
+    cmd = 'Signal.trap(:INT, "DEFAULT"); r,=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; r.read'
     opt = {}
     opt[:new_pgroup] = true if /mswin|mingw/ =~ RUBY_PLATFORM
     s, _err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true, opt) do |in_p, out_p, err_p, cpid|
@@ -750,6 +750,7 @@ _eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L750
 
   def test_thread_join_in_trap
     assert_separately [], <<-'EOS'
+    Signal.trap(:INT, "DEFAULT")
     t0 = Thread.current
     assert_nothing_raised{
       t = Thread.new {Thread.pass until t0.stop?; Process.kill(:INT, $$)}
@@ -765,6 +766,7 @@ _eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L766
 
   def test_thread_value_in_trap
     assert_separately [], <<-'EOS'
+    Signal.trap(:INT, "DEFAULT")
     t0 = Thread.current
     t = Thread.new {Thread.pass until t0.stop?; Process.kill(:INT, $$); :normal_end}
 

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

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