< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/ma08t001.cpp
Print this page
rev 52100 : 8212082: Remove the NSK_CPP_STUB macros for remaining vmTestbase/jvmti/[sS]*
Summary:
Reviewed-by:
*** 58,69 ****
int i;
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
return NSK_FALSE;
--- 58,68 ----
int i;
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
! if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
return NSK_FALSE;
*** 71,82 ****
for (i = 0; i < threads_count; i++) {
if (!NSK_VERIFY(threads[i] != NULL))
return NSK_FALSE;
/* get thread information */
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
/* find by name */
--- 70,80 ----
for (i = 0; i < threads_count; i++) {
if (!NSK_VERIFY(threads[i] != NULL))
return NSK_FALSE;
/* get thread information */
! if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
/* find by name */
*** 88,99 ****
}
}
}
/* deallocate threads list */
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
return NSK_FALSE;
if (threadForStop == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForStop not found");
return NSK_FALSE;
--- 86,96 ----
}
}
}
/* deallocate threads list */
! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
if (threadForStop == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForStop not found");
return NSK_FALSE;
*** 104,124 ****
return NSK_FALSE;
}
NSK_DISPLAY0("Prepare: create new instance of ThreadDeath exception\n");
! if (!NSK_JNI_VERIFY(jni, (cls =
! NSK_CPP_STUB2(FindClass, jni, THREAD_DEATH_CLASS_NAME)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (ctor =
! NSK_CPP_STUB4(GetMethodID, jni, cls,
! THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL))
return NSK_FALSE;
! if (!NSK_JNI_VERIFY(jni, (threadDeath =
! NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
return NSK_FALSE;
return NSK_TRUE;
}
--- 101,118 ----
return NSK_FALSE;
}
NSK_DISPLAY0("Prepare: create new instance of ThreadDeath exception\n");
! if (!NSK_JNI_VERIFY(jni, (cls = jni->FindClass(THREAD_DEATH_CLASS_NAME)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (ctor =
! jni->GetMethodID(cls, THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL))
return NSK_FALSE;
! if (!NSK_JNI_VERIFY(jni, (threadDeath = jni->NewObject(cls, ctor)) != NULL))
return NSK_FALSE;
return NSK_TRUE;
}
*** 138,158 ****
NSK_DISPLAY0("Testcase #1: call StopThread\n");
if (!NSK_VERIFY(threadForStop != NULL)) {
nsk_jvmti_setFailStatus();
} else {
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(StopThread, jvmti, threadForStop, threadDeath)))
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY0("Testcase #2: call InterruptThread\n");
if (!NSK_VERIFY(threadForInterrupt != NULL)) {
nsk_jvmti_setFailStatus();
} else {
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(InterruptThread, jvmti, threadForInterrupt)))
nsk_jvmti_setFailStatus();
}
/* resume debugee and wait for sync */
if (!nsk_jvmti_resumeSync())
--- 132,150 ----
NSK_DISPLAY0("Testcase #1: call StopThread\n");
if (!NSK_VERIFY(threadForStop != NULL)) {
nsk_jvmti_setFailStatus();
} else {
! if (!NSK_JVMTI_VERIFY(jvmti->StopThread(threadForStop, threadDeath)))
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY0("Testcase #2: call InterruptThread\n");
if (!NSK_VERIFY(threadForInterrupt != NULL)) {
nsk_jvmti_setFailStatus();
} else {
! if (!NSK_JVMTI_VERIFY(jvmti->InterruptThread(threadForInterrupt)))
nsk_jvmti_setFailStatus();
}
/* resume debugee and wait for sync */
if (!nsk_jvmti_resumeSync())
*** 197,207 ****
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
return JNI_ERR;
memset(&caps, 0, sizeof(caps));
caps.can_signal_thread = 1;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
return JNI_ERR;
}
memset(&callbacks, 0, sizeof(callbacks));
if (!NSK_VERIFY(nsk_jvmti_init_MA(&callbacks)))
--- 189,199 ----
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
return JNI_ERR;
memset(&caps, 0, sizeof(caps));
caps.can_signal_thread = 1;
! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
memset(&callbacks, 0, sizeof(callbacks));
if (!NSK_VERIFY(nsk_jvmti_init_MA(&callbacks)))
< prev index next >