< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal003/getlocal003.cpp
Print this page
rev 51722 : 8210700: Clean up JNI_ENV_ARG and factorize the macros for vmTestbase/jvmti/unit tests
Summary:
Reviewed-by:
*** 29,53 ****
#include "jvmti.h"
#include "jni_tools.h"
#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
static jvmtiEnv *jvmti = NULL;
--- 29,40 ----
*** 149,160 ****
if (options != NULL && strcmp(options, "printdump") == 0) {
printdump = JNI_TRUE;
}
! res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (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;
}
--- 136,146 ----
if (options != NULL && strcmp(options, "printdump") == 0) {
printdump = JNI_TRUE;
}
! 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;
}
*** 207,218 ****
}
if (!caps.can_access_local_variables ||
!caps.can_generate_method_exit_events) return;
! mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
! "staticMeth", "(I)I");
if (mid == NULL) {
printf("Cannot find Method ID for staticMeth\n");
result = STATUS_FAILED;
return;
}
--- 193,203 ----
}
if (!caps.can_access_local_variables ||
!caps.can_generate_method_exit_events) return;
! mid = env->GetStaticMethodID(cls, "staticMeth", "(I)I");
if (mid == NULL) {
printf("Cannot find Method ID for staticMeth\n");
result = STATUS_FAILED;
return;
}
*** 248,259 ****
if (jvmti == NULL) {
return;
}
! mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
! "staticMeth", "(I)I");
if (mid == NULL) {
printf("Cannot find Method ID for staticMeth\n");
result = STATUS_FAILED;
return;
}
--- 233,243 ----
if (jvmti == NULL) {
return;
}
! mid = env->GetStaticMethodID(cls, "staticMeth", "(I)I");
if (mid == NULL) {
printf("Cannot find Method ID for staticMeth\n");
result = STATUS_FAILED;
return;
}
*** 322,329 ****
JNIEXPORT jint JNICALL
Java_nsk_jvmti_unit_GetLocalVariable_getlocal003_getRes(JNIEnv *env, jclass cls) {
return result;
}
- #ifdef __cplusplus
}
- #endif
--- 306,311 ----
< prev index next >