Fixed #26 (Exceptions are reported every time they propagate up in the call chain in the ruby debugger)

This commit is contained in:
Matthias Koefferlein
2017-12-02 23:02:45 +01:00
parent 1bb662b9ed
commit fdb012aa2d
5 changed files with 114 additions and 60 deletions
+32
View File
@@ -31,6 +31,12 @@ private
end
class MyException < RuntimeError
def initialize(s)
super(s)
end
end
class XEdge < RBA::Edge
def initialize
super(RBA::Point.new(1,2), RBA::Point.new(3,4))
@@ -2601,4 +2607,30 @@ class Basic_TestClass < TestBase
end
def test_73
begin
poly = RBA::Polygon::new(RBA::Box::new(0, 0, 100, 100))
# passing exceptions over iterators is critical because it involves
# a Ruby/C++ and C++/Ruby transition
poly.each_edge do |e|
raise MyException::new("some exception")
end
rescue => ex
assert_equal(ex.class.to_s, "MyException")
assert_equal(ex.to_s, "some exception")
end
begin
raise MyException::new("another exception")
rescue => ex
assert_equal(ex.class.to_s, "MyException")
assert_equal(ex.to_s, "another exception")
end
end
end