8210198: Clean up JNI_ENV_ARG for vmTestbase/jvmti/Get[A-F] tests

Remove JNI_ENV macros from the Get[A-F] tests

Reviewed-by: sspitsyn, amenkov, cjplummer
This commit is contained in:
Jean Christophe Beyler 2018-09-05 19:40:52 -07:00
parent bac1c9b8fb
commit d256eb923b
56 changed files with 77 additions and 839 deletions

View File

@ -28,21 +28,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,11 +57,9 @@ jthread jthr(JNIEnv *env) {
jclass thrClass;
jmethodID cid;
jthread res;
thrClass = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
"java/lang/Thread"));
cid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, thrClass),
"<init>", "()V");
res = JNI_ENV_PTR(env)->NewObject(JNI_ENV_ARG(env, thrClass), cid);
thrClass = env->FindClass("java/lang/Thread");
cid = env->GetMethodID(thrClass, "<init>", "()V");
res = env->NewObject(thrClass, cid);
return res;
}
@ -143,8 +128,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -313,6 +297,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetAllThreads_allthr001_getRes(JNIEnv *env
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -116,6 +102,4 @@ Java_nsk_jvmti_GetAllThreads_allthr002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -26,21 +26,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -54,10 +41,9 @@ void chk(JNIEnv *env, jclass cl, const char *name, const char *sig, int stat, in
jint ret_size;
if (stat) {
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl),
name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Name = %s, sig = %s: mid = 0\n", name, sig);
@ -89,8 +75,7 @@ JNIEXPORT jint JNI_OnLoad_argsize001(JavaVM *jvm, char *options, void *reserved)
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -114,6 +99,4 @@ Java_nsk_jvmti_GetArgumentsSize_argsize001_check(JNIEnv *env, jclass cls,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -89,7 +75,7 @@ Java_nsk_jvmti_GetArgumentsSize_argsize002_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID for \"<init>\"!\n");
return STATUS_FAILED;
@ -115,8 +101,7 @@ Java_nsk_jvmti_GetArgumentsSize_argsize002_check(JNIEnv *env, jclass cls) {
result = STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"check", "()I");
mid = env->GetStaticMethodID(cls, "check", "()I");
if (mid == NULL) {
printf("Cannot get method ID for \"check\"!\n");
return STATUS_FAILED;
@ -139,6 +124,4 @@ Java_nsk_jvmti_GetArgumentsSize_argsize002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -185,6 +183,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -87,8 +74,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -142,10 +128,10 @@ void checkMeth(JNIEnv *env, jclass cl, int meth_ind) {
}
if (meth_tab[meth_ind].stat == JNI_TRUE) {
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl),
mid = env->GetStaticMethodID(cl,
meth_tab[meth_ind].name, meth_tab[meth_ind].sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl),
mid = env->GetMethodID(cl,
meth_tab[meth_ind].name, meth_tab[meth_ind].sig);
}
if (mid == NULL) {
@ -194,6 +180,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetBytecodes_bytecodes001_check(JNIEnv *en
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -123,8 +109,7 @@ Java_nsk_jvmti_GetBytecodes_bytecodes002_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
"<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID for \"<init>\"!\n");
return STATUS_FAILED;
@ -166,8 +151,7 @@ Java_nsk_jvmti_GetBytecodes_bytecodes002_check(JNIEnv *env, jclass cls) {
result = STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"check", "()I");
mid = env->GetStaticMethodID(cls, "check", "()I");
if (mid == NULL) {
printf("Cannot get method ID for \"check\"!\n");
return STATUS_FAILED;
@ -190,6 +174,4 @@ Java_nsk_jvmti_GetBytecodes_bytecodes002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -366,8 +353,7 @@ void JNICALL ClassPrepare(jvmtiEnv *jvmti_env, JNIEnv *env,
name = NULL;
msig = NULL;
bytecodes = NULL;
err = jvmti_env->GetMethodName(methods[i],
&name, &msig, NULL);
err = jvmti_env->GetMethodName(methods[i], &name, &msig, NULL);
if (err != JVMTI_ERROR_NONE) {
printf("(GetMethodName) unexpected error: %s (%d)\n",
TranslateError(err), err);
@ -446,8 +432,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -535,6 +520,4 @@ Java_nsk_jvmti_GetBytecodes_bytecodes003_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -104,6 +90,4 @@ Java_nsk_jvmti_GetCapabilities_getcaps001_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -325,6 +323,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -126,6 +112,4 @@ Java_nsk_jvmti_GetClassFields_getclfld005_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -112,6 +98,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetClassFields_getclfld006_getRes(JNIEnv *e
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -128,8 +115,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -201,6 +187,4 @@ Java_nsk_jvmti_GetClassFields_getclfld007_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -115,6 +101,4 @@ Java_nsk_jvmti_GetClassLoader_getclsldr001_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -121,6 +107,4 @@ Java_nsk_jvmti_GetClassLoader_getclsldr002_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -109,8 +95,7 @@ Java_nsk_jvmti_GetClassLoader_getclsldr003_check(JNIEnv *env,
printf(">>> %s - 0x%p\n", sig, classloader);
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, classloader),
cl) != JNI_TRUE) {
if (env->IsSameObject(classloader, cl) != JNI_TRUE) {
printf("(%s) unexpected class loader\n", sig);
result = STATUS_FAILED;
}
@ -121,6 +106,4 @@ Java_nsk_jvmti_GetClassLoader_getclsldr003_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -134,6 +120,4 @@ Java_nsk_jvmti_GetClassLoaderClasses_clsldrclss001_check(JNIEnv *env, jclass cls
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -229,6 +227,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -126,6 +112,4 @@ Java_nsk_jvmti_GetClassMethods_getclmthd005_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -112,6 +98,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetClassMethods_getclmthd006_getRes(JNIEnv
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -140,8 +127,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -224,6 +210,4 @@ Java_nsk_jvmti_GetClassMethods_getclmthd007_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -115,6 +101,4 @@ Java_nsk_jvmti_GetClassModifiers_getclmdf004_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -74,8 +61,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -137,6 +123,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetClassModifiers_getclmdf005_getRes(JNIEnv
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -78,8 +65,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -138,6 +124,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetClassModifiers_getclmdf006_getRes(JNIEnv
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -78,8 +65,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -160,6 +146,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetClassModifiers_getclmdf007_getRes(JNIEnv
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -80,8 +67,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -125,6 +111,4 @@ Java_nsk_jvmti_GetClassSignature_getclsig004_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -69,8 +56,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -139,6 +125,4 @@ Java_nsk_jvmti_GetClassSignature_getclsig005_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -31,9 +31,7 @@
#include "JVMTITools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CLS_NUM 5 /* overall number of tested classes */
@ -145,6 +143,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -115,6 +101,4 @@ Java_nsk_jvmti_GetClassStatus_getclstat005_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -77,8 +64,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -120,6 +106,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetClassStatus_getclstat006_getRes(JNIEnv *
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -155,6 +141,4 @@ Java_nsk_jvmti_GetClassStatus_getclstat007_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -123,8 +109,7 @@ JNIEXPORT void JNICALL Java_nsk_jvmti_GetCurrentContendedMonitor_contmon001_chec
printf("(GetCurrentContendedMonitor#%d) unexpected error: %s (%d)\n",
point, TranslateError(err), err);
result = STATUS_FAILED;
} else if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, lock), mon)
== JNI_FALSE) {
} else if (env->IsSameObject(lock, mon) == JNI_FALSE) {
printf("(IsSameObject#%d) unexpected monitor object: 0x%p\n",
point, mon);
result = STATUS_FAILED;
@ -135,6 +120,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetCurrentContendedMonitor_contmon001_getR
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -133,6 +119,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetCurrentContendedMonitor_contmon002_getR
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -155,6 +141,4 @@ Java_nsk_jvmti_GetCurrentContendedMonitor_contmon003_check(JNIEnv *env,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -376,6 +374,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -298,6 +296,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -29,9 +29,7 @@
#include <jvmti_tools.h>
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -152,6 +150,4 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved)
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -186,6 +184,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -316,6 +314,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -26,9 +26,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -103,6 +101,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* min and max values defined in jvmtiParamTypes */
@ -292,6 +290,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* min and max values defined in jvmtiParamTypes */
#define PARAM_TYPE_MIN_VALUE 101
@ -303,6 +301,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x,y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x,y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -69,8 +56,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -94,11 +80,9 @@ Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl001_check(JNIEnv *env,
}
if (i == 0) {
fid = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls1),
fields[i], "I");
fid = env->GetStaticFieldID(cls1, fields[i], "I");
} else {
fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls1),
fields[i], "I");
fid = env->GetFieldID(cls1, fields[i], "I");
}
if (fid == NULL) {
printf("(%d) cannot get field ID for %s:\"I\"\n", i, fields[i]);
@ -126,8 +110,7 @@ Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl001_check(JNIEnv *env,
printf(">>> %d -- %s: \"%s\"\n", i, fields[i], sig);
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, cls2),
declaringClass) != JNI_TRUE) {
if (env->IsSameObject(cls2, declaringClass) != JNI_TRUE) {
printf("(%d) unexpected declaringClass: %s\n", i, sig);
result = STATUS_FAILED;
}
@ -139,6 +122,4 @@ Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl001_getResult(JNIEnv *env,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x,y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x,y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -69,8 +56,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -94,11 +80,9 @@ Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl002_check(JNIEnv *env,
}
if (i == 0) {
fid = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls1),
fields[i], "I");
fid = env->GetStaticFieldID(cls1, fields[i], "I");
} else {
fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls1),
fields[i], "I");
fid = env->GetFieldID(cls1, fields[i], "I");
}
if (fid == NULL) {
printf("(%d) cannot get field ID for %s:\"I\"\n", i, fields[i]);
@ -126,8 +110,7 @@ Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl002_check(JNIEnv *env,
printf(">>> %d -- %s: \"%s\"\n", i, fields[i], sig);
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, cls2),
declaringClass) != JNI_TRUE) {
if (env->IsSameObject(cls2, declaringClass) != JNI_TRUE) {
printf("(%d) unexpected declaringClass: %s\n", i, sig);
result = STATUS_FAILED;
}
@ -137,6 +120,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl002_getRes
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -88,8 +75,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -113,11 +99,9 @@ Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl004_check(JNIEnv *env,
}
if (fields[i].is_static == JNI_TRUE) {
fid = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls1),
fields[i].name, fields[i].sig);
fid = env->GetStaticFieldID(cls1, fields[i].name, fields[i].sig);
} else {
fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls1),
fields[i].name, fields[i].sig);
fid = env->GetFieldID(cls1, fields[i].name, fields[i].sig);
}
if (fid == NULL) {
printf("(%d) cannot get field ID for %s:\"%s\"\n",
@ -146,8 +130,7 @@ Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl004_check(JNIEnv *env,
printf(">>> %d -- %s: \"%s\"\n", i, fields[i].name, sig);
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, cls2),
declaringClass) != JNI_TRUE) {
if (env->IsSameObject(cls2, declaringClass) != JNI_TRUE) {
printf("(%d) unexpected declaringClass: %s\n", i, sig);
result = STATUS_FAILED;
}
@ -157,6 +140,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetFieldDeclaringClass_getfldecl004_getRes(
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -89,7 +75,7 @@ Java_nsk_jvmti_GetFieldModifiers_getfldmdf003_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls), "fld", "I");
fid = env->GetFieldID(cls, "fld", "I");
if (fid == NULL) {
printf("Cannot get field ID!\n");
return STATUS_FAILED;
@ -132,6 +118,4 @@ Java_nsk_jvmti_GetFieldModifiers_getfldmdf003_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -138,8 +125,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -178,11 +164,9 @@ Java_nsk_jvmti_GetFieldModifiers_getfldmdf004_check(JNIEnv *env,
}
if (fields[i].is_static == JNI_TRUE) {
fid = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls),
fields[i].name, fields[i].sig);
fid = env->GetStaticFieldID(cls, fields[i].name, fields[i].sig);
} else {
fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls),
fields[i].name, fields[i].sig);
fid = env->GetFieldID(cls, fields[i].name, fields[i].sig);
}
if (fid == NULL) {
printf("(%d) cannot get field ID for %s:\"%s\"\n",
@ -218,6 +202,4 @@ Java_nsk_jvmti_GetFieldModifiers_getfldmdf004_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -89,7 +75,7 @@ Java_nsk_jvmti_GetFieldName_getfldnm003_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
field = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls), "fld", "I");
field = env->GetFieldID(cls, "fld", "I");
if (field == NULL) {
printf("Cannot get field ID!\n");
return STATUS_FAILED;
@ -180,6 +166,4 @@ Java_nsk_jvmti_GetFieldName_getfldnm003_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -28,21 +28,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -98,8 +85,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -123,11 +109,11 @@ Java_nsk_jvmti_GetFieldName_getfldnm004_check(JNIEnv *env,
for (i = 0; i < sizeof(fields)/sizeof(field_info); i++) {
if (fields[i].is_static == JNI_TRUE) {
fid = JNI_ENV_PTR(env)->GetStaticFieldID(
JNI_ENV_ARG(env, clazz), fields[i].name, fields[i].sig);
fid = env->GetStaticFieldID(
clazz, fields[i].name, fields[i].sig);
} else {
fid = JNI_ENV_PTR(env)->GetFieldID(
JNI_ENV_ARG(env, clazz), fields[i].name, fields[i].sig);
fid = env->GetFieldID(
clazz, fields[i].name, fields[i].sig);
}
if (fid == NULL) {
printf("(%" PRIuPTR ") cannot get field ID for %s:\"%s\"\n",
@ -160,6 +146,4 @@ Java_nsk_jvmti_GetFieldName_getfldnm004_check(JNIEnv *env,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -31,9 +31,7 @@
#include "JVMTITools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
#define FLDS_NUM 12 /* overall number of tested fields */
@ -202,6 +200,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -141,6 +127,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetFrameCount_framecnt001_getRes(JNIEnv *e
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -63,8 +50,7 @@ JNIEXPORT jint JNI_OnLoad_framecnt002(JavaVM *jvm, char *options, void *reserved
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -99,6 +85,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetFrameCount_framecnt002_getRes(JNIEnv *e
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -63,8 +50,7 @@ JNIEXPORT jint JNI_OnLoad_framecnt003(JavaVM *jvm, char *options, void *reserved
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -93,6 +79,4 @@ Java_nsk_jvmti_GetFrameCount_framecnt003_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -62,8 +49,7 @@ jboolean checkFrame(jvmtiEnv *jvmti_env, JNIEnv *env,
char *meth, *sig, *generic;
jboolean isOk = JNI_FALSE;
err = jvmti_env->GetMethodName(exp_mid,
&meth, &sig, &generic);
err = jvmti_env->GetMethodName(exp_mid, &meth, &sig, &generic);
if (err != JVMTI_ERROR_NONE) {
printf("(GetMethodName) unexpected error: %s (%d)\n",
TranslateError(err), err);
@ -115,8 +101,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -177,8 +162,7 @@ Java_nsk_jvmti_GetFrameLocation_frameloc001_getReady(JNIEnv *env, jclass cls,
return;
}
mid1 = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, klass),
"meth01", "(I)V");
mid1 = env->GetMethodID(klass, "meth01", "(I)V");
if (mid1 == NULL) {
printf("Cannot get jmethodID for method \"meth01\"\n");
result = STATUS_FAILED;
@ -205,7 +189,7 @@ Java_nsk_jvmti_GetFrameLocation_frameloc001_checkFrame01(JNIEnv *env,
return JNI_TRUE;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, klass), "run", "()V");
mid = env->GetMethodID(klass, "run", "()V");
if (mid == NULL) {
printf("Cannot get jmethodID for method \"run\"\n");
result = STATUS_FAILED;
@ -241,6 +225,4 @@ Java_nsk_jvmti_GetFrameLocation_frameloc001_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -28,21 +28,8 @@
#include "jni_tools.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -79,8 +66,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -175,6 +161,4 @@ Java_nsk_jvmti_GetFrameLocation_frameloc002_check(JNIEnv *env, jclass cls, jthre
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -181,6 +167,4 @@ Java_nsk_jvmti_GetFrameLocation_frameloc003_check(JNIEnv *env, jclass cls, jthre
return result;
}
#ifdef __cplusplus
}
#endif