Fix DealII type problems.
[official-gcc/Ramakrishna.git] / libjava / testsuite / libjava.jni / register2.c
blob318e4d8f4087825312e0dbbba4bdae172f5f532d
1 #include <stdlib.h>
2 #include <assert.h>
3 #include <jni.h>
5 static int
6 twentythree (JNIEnv *env, jclass k)
8 return 23;
11 static int
12 oneninetyseven (JNIEnv *env, jclass k)
14 return 197;
17 JNIEXPORT jint JNICALL
18 JNI_OnLoad (JavaVM *vm, void *nothing)
20 JNIEnv *env;
21 JNINativeMethod meth;
22 jclass k;
23 jint r;
25 r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_2);
26 assert (r == JNI_OK);
27 k = (*env)->FindClass (env, "register2$I1");
28 assert (k != NULL);
30 meth.name = "doit";
31 meth.signature = "()I";
32 meth.fnPtr = twentythree;
34 r = (*env)->RegisterNatives (env, k, &meth, 1);
35 assert (r == JNI_OK);
37 k = (*env)->FindClass (env, "register2$I2");
38 assert (k != NULL);
40 meth.name = "doit";
41 meth.signature = "()I";
42 meth.fnPtr = oneninetyseven;
44 r = (*env)->RegisterNatives (env, k, &meth, 1);
45 assert (r == JNI_OK);
47 return JNI_VERSION_1_2;