This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: New test case
- From: Tom Tromey <tromey at redhat dot com>
- To: GCC libjava patches <java-patches at gcc dot gnu dot org>
- Date: 13 Nov 2003 18:34:11 -0700
- Subject: Patch: FYI: New test case
- Reply-to: tromey at redhat dot com
I'm checking this in. This is a test from Tom Fitzsimmons for a
libgcj crash. Fix to follow.
Tom
Index: ChangeLog
from Tom Fitzsimmons <fitzsim@redhat.com>
* libjava.jni/jniutf.c: New file.
* libjava.jni/jniutf.java: New file.
* libjava.jni/jniutf.out: New file.
Index: libjava.jni/jniutf.c
===================================================================
RCS file: libjava.jni/jniutf.c
diff -N libjava.jni/jniutf.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libjava.jni/jniutf.c 14 Nov 2003 01:42:34 -0000
@@ -0,0 +1,10 @@
+#include <jniutf.h>
+
+JNIEXPORT void JNICALL
+Java_jniutf_printString (JNIEnv *env, jobject obj, jstring str)
+{
+ const char *cstr;
+
+ cstr = (*env)->GetStringUTFChars (env, str, NULL);
+ (*env)->ReleaseStringUTFChars (env, str, cstr);
+}
Index: libjava.jni/jniutf.java
===================================================================
RCS file: libjava.jni/jniutf.java
diff -N libjava.jni/jniutf.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libjava.jni/jniutf.java 14 Nov 2003 01:42:34 -0000
@@ -0,0 +1,16 @@
+public class jniutf
+{
+ native void printString (String str);
+
+ static
+ {
+ System.loadLibrary ("jniutf");
+ }
+
+ public static void main (String[] args)
+ {
+
+ String s1 = new String("\u3040\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B");
+ new jniutf().printString (s1);
+ }
+}
Index: libjava.jni/jniutf.out
===================================================================
RCS file: libjava.jni/jniutf.out
diff -N libjava.jni/jniutf.out