summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-22 18:22:57 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-22 18:22:57 +0000
commitd56cbe5ad7298ccdb1d62127e748f83c08ff0f87 (patch)
tree58fe033b472fcfdc5c6fd069c1df90e79a943445 /test
parent909d14a1dbd94e6133b3df5fc80e114fec655fa9 (diff)
* test/ruby/test_settracefunc.rb (test_tracepoint_thread): bugfix.
Take care about the thread switch between Thread.new and let to create_thread. TracePoint's block is sometimes run with create_thread == nil, so we have to perform Thread check later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_settracefunc.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index 8f3cc64e14..e85f36f6f0 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -786,7 +786,6 @@ class TestSetTraceFunc < Test::Unit::TestCase
thread_self = nil
created_thread = nil
TracePoint.new(:thread_begin, :thread_end){|tp|
- next if Thread.current != created_thread
events << [Thread.current,
tp.event,
tp.lineno, #=> 0
@@ -799,6 +798,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
created_thread = Thread.new{thread_self = self}
created_thread.join
}
+ events.reject!{|i| i[0] != created_thread}
assert_equal(self, thread_self)
assert_equal([created_thread, :thread_begin, 0, nil, nil, nil, Thread], events[0])
assert_equal([created_thread, :thread_end, 0, nil, nil, nil, Thread], events[1])