added check that pure virtual method is handled by throwing an exception if Java derived class does not provide an implementation

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5289 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-11-10 22:33:17 +00:00
commit c1fa548d3d

View file

@ -23,6 +23,15 @@ public class director_abstract_runme {
if (!a.pong().equals("Foo::pong();MyFoo::ping()")) {
throw new RuntimeException ( "a.pong()" );
}
BadFoo b = new BadFoo();
try {
b.ping();
System.out.println( "Test failed. An attempt to call a pure virtual method should throw an exception" );
System.exit(1);
}
catch (RuntimeException e) {
}
}
}
@ -32,3 +41,6 @@ class MyFoo extends Foo {
}
}
class BadFoo extends Foo {
}