diff options
Diffstat (limited to 'libjava/testsuite/libjava.jni/noclass.java')
-rw-r--r-- | libjava/testsuite/libjava.jni/noclass.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.jni/noclass.java b/libjava/testsuite/libjava.jni/noclass.java new file mode 100644 index 000000000..7e0b8c34c --- /dev/null +++ b/libjava/testsuite/libjava.jni/noclass.java @@ -0,0 +1,25 @@ +// Test to make sure JNI implementation catches exceptions. + +public class noclass +{ + static + { + System.loadLibrary ("noclass"); + } + + public static native void find_it (); + + public static void main (String[] args) + { + try + { + find_it (); + } + catch (Throwable _) + { + // If find_it() causes a crash, or doesn't throw an exception, + // we won't be running this next line. + System.out.println ("Ok"); + } + } +} |