< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/StopThread/stopthrd007/stopthrd007.cpp
Print this page
rev 52185 : [mq]: refactor
@@ -60,12 +60,11 @@
int i;
NSK_DISPLAY0("Prepare: find tested threads\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
return NSK_FALSE;
@@ -73,12 +72,11 @@
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)))
+ 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 */
@@ -91,27 +89,23 @@
sleepingThread = threads[i];
}
}
}
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
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))
+ if (!NSK_JNI_VERIFY(jni, (cls = jni->FindClass(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))
+ jni->GetMethodID(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))
+ if (!NSK_JNI_VERIFY(jni, (threadDeath = jni->NewObject(cls, ctor)) != NULL))
return NSK_FALSE;
return NSK_TRUE;
}
@@ -131,30 +125,27 @@
NSK_DISPLAY0("Testcase #1: call StopThread for runningThread\n");
if (!NSK_VERIFY(runningThread != NULL)) {
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread,
- jvmti, runningThread, threadDeath)))
+ if (!NSK_JVMTI_VERIFY(jvmti->StopThread(runningThread, threadDeath)))
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY0("Testcase #2: call StopThread for waitingThread\n");
if (!NSK_VERIFY(waitingThread != NULL)) {
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread,
- jvmti, waitingThread, threadDeath)))
+ if (!NSK_JVMTI_VERIFY(jvmti->StopThread(waitingThread, threadDeath)))
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY0("Testcase #3: call StopThread for sleepingThread\n");
if (!NSK_VERIFY(sleepingThread != NULL)) {
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread,
- jvmti, sleepingThread, threadDeath)))
+ if (!NSK_JVMTI_VERIFY(jvmti->StopThread(sleepingThread, threadDeath)))
nsk_jvmti_setFailStatus();
}
if (!nsk_jvmti_resumeSync())
return;
@@ -192,11 +183,11 @@
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))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
return JNI_OK;
}
< prev index next >