< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF01/gf01t001/gf01t001.cpp
Print this page
rev 52050 : [mq]: refactor
*** 75,86 ****
int i;
int foundProps = 0;
NSK_DISPLAY1("%s: Getting system property keys ...\n",
stepMsg);
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetSystemProperties,
! jvmti_env, &count, &propKeys))) {
result = STATUS_FAILED;
return;
}
NSK_DISPLAY1("%d keys obtained\n",
count);
--- 75,85 ----
int i;
int foundProps = 0;
NSK_DISPLAY1("%s: Getting system property keys ...\n",
stepMsg);
! if (!NSK_JVMTI_VERIFY(jvmti_env->GetSystemProperties(&count, &propKeys))) {
result = STATUS_FAILED;
return;
}
NSK_DISPLAY1("%d keys obtained\n",
count);
*** 92,129 ****
}
for (i=0; i< count; i++) {
NSK_DISPLAY2("%d) getting property for the key \"%s\":\n",
i+1, propKeys[i]);
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetSystemProperty,
! jvmti_env, (const char*) propKeys[i], &prop))) {
result = STATUS_FAILED;
return;
}
NSK_DISPLAY1("\tproperty=\"%s\"\n",
prop);
foundProps += findProp(propKeys[i]);
NSK_DISPLAY0("\tdeallocating system property\n");
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*) prop))) {
result = STATUS_FAILED;
return;
}
NSK_DISPLAY0("\tdeallocating the system property key\n\n");
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*) propKeys[i]))) {
result = STATUS_FAILED;
return;
}
}
/* NSK_DISPLAY0("Deallocating the property key array ...\n");
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*) &propKeys))) {
result = STATUS_FAILED;
return;
}*/
if (foundProps != PROP_NUM) {
--- 91,124 ----
}
for (i=0; i< count; i++) {
NSK_DISPLAY2("%d) getting property for the key \"%s\":\n",
i+1, propKeys[i]);
! if (!NSK_JVMTI_VERIFY(jvmti_env->GetSystemProperty((const char*) propKeys[i], &prop))) {
result = STATUS_FAILED;
return;
}
NSK_DISPLAY1("\tproperty=\"%s\"\n",
prop);
foundProps += findProp(propKeys[i]);
NSK_DISPLAY0("\tdeallocating system property\n");
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) prop))) {
result = STATUS_FAILED;
return;
}
NSK_DISPLAY0("\tdeallocating the system property key\n\n");
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) propKeys[i]))) {
result = STATUS_FAILED;
return;
}
}
/* NSK_DISPLAY0("Deallocating the property key array ...\n");
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) &propKeys))) {
result = STATUS_FAILED;
return;
}*/
if (foundProps != PROP_NUM) {
*** 183,203 ****
NSK_DISPLAY0("setting event callbacks ...\n");
(void) memset(&callbacks, 0, sizeof(callbacks));
callbacks.VMInit = &VMInit;
callbacks.VMDeath = &VMDeath;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks,
! jvmti, &callbacks, sizeof(callbacks))))
return JNI_ERR;
NSK_DISPLAY0("setting event callbacks done\nenabling events ...\n");
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
! jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
return JNI_ERR;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
! jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL)))
return JNI_ERR;
NSK_DISPLAY0("enabling events done\n\n");
checkProps(jvmti, ">>> a) TEST CASE \"OnLoad\"");
--- 178,195 ----
NSK_DISPLAY0("setting event callbacks ...\n");
(void) memset(&callbacks, 0, sizeof(callbacks));
callbacks.VMInit = &VMInit;
callbacks.VMDeath = &VMDeath;
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
return JNI_ERR;
NSK_DISPLAY0("setting event callbacks done\nenabling events ...\n");
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
return JNI_ERR;
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL)))
return JNI_ERR;
NSK_DISPLAY0("enabling events done\n\n");
checkProps(jvmti, ">>> a) TEST CASE \"OnLoad\"");
< prev index next >