aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-02-27 21:42:40 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-02-27 21:42:40 +0000
commita51c1a1a0ab8d2f554f6249f949d6ae8580480f5 (patch)
tree4fa0d58dabd4f4dd8af3b4cb4573eff97c93a8fd /libjava
parentfed3cef0dbbd17e3d7b8860f42cd8490f0325340 (diff)
downloadgcc-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/ChangeLog6
-rw-r--r--libjava/testsuite/libjava.jni/noclass.c9
-rw-r--r--libjava/testsuite/libjava.jni/noclass.java18
-rw-r--r--libjava/testsuite/libjava.jni/noclass.out1
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