2005-12-29 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / libjava / testsuite / libjava.jni / PR18116.c
blobbcd14331e61aafc3785265052c7f48bd0b0bd501
1 #include <stdlib.h>
2 #include <assert.h>
3 #include <PR18116.h>
5 // The purpose of this test is to ensure that signatures with non-top
6 // level class arguments work.
8 static jint
9 some_random_name (JNIEnv *env, jclass k, jobject v)
11 return 555;
14 JNIEXPORT jint JNICALL
15 JNI_OnLoad (JavaVM *vm, void *nothing)
17 JNIEnv *env;
18 JNINativeMethod meth;
19 jclass k;
20 jint r;
22 r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_2);
23 assert (r == JNI_OK);
24 k = (*env)->FindClass (env, "PR18116");
25 assert (k != NULL);
27 meth.name = "doit";
28 meth.signature = "(Ljava/lang/String;)I";
29 meth.fnPtr = some_random_name;
31 r = (*env)->RegisterNatives (env, k, &meth, 1);
32 assert (r == JNI_OK);
34 return JNI_VERSION_1_2;