Added javain, javout and newfree throws attributes tests

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4931 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-06-27 13:17:20 +00:00
commit ebffad0ba2
2 changed files with 55 additions and 7 deletions

View file

@ -27,20 +27,34 @@ public class java_throws_runme {
catch (CloneNotSupportedException e) {}
catch (IllegalAccessException e) {}
if (!pass) {
System.err.println("Test 1 failed");
System.exit(1);
}
if (!pass)
throw new RuntimeException("Test 1 failed");
// Check the exception class in the throw typemap
pass = false;
try {
java_throws.throw_spec_function(100);
}
catch (IllegalAccessException e) { pass = true; }
if (!pass) {
System.err.println("Test 2 failed");
System.exit(1);
if (!pass)
throw new RuntimeException("Test 2 failed");
// Check newfree typemap throws attribute
try {
TestClass tc = java_throws.makeTestClass();
}
catch (NoSuchMethodException e) {}
// Check javaout typemap throws attribute
pass = false;
try {
int myInt = java_throws.ioTest();
}
catch (java.io.IOException e) { pass = true; }
if (!pass)
throw new RuntimeException("Test 4 failed");
}
}