diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-30 11:50:26 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-30 11:50:26 +0000 |
commit | bb4410a2890fab69271145a09f895c91a8ee8863 (patch) | |
tree | 89952c061b86f32cf704faa72e48f5577de6f84a /test/ruby/test_settracefunc.rb | |
parent | d0a4fecffcf3c74f14ba392f5785ea8f48d19683 (diff) | |
download | ruby-bb4410a2890fab69271145a09f895c91a8ee8863.tar.gz |
* thread.c: TracePoint#self returns invoking/exitting thread object
at thread_begin/end event.
* test/ruby/test_settracefunc.rb: fix test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_settracefunc.rb')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 82d3dc4fae..af7f374669 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -726,15 +726,24 @@ class TestSetTraceFunc < Test::Unit::TestCase def test_tracepoint_thread events = [] + thread_self = nil created_thread = nil TracePoint.new(:thread_begin, :thread_end){|tp| - events << [Thread.current, tp.event, tp.self] + events << [Thread.current, + tp.event, + tp.lineno, #=> 0 + tp.path, #=> nil + tp.binding, #=> nil + tp.defined_class, #=> nil, + tp.self.class # tp.self return creating/ending thread + ] }.enable{ - created_thread = Thread.new{} + created_thread = Thread.new{thread_self = self} created_thread.join } - assert_equal([created_thread, :thread_begin, self], events[0]) - assert_equal([created_thread, :thread_end, self], events[1]) + 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]) assert_equal(2, events.size) end end |