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