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

ruby-changes:50973

From: mame <ko1@a...>
Date: Tue, 17 Apr 2018 17:48:05 +0900 (JST)
Subject: [ruby-changes:50973] mame:r63180 (trunk): The test for TracePoint with thread had never worked correctly

mame	2018-04-17 17:47:58 +0900 (Tue, 17 Apr 2018)

  New Revision: 63180

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63180

  Log:
    The test for TracePoint with thread had never worked correctly

  Modified files:
    trunk/test/ruby/test_settracefunc.rb
Index: test/ruby/test_settracefunc.rb
===================================================================
--- test/ruby/test_settracefunc.rb	(revision 63179)
+++ test/ruby/test_settracefunc.rb	(revision 63180)
@@ -812,14 +812,16 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L812
 
   def test_tracepoint_inspect
     events = []
+    th = nil
     trace = TracePoint.new{|tp|
-      next if !target_thread?
+      next if !target_thread? && th != Thread.current
       events << [tp.event, tp.inspect]
     }
     assert_equal("#<TracePoint:disabled>", trace.inspect)
     trace.enable{
       assert_equal("#<TracePoint:enabled>", trace.inspect)
-      Thread.new{}.join
+      th = Thread.new{}
+      th.join
     }
     assert_equal("#<TracePoint:disabled>", trace.inspect)
     events.each{|(ev, str)|

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

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