< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretint/earlyretint.cpp

Print this page
rev 51722 : 8210700: Clean up JNI_ENV_ARG and factorize the macros for vmTestbase/jvmti/unit tests
Summary:
Reviewed-by:

*** 25,49 **** #include <string.h> #include "jvmti.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 #define RETURN_FAILED errCode = STATUS_FAILED; fflush(0); return --- 25,36 ----
*** 330,341 **** printf("Printdump is turned on!\n"); 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 error code from a valid call to GetEnv!\n"); return JNI_ERR; } --- 317,327 ---- printf("Printdump is turned on!\n"); printdump = JNI_TRUE; } ! res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1); if (res != JNI_OK || jvmti == NULL) { printf("Wrong error code from a valid call to GetEnv!\n"); return JNI_ERR; }
*** 399,452 **** !caps.can_generate_method_exit_events || !caps.can_generate_single_step_events) { return; } ! midRun = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), ! "run", "()V"); if (midRun == NULL) { printf("Cannot find Method ID for method run\n"); RETURN_FAILED; } ! midCheckPoint = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), ! "checkPoint", "()V"); if (midCheckPoint == NULL) { printf("Cannot find Method ID for method checkPoint\n"); RETURN_FAILED; } ! midCountDownInt = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), ! "countDownInt", "(I)I"); if (midCheckPoint == NULL) { printf("Cannot find Method ID for method countDownInt\n"); RETURN_FAILED; } ! midCountDownShort = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), ! "countDownShort", "(I)S"); if (midCountDownShort == NULL) { printf("Cannot find Method ID for method countDownShort\n"); RETURN_FAILED; } ! midCountDownChar = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), ! "countDownChar", "(I)C"); if (midCountDownChar == NULL) { printf("Cannot find Method ID for method countDownChar\n"); RETURN_FAILED; } ! midCountDownByte = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), ! "countDownByte", "(I)B"); if (midCountDownByte == NULL) { printf("Cannot find Method ID for method countDownByte\n"); RETURN_FAILED; } ! midCountDownBoolean = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), ! "countDownBoolean", "(I)Z"); if (midCountDownBoolean == NULL) { printf("Cannot find Method ID for method countDownBoolean\n"); RETURN_FAILED; } --- 385,431 ---- !caps.can_generate_method_exit_events || !caps.can_generate_single_step_events) { return; } ! midRun = env->GetMethodID(cls, "run", "()V"); if (midRun == NULL) { printf("Cannot find Method ID for method run\n"); RETURN_FAILED; } ! midCheckPoint = env->GetMethodID(cls, "checkPoint", "()V"); if (midCheckPoint == NULL) { printf("Cannot find Method ID for method checkPoint\n"); RETURN_FAILED; } ! midCountDownInt = env->GetMethodID(cls, "countDownInt", "(I)I"); if (midCheckPoint == NULL) { printf("Cannot find Method ID for method countDownInt\n"); RETURN_FAILED; } ! midCountDownShort = env->GetMethodID(cls, "countDownShort", "(I)S"); if (midCountDownShort == NULL) { printf("Cannot find Method ID for method countDownShort\n"); RETURN_FAILED; } ! midCountDownChar = env->GetMethodID(cls, "countDownChar", "(I)C"); if (midCountDownChar == NULL) { printf("Cannot find Method ID for method countDownChar\n"); RETURN_FAILED; } ! midCountDownByte = env->GetMethodID(cls, "countDownByte", "(I)B"); if (midCountDownByte == NULL) { printf("Cannot find Method ID for method countDownByte\n"); RETURN_FAILED; } ! midCountDownBoolean = env->GetMethodID(cls, "countDownBoolean", "(I)Z"); if (midCountDownBoolean == NULL) { printf("Cannot find Method ID for method countDownBoolean\n"); RETURN_FAILED; }
*** 486,493 **** } fflush(0); return errCode; } - #ifdef __cplusplus } - #endif --- 465,470 ----
< prev index next >