Updated to match change in exceptions thrown for previously deleted objects.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8344 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Charlie Savage 2006-01-10 03:38:51 +00:00
commit f92005f00d

View file

@ -4,8 +4,8 @@ begin
begin
# Create an animal and zoo
tiger1 = Example::Animal.new("tiger1")
zoo = Example::Zoo.new
zoo = Example::Zoo.new
# At the animal to the zoo - this will transfer ownership
# of the underlying C++ object to the C++ zoo object
zoo.add_animal(tiger1)
@ -36,10 +36,11 @@ GC.start
# This method is no longer valid since the zoo freed the underlying
# C++ object
ok = false
begin
puts tiger2.get_name
rescue RuntimeError => error
if not error.message == "This Animal * already released"
raise
end
puts tiger2.get_name
rescue ObjectPreviouslyDeleted => error
ok = true
end
raise(RuntimeError, "Incorrect exception raised - should be ObjectPreviouslyDeleted") unless ok