findclass.java: New file
* libjava.jni/findclass.java: New file * libjava.jni/findclass.c: New file * libjava.jni/findclass.out: New file From-SVN: r32011
This commit is contained in:
parent
4798472070
commit
04297fe74f
12
libjava/testsuite/libjava.jni/findclass.c
Normal file
12
libjava/testsuite/libjava.jni/findclass.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <findclass.h>
|
||||
|
||||
jclass
|
||||
Java_findclass_doit (JNIEnv *env, jclass klass, jstring name)
|
||||
{
|
||||
const char *buf = (*env)->GetStringUTFChars (env, name, NULL);
|
||||
jclass k = (*env)->FindClass (env, buf);
|
||||
(*env)->ReleaseStringUTFChars (env, name, buf);
|
||||
return k;
|
||||
}
|
16
libjava/testsuite/libjava.jni/findclass.java
Normal file
16
libjava/testsuite/libjava.jni/findclass.java
Normal file
@ -0,0 +1,16 @@
|
||||
// Test FindClass part of JNI.
|
||||
|
||||
public class findclass
|
||||
{
|
||||
static
|
||||
{
|
||||
System.loadLibrary ("findclass");
|
||||
}
|
||||
|
||||
public static native Class doit (String name);
|
||||
|
||||
public static void main (String[] args)
|
||||
{
|
||||
System.out.println ("" + doit ("java/lang/String"));
|
||||
}
|
||||
}
|
1
libjava/testsuite/libjava.jni/findclass.out
Normal file
1
libjava/testsuite/libjava.jni/findclass.out
Normal file
@ -0,0 +1 @@
|
||||
class java.lang.String
|
Loading…
Reference in New Issue
Block a user