gcc/libjava/testsuite/libjava.jni/cxxtest.cc
Tom Tromey 1808372b58 For PR libgcj/5103:
* libjava.jni/cxxtest.out: New file.
	* libjava.jni/cxxtest.cc: New file.
	* libjava.jni/cxxtest.java: New file.
	* libjava.jni/jni.exp (gcj_jni_test_one): If there is no .c file,
	assume there is a .cc file.

From-SVN: r48012
2001-12-14 21:56:29 +00:00

25 lines
399 B
C++

#include <jni.h>
#include <cxxtest.h>
jobjectArray
Java_cxxtest_fetch (JNIEnv *env, jobject _this)
{
jclass cls;
jfieldID fid;
jobjectArray obj;
cls = env->GetObjectClass (_this);
if (! cls)
return 0;
fid = env->GetFieldID (cls, "F", "[Ljava/lang/Object;");
if (! fid)
return 0;
obj = reinterpret_cast<jobjectArray> (env->GetObjectField (_this, fid));
return obj;
}