This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: new test case


I'm checking this in on the trunk.  It tests that throwing an
exception across a libffi call works.  We thought we might need to fix
this on the branch, but it already works.  But since I wrote the test
I thought I'd check it in for future regressions' sake.

2001-05-30  Tom Tromey  <tromey@redhat.com>

	* libjava.lang/invokethrow.out: New file.
	* libjava.lang/invokethrow.java: New file.

Tom

Index: libjava.lang/invokethrow.java
===================================================================
RCS file: invokethrow.java
diff -N invokethrow.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ invokethrow.java	Wed May 30 08:21:48 2001
@@ -0,0 +1,29 @@
+// Test a `throw' across a libffi call.
+
+import java.lang.reflect.*;
+
+public class invokethrow
+{
+  public static void doit () throws Throwable
+  {
+    throw new Throwable ("hi!");
+  }
+
+  public static void main (String[] args)
+  {
+    Class k = invokethrow.class;
+    try
+      {
+	Class[] noargs = new Class[0];
+	Method m = k.getMethod ("doit", noargs);
+	m.invoke (null, null);
+      }
+    catch (InvocationTargetException x1)
+      {
+	System.out.println (x1.getTargetException ().getMessage ());
+      }
+    catch (Throwable _)
+      {
+      }
+  }
+}
Index: libjava.lang/invokethrow.out
===================================================================
RCS file: invokethrow.out
diff -N invokethrow.out
--- /dev/null	Tue May  5 13:32:27 1998
+++ invokethrow.out	Wed May 30 08:21:48 2001
@@ -0,0 +1 @@
+hi!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]