diff options
author | Tom Tromey <tromey@cygnus.com> | 2000-02-27 21:42:40 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2000-02-27 21:42:40 +0000 |
commit | a51c1a1a0ab8d2f554f6249f949d6ae8580480f5 (patch) | |
tree | 4fa0d58dabd4f4dd8af3b4cb4573eff97c93a8fd /libjava | |
parent | fed3cef0dbbd17e3d7b8860f42cd8490f0325340 (diff) | |
download | gcc-a51c1a1a0ab8d2f554f6249f949d6ae8580480f5.zip gcc-a51c1a1a0ab8d2f554f6249f949d6ae8580480f5.tar.gz gcc-a51c1a1a0ab8d2f554f6249f949d6ae8580480f5.tar.bz2 |
noclass.c: New file.
* libjava.jni/noclass.c: New file.
* libjava.jni/noclass.out: New file.
* libjava.jni/noclass.java: New file.
From-SVN: r32226
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/noclass.c | 9 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/noclass.java | 18 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/noclass.out | 1 |
4 files changed, 34 insertions, 0 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog index da7e613..b59adb5 100644 --- a/libjava/testsuite/ChangeLog +++ b/libjava/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2000-02-23 Tom Tromey <tromey@cygnus.com> + + * libjava.jni/noclass.c: New file. + * libjava.jni/noclass.out: New file. + * libjava.jni/noclass.java: New file. + 2000-02-18 Tom Tromey <tromey@cygnus.com> * libjava.jni/register.java: New file. diff --git a/libjava/testsuite/libjava.jni/noclass.c b/libjava/testsuite/libjava.jni/noclass.c new file mode 100644 index 0000000..5f2caf4 --- /dev/null +++ b/libjava/testsuite/libjava.jni/noclass.c @@ -0,0 +1,9 @@ +#include <noclass.h> + +void +Java_noclass_find_1it (JNIEnv *env, jclass k) +{ + /* We cause an exception by asking for a class we know does not + exist. */ + k = (*env)->FindClass (env, "java/lang/Sarcophagus"); +} diff --git a/libjava/testsuite/libjava.jni/noclass.java b/libjava/testsuite/libjava.jni/noclass.java new file mode 100644 index 0000000..cfa1178 --- /dev/null +++ b/libjava/testsuite/libjava.jni/noclass.java @@ -0,0 +1,18 @@ +// 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) + { + find_it (); + // If find_it() causes a crash, we won't be running this next line. + System.out.println ("Ok"); + } +} diff --git a/libjava/testsuite/libjava.jni/noclass.out b/libjava/testsuite/libjava.jni/noclass.out new file mode 100644 index 0000000..7326d96 --- /dev/null +++ b/libjava/testsuite/libjava.jni/noclass.out @@ -0,0 +1 @@ +Ok |