97 thread = threads[i]; |
95 thread = threads[i]; |
98 } |
96 } |
99 } |
97 } |
100 |
98 |
101 /* deallocate threads list */ |
99 /* deallocate threads list */ |
102 if (!NSK_JVMTI_VERIFY( |
100 if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) |
103 NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) |
|
104 return NSK_FALSE; |
101 return NSK_FALSE; |
105 |
102 |
106 /* get tested thread class */ |
103 /* get tested thread class */ |
107 if (!NSK_JNI_VERIFY(jni, (klass = |
104 if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL)) |
108 NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL)) |
|
109 return NSK_FALSE; |
105 return NSK_FALSE; |
110 |
106 |
111 /* get tested thread method 'run' */ |
107 /* get tested thread method 'run' */ |
112 if (!NSK_JNI_VERIFY(jni, (method = |
108 if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL)) |
113 NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL)) |
|
114 return NSK_FALSE; |
109 return NSK_FALSE; |
115 |
110 |
116 /* get tested thread field 'waitingMonitor' */ |
111 /* get tested thread field 'waitingMonitor' */ |
117 if (!NSK_JNI_VERIFY(jni, (field = |
112 if (!NSK_JNI_VERIFY(jni, (field = |
118 NSK_CPP_STUB4(GetFieldID, jni, klass, |
113 jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL)) |
119 "waitingMonitor", "Ljava/lang/Object;")) != NULL)) |
|
120 return NSK_FALSE; |
114 return NSK_FALSE; |
121 |
115 |
122 return NSK_TRUE; |
116 return NSK_TRUE; |
123 } |
117 } |
124 |
118 |
128 */ |
122 */ |
129 static int checkSuspend() { |
123 static int checkSuspend() { |
130 jvmtiError err; |
124 jvmtiError err; |
131 |
125 |
132 NSK_DISPLAY0("Checking negative: SuspendThread\n"); |
126 NSK_DISPLAY0("Checking negative: SuspendThread\n"); |
133 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
127 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread))) |
134 NSK_CPP_STUB2(SuspendThread, jvmti, thread))) |
|
135 return NSK_FALSE; |
128 return NSK_FALSE; |
136 |
129 |
137 NSK_DISPLAY0("Checking negative: ResumeThread\n"); |
130 NSK_DISPLAY0("Checking negative: ResumeThread\n"); |
138 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
131 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread))) |
139 NSK_CPP_STUB2(ResumeThread, jvmti, thread))) |
|
140 return NSK_FALSE; |
132 return NSK_FALSE; |
141 |
133 |
142 NSK_DISPLAY0("Checking negative: SuspendThreadList\n"); |
134 NSK_DISPLAY0("Checking negative: SuspendThreadList\n"); |
143 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
135 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
144 NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err))) |
136 jvmti->SuspendThreadList(1, &thread, &err))) |
145 return NSK_FALSE; |
137 return NSK_FALSE; |
146 |
138 |
147 NSK_DISPLAY0("Checking negative: ResumeThreadList\n"); |
139 NSK_DISPLAY0("Checking negative: ResumeThreadList\n"); |
148 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
140 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
149 NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err))) |
141 jvmti->ResumeThreadList(1, &thread, &err))) |
150 return NSK_FALSE; |
142 return NSK_FALSE; |
151 |
143 |
152 return NSK_TRUE; |
144 return NSK_TRUE; |
153 } |
145 } |
154 |
146 |
160 const char* THREAD_DEATH_CTOR_SIGNATURE = "()V"; |
152 const char* THREAD_DEATH_CTOR_SIGNATURE = "()V"; |
161 jclass cls = NULL; |
153 jclass cls = NULL; |
162 jmethodID ctor = NULL; |
154 jmethodID ctor = NULL; |
163 jobject exception = NULL; |
155 jobject exception = NULL; |
164 |
156 |
165 if (!NSK_JNI_VERIFY(jni, (cls = |
157 if (!NSK_JNI_VERIFY(jni, (cls = jni->FindClass(THREAD_DEATH_CLASS_NAME)) != NULL)) |
166 NSK_CPP_STUB2(FindClass, jni, THREAD_DEATH_CLASS_NAME)) != NULL)) |
|
167 return NSK_FALSE; |
158 return NSK_FALSE; |
168 |
159 |
169 if (!NSK_JNI_VERIFY(jni, (ctor = |
160 if (!NSK_JNI_VERIFY(jni, (ctor = |
170 NSK_CPP_STUB4(GetMethodID, jni, cls, |
161 jni->GetMethodID(cls, THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL)) |
171 THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL)) |
162 return NSK_FALSE; |
172 return NSK_FALSE; |
163 |
173 |
164 if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL)) |
174 if (!NSK_JNI_VERIFY(jni, (exception = |
|
175 NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL)) |
|
176 return NSK_FALSE; |
165 return NSK_FALSE; |
177 |
166 |
178 NSK_DISPLAY0("Checking negative: StopThread\n"); |
167 NSK_DISPLAY0("Checking negative: StopThread\n"); |
179 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
168 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
180 NSK_CPP_STUB3(StopThread, jvmti, thread, exception))) |
169 jvmti->StopThread(thread, exception))) |
181 return NSK_FALSE; |
170 return NSK_FALSE; |
182 |
171 |
183 NSK_DISPLAY0("Checking negative: InterruptThread\n"); |
172 NSK_DISPLAY0("Checking negative: InterruptThread\n"); |
184 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
173 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread))) |
185 NSK_CPP_STUB2(InterruptThread, jvmti, thread))) |
|
186 return NSK_FALSE; |
174 return NSK_FALSE; |
187 |
175 |
188 return NSK_TRUE; |
176 return NSK_TRUE; |
189 } |
177 } |
190 |
178 |
262 jlong *res_tags = NULL; |
249 jlong *res_tags = NULL; |
263 jint dummy_user_data = 0; |
250 jint dummy_user_data = 0; |
264 |
251 |
265 NSK_DISPLAY0("Checking negative: SetTag\n"); |
252 NSK_DISPLAY0("Checking negative: SetTag\n"); |
266 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
253 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
267 NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE))) |
254 jvmti->SetTag(thread, TAG_VALUE))) |
268 return NSK_FALSE; |
255 return NSK_FALSE; |
269 |
256 |
270 NSK_DISPLAY0("Checking negative: GetTag\n"); |
257 NSK_DISPLAY0("Checking negative: GetTag\n"); |
271 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
258 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag))) |
272 NSK_CPP_STUB3(GetTag, jvmti, thread, &tag))) |
|
273 return NSK_FALSE; |
259 return NSK_FALSE; |
274 |
260 |
275 NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n"); |
261 NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n"); |
276 tag = TAG_VALUE; |
262 tag = TAG_VALUE; |
277 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
263 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
278 NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag, |
264 jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags))) |
279 &count, &res_objects, &res_tags))) |
|
280 return NSK_FALSE; |
265 return NSK_FALSE; |
281 |
266 |
282 NSK_DISPLAY0("Checking negative: IterateOverHeap\n"); |
267 NSK_DISPLAY0("Checking negative: IterateOverHeap\n"); |
283 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
268 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
284 NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED, |
269 jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data))) |
285 HeapObject, &dummy_user_data))) |
|
286 return NSK_FALSE; |
270 return NSK_FALSE; |
287 |
271 |
288 NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n"); |
272 NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n"); |
289 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
273 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
290 NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass, |
274 jvmti->IterateOverInstancesOfClass(klass, |
291 JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data))) |
275 JVMTI_HEAP_OBJECT_UNTAGGED, |
|
276 HeapObject, |
|
277 &dummy_user_data))) |
292 return NSK_FALSE; |
278 return NSK_FALSE; |
293 |
279 |
294 NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n"); |
280 NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n"); |
295 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
281 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
296 NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread, |
282 jvmti->IterateOverObjectsReachableFromObject(thread, |
297 ObjectReference, &dummy_user_data))) |
283 ObjectReference, |
|
284 &dummy_user_data))) |
298 return NSK_FALSE; |
285 return NSK_FALSE; |
299 |
286 |
300 NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n"); |
287 NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n"); |
301 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
288 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
302 NSK_CPP_STUB5(IterateOverReachableObjects, jvmti, |
289 jvmti->IterateOverReachableObjects(HeapRoot, |
303 HeapRoot, StackReference, ObjectReference, &dummy_user_data))) |
290 StackReference, |
|
291 ObjectReference, |
|
292 &dummy_user_data))) |
304 return NSK_FALSE; |
293 return NSK_FALSE; |
305 |
294 |
306 return NSK_TRUE; |
295 return NSK_TRUE; |
307 } |
296 } |
308 |
297 |
317 jfloat float_value; |
306 jfloat float_value; |
318 jdouble double_value; |
307 jdouble double_value; |
319 |
308 |
320 NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n"); |
309 NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n"); |
321 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
310 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
322 NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count, |
311 jvmti->GetLocalVariableTable(method, &count, &local_variable_table))) |
323 &local_variable_table))) |
|
324 return NSK_FALSE; |
312 return NSK_FALSE; |
325 |
313 |
326 NSK_DISPLAY0("Checking negative: GetLocalObject\n"); |
314 NSK_DISPLAY0("Checking negative: GetLocalObject\n"); |
327 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
315 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
328 NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value))) |
316 jvmti->GetLocalObject(thread, 0, 0, &object_value))) |
329 return NSK_FALSE; |
317 return NSK_FALSE; |
330 |
318 |
331 NSK_DISPLAY0("Checking negative: GetLocalInt\n"); |
319 NSK_DISPLAY0("Checking negative: GetLocalInt\n"); |
332 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
320 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
333 NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value))) |
321 jvmti->GetLocalInt(thread, 0, 0, &int_value))) |
334 return NSK_FALSE; |
322 return NSK_FALSE; |
335 |
323 |
336 NSK_DISPLAY0("Checking negative: GetLocalLong\n"); |
324 NSK_DISPLAY0("Checking negative: GetLocalLong\n"); |
337 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
325 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
338 NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value))) |
326 jvmti->GetLocalLong(thread, 0, 0, &long_value))) |
339 return NSK_FALSE; |
327 return NSK_FALSE; |
340 |
328 |
341 NSK_DISPLAY0("Checking negative: GetLocalFloat\n"); |
329 NSK_DISPLAY0("Checking negative: GetLocalFloat\n"); |
342 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
330 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
343 NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value))) |
331 jvmti->GetLocalFloat(thread, 0, 0, &float_value))) |
344 return NSK_FALSE; |
332 return NSK_FALSE; |
345 |
333 |
346 NSK_DISPLAY0("Checking negative: GetLocalDouble\n"); |
334 NSK_DISPLAY0("Checking negative: GetLocalDouble\n"); |
347 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
335 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
348 NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value))) |
336 jvmti->GetLocalDouble(thread, 0, 0, &double_value))) |
349 return NSK_FALSE; |
337 return NSK_FALSE; |
350 |
338 |
351 NSK_DISPLAY0("Checking negative: SetLocalObject\n"); |
339 NSK_DISPLAY0("Checking negative: SetLocalObject\n"); |
352 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
340 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
353 NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread))) |
341 jvmti->SetLocalObject(thread, 0, 0, thread))) |
354 return NSK_FALSE; |
342 return NSK_FALSE; |
355 |
343 |
356 NSK_DISPLAY0("Checking negative: SetLocalInt\n"); |
344 NSK_DISPLAY0("Checking negative: SetLocalInt\n"); |
357 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
345 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
358 NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0))) |
346 jvmti->SetLocalInt(thread, 0, 0, (jint)0))) |
359 return NSK_FALSE; |
347 return NSK_FALSE; |
360 |
348 |
361 NSK_DISPLAY0("Checking negative: SetLocalLong\n"); |
349 NSK_DISPLAY0("Checking negative: SetLocalLong\n"); |
362 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
350 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
363 NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0))) |
351 jvmti->SetLocalLong(thread, 0, 0, (jlong)0))) |
364 return NSK_FALSE; |
352 return NSK_FALSE; |
365 |
353 |
366 NSK_DISPLAY0("Checking negative: SetLocalFloat\n"); |
354 NSK_DISPLAY0("Checking negative: SetLocalFloat\n"); |
367 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
355 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
368 NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0))) |
356 jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0))) |
369 return NSK_FALSE; |
357 return NSK_FALSE; |
370 |
358 |
371 NSK_DISPLAY0("Checking negative: SetLocalDouble\n"); |
359 NSK_DISPLAY0("Checking negative: SetLocalDouble\n"); |
372 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
360 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
373 NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0))) |
361 jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0))) |
374 return NSK_FALSE; |
362 return NSK_FALSE; |
375 |
363 |
376 return NSK_TRUE; |
364 return NSK_TRUE; |
377 } |
365 } |
378 |
366 |
383 jint count; |
371 jint count; |
384 jvmtiLineNumberEntry *line_number_table = NULL; |
372 jvmtiLineNumberEntry *line_number_table = NULL; |
385 |
373 |
386 NSK_DISPLAY0("Checking negative: GetSourceFileName\n"); |
374 NSK_DISPLAY0("Checking negative: GetSourceFileName\n"); |
387 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
375 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
388 NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name))) |
376 jvmti->GetSourceFileName(klass, &name))) |
389 return NSK_FALSE; |
377 return NSK_FALSE; |
390 |
378 |
391 NSK_DISPLAY0("Checking positive: GetSourceDebugExtension\n"); |
379 NSK_DISPLAY0("Checking positive: GetSourceDebugExtension\n"); |
392 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_ABSENT_INFORMATION, |
380 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_ABSENT_INFORMATION, |
393 NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name))) |
381 jvmti->GetSourceDebugExtension(klass, &name))) |
394 return NSK_FALSE; |
382 return NSK_FALSE; |
395 |
383 |
396 NSK_DISPLAY0("Checking negative: GetLineNumberTable\n"); |
384 NSK_DISPLAY0("Checking negative: GetLineNumberTable\n"); |
397 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
385 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
398 NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count, |
386 jvmti->GetLineNumberTable(method, &count, &line_number_table))) |
399 &line_number_table))) |
|
400 return NSK_FALSE; |
387 return NSK_FALSE; |
401 |
388 |
402 return NSK_TRUE; |
389 return NSK_TRUE; |
403 } |
390 } |
404 |
391 |
601 |
588 |
602 /* testcase #2: add the capability during Onload phase */ |
589 /* testcase #2: add the capability during Onload phase */ |
603 NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n"); |
590 NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n"); |
604 memset(&caps, 0, sizeof(caps)); |
591 memset(&caps, 0, sizeof(caps)); |
605 caps.CAPABILITY = 1; |
592 caps.CAPABILITY = 1; |
606 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) |
593 if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) |
607 return JNI_ERR; |
594 return JNI_ERR; |
608 |
595 |
609 /* testcase #3: check if GetCapabilities returns the capability */ |
596 /* testcase #3: check if GetCapabilities returns the capability */ |
610 NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n"); |
597 NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n"); |
611 memset(&caps, 0, sizeof(caps)); |
598 memset(&caps, 0, sizeof(caps)); |
612 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps))) |
599 if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps))) |
613 return JNI_ERR; |
600 return JNI_ERR; |
614 if (!caps.CAPABILITY) { |
601 if (!caps.CAPABILITY) { |
615 NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n", |
602 NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n", |
616 CAPABILITY_STR); |
603 CAPABILITY_STR); |
617 return JNI_ERR; |
604 return JNI_ERR; |
619 |
606 |
620 /* testcase #4: relinquish the capability during Onload phase */ |
607 /* testcase #4: relinquish the capability during Onload phase */ |
621 NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n"); |
608 NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n"); |
622 memset(&caps, 0, sizeof(caps)); |
609 memset(&caps, 0, sizeof(caps)); |
623 caps.CAPABILITY = 1; |
610 caps.CAPABILITY = 1; |
624 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps))) |
611 if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps))) |
625 return JNI_ERR; |
612 return JNI_ERR; |
626 |
613 |
627 /* testcase #5: check if GetCapabilities does not return the capability */ |
614 /* testcase #5: check if GetCapabilities does not return the capability */ |
628 NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n"); |
615 NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n"); |
629 memset(&caps, 0, sizeof(caps)); |
616 memset(&caps, 0, sizeof(caps)); |
630 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps))) |
617 if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps))) |
631 return JNI_ERR; |
618 return JNI_ERR; |
632 if (caps.CAPABILITY) { |
619 if (caps.CAPABILITY) { |
633 NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n", |
620 NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n", |
634 CAPABILITY_STR); |
621 CAPABILITY_STR); |
635 return JNI_ERR; |
622 return JNI_ERR; |