Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update tracing test to match released MRI behavior. Make 'return' eve…

…nts match MRI

git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@7204 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
commit 10b0ce3b75a75c33285e603d04a11792bbbfb5ee 1 parent c68e71e
@enebo enebo authored
Showing with 5 additions and 5 deletions.
  1. +1 −1  src/org/jruby/Ruby.java
  2. +4 −4 test/tracing/test_trace_func.rb
View
2  src/org/jruby/Ruby.java
@@ -2125,7 +2125,7 @@ public void event(ThreadContext context, int event, String file, int line, Strin
traceFunc.call(context, new IRubyObject[] {
newString(EVENT_NAMES[event]), // event name
newString(file), // filename
- newFixnum(line + 1), // line numbers should be 1-based
+ newFixnum(line + (event == RUBY_EVENT_RETURN ? 2 : 1)), // line numbers should be 1-based
name != null ? newSymbol(name) : getNil(),
binding,
type
View
8 test/tracing/test_trace_func.rb
@@ -72,7 +72,7 @@ def test_method_trace
" line #{__FILE__}:#{line - 10} sample_method TestTraceFunc",
" c-call #{__FILE__}:#{line - 10} + Fixnum",
" c-return #{__FILE__}:#{line - 10} + Fixnum",
- " return #{__FILE__}:#{line - 10} sample_method TestTraceFunc",
+ " return #{__FILE__}:#{line - 9} sample_method TestTraceFunc",
" line #{__FILE__}:#{line + 2} test_method_trace TestTraceFunc",
" c-call #{__FILE__}:#{line + 2} set_trace_func Kernel"];
assert_equal(expected, output)
@@ -145,11 +145,11 @@ def test_require_trace_full_paths # JRUBY-2722
set_trace_func nil
line = __LINE__ - 4
- expected = ["./test/tracing/test_trace_func.rb line #{line} test_require_trace_full_paths TestTraceFunc",
+ expected = ["test/tracing/test_trace_func.rb line #{line} test_require_trace_full_paths TestTraceFunc",
"./test/tracing/dummy1.rb line 1 nil false",
"./test/tracing/dummy1.rb class 1 nil false",
"./test/tracing/dummy1.rb end 1 nil false",
- "./test/tracing/test_trace_func.rb line #{line + 2} test_require_trace_full_paths TestTraceFunc"]
+ "test/tracing/test_trace_func.rb line #{line + 2} test_require_trace_full_paths TestTraceFunc"]
assert_equal(expected, output);
end
@@ -199,7 +199,7 @@ def test_return # JRUBY-2723
"other.rb line 2 in_other Object",
"other.rb c-call 2 sleep Kernel",
"other.rb c-return 2 sleep Kernel",
- "other.rb return 2 in_other Object",
+ "other.rb return 3 in_other Object",
"test_trace_func.rb line #{line + 3} test_return TestTraceFunc",
"test_trace_func.rb c-call #{line + 3} set_trace_func Kernel"]
Please sign in to comment.
Something went wrong with that request. Please try again.