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