of const correctness in the std swig STL library. Need to bring it up in the swig-devel list. Added new functions to swig_assert. Changed some tests to reflect these changes. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9730 626c5289-ae23-0410-ae9c-e8d60b6d4f22
61 lines
1.2 KiB
Ruby
61 lines
1.2 KiB
Ruby
#!/usr/bin/env ruby
|
|
#
|
|
# Put description here
|
|
#
|
|
# Author:: gga
|
|
# Copyright:: 2007
|
|
# License:: SWIG
|
|
#
|
|
|
|
require 'swig_assert'
|
|
|
|
require 'abstract_inherit'
|
|
|
|
include Abstract_inherit
|
|
|
|
#
|
|
# Shouldn't be able to instantiate any of these classes
|
|
# since none of them implements the pure virtual function
|
|
# declared in the base class (Foo).
|
|
#
|
|
|
|
exceptionRaised = false
|
|
begin
|
|
Foo.new
|
|
rescue NameError
|
|
exceptionRaised = true
|
|
rescue TypeError
|
|
# In Ruby 1.8 the exception raised is:
|
|
# TypeError: allocator undefined for Abstract_inherit::Foo
|
|
exceptionRaised = true
|
|
ensure
|
|
swig_assert( "exceptionRaised", binding )
|
|
end
|
|
|
|
exceptionRaised = false
|
|
begin
|
|
Bar.new
|
|
rescue NameError
|
|
exceptionRaised = true
|
|
rescue TypeError
|
|
# In Ruby 1.8 the exception raised is:
|
|
# TypeError: allocator undefined for Abstract_inherit::Bar
|
|
exceptionRaised = true
|
|
ensure
|
|
swig_assert( "exceptionRaised", binding )
|
|
end
|
|
|
|
exceptionRaised = false
|
|
begin
|
|
Spam.new
|
|
rescue NameError
|
|
exceptionRaised = true
|
|
rescue TypeError
|
|
# In Ruby 1.8 the exception raised is:
|
|
# TypeError: allocator undefined for Abstract_inherit::Spam
|
|
exceptionRaised = true
|
|
ensure
|
|
swig_assert( "exceptionRaised", binding )
|
|
end
|
|
|
|
|