Skip to content

Commit

Permalink
* test/ruby/test_settracefunc.rb (test_tracepoint_thread): bugfix.
Browse files Browse the repository at this point in the history
	  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
  • Loading branch information
tarui committed Nov 22, 2013
1 parent 909d14a commit d56cbe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/ruby/test_settracefunc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ def test_tracepoint_thread
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
Expand All @@ -799,6 +798,7 @@ def test_tracepoint_thread
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])
Expand Down

0 comments on commit d56cbe5

Please sign in to comment.