diff options
| author | Tom Tromey <tromey@redhat.com> | 2006-10-18 23:17:04 +0000 |
|---|---|---|
| committer | Tom Tromey <tromey@gcc.gnu.org> | 2006-10-18 23:17:04 +0000 |
| commit | e7f7d2338771bcf4e77614ffd84fba85444811e6 (patch) | |
| tree | 090a052b333feb86cf809ba60ebdc7a86794ff1e /libjava/testsuite/libjava.jni/register2.java | |
| parent | 9e7fc6b946e8a9f616ce12a458017bad8357247e (diff) | |
| download | gcc-e7f7d2338771bcf4e77614ffd84fba85444811e6.zip gcc-e7f7d2338771bcf4e77614ffd84fba85444811e6.tar.gz gcc-e7f7d2338771bcf4e77614ffd84fba85444811e6.tar.bz2 | |
register2.java: New file.
* testsuite/libjava.jni/register2.java: New file.
* testsuite/libjava.jni/register2.out: New file.
* testsuite/libjava.jni/register2.c: New file.
* java/lang/natClass.cc (_Jv_GetClassNameUtf8): New function.
* java/lang/Class.h (_Jv_GetClassNameUtf8): Declare.
* jni.cc (struct NativeMethodCacheEntry): New struct.
(nathash): Changed type.
(hash): Updated.
(nathash_find_slot): Likewise.
(nathash_find): Likewise.
(natrehash): Likewise.
(nathash_add): Likewise.
(_Jv_JNI_RegisterNatives): Likewise.
(_Jv_LookupJNIMethod): Likewise.
Idea from Juerg Lehni <juerg@scratchdisk.com>
Co-Authored-By: Bryce McKinlay <mckinlay@redhat.com>
From-SVN: r117867
Diffstat (limited to 'libjava/testsuite/libjava.jni/register2.java')
| -rw-r--r-- | libjava/testsuite/libjava.jni/register2.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.jni/register2.java b/libjava/testsuite/libjava.jni/register2.java new file mode 100644 index 0000000..2d6c56a --- /dev/null +++ b/libjava/testsuite/libjava.jni/register2.java @@ -0,0 +1,27 @@ +// Another test of RegisterNatives. +// We neglected to track the class name in our internal hash table. +// This is a regression test for the fix. + +public class register2 +{ + static + { + System.loadLibrary ("register2"); + } + + static class I1 + { + public static native int doit (); + } + + static class I2 + { + public static native int doit (); + } + + public static void main (String[] args) + { + System.out.println (new I1().doit()); + System.out.println (new I2().doit()); + } +} |
