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 'waitingFlag' */ |
110 /* get tested thread field 'waitingFlag' */ |
116 if (!NSK_JNI_VERIFY(jni, (field = |
111 if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "waitingFlag", "Z")) != NULL)) |
117 NSK_CPP_STUB4(GetFieldID, jni, klass, "waitingFlag", "Z")) != NULL)) |
|
118 return NSK_FALSE; |
112 return NSK_FALSE; |
119 |
113 |
120 return NSK_TRUE; |
114 return NSK_TRUE; |
121 } |
115 } |
122 |
116 |
126 */ |
120 */ |
127 static int checkSuspend() { |
121 static int checkSuspend() { |
128 jvmtiError err; |
122 jvmtiError err; |
129 |
123 |
130 NSK_DISPLAY0("Checking negative: SuspendThread\n"); |
124 NSK_DISPLAY0("Checking negative: SuspendThread\n"); |
131 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
125 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread))) |
132 NSK_CPP_STUB2(SuspendThread, jvmti, thread))) |
|
133 return NSK_FALSE; |
126 return NSK_FALSE; |
134 |
127 |
135 NSK_DISPLAY0("Checking negative: ResumeThread\n"); |
128 NSK_DISPLAY0("Checking negative: ResumeThread\n"); |
136 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
129 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread))) |
137 NSK_CPP_STUB2(ResumeThread, jvmti, thread))) |
|
138 return NSK_FALSE; |
130 return NSK_FALSE; |
139 |
131 |
140 NSK_DISPLAY0("Checking negative: SuspendThreadList\n"); |
132 NSK_DISPLAY0("Checking negative: SuspendThreadList\n"); |
141 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
133 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
142 NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err))) |
134 jvmti->SuspendThreadList(1, &thread, &err))) |
143 return NSK_FALSE; |
135 return NSK_FALSE; |
144 |
136 |
145 NSK_DISPLAY0("Checking negative: ResumeThreadList\n"); |
137 NSK_DISPLAY0("Checking negative: ResumeThreadList\n"); |
146 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
138 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
147 NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err))) |
139 jvmti->ResumeThreadList(1, &thread, &err))) |
148 return NSK_FALSE; |
140 return NSK_FALSE; |
149 |
141 |
150 return NSK_TRUE; |
142 return NSK_TRUE; |
151 } |
143 } |
152 |
144 |
158 const char* THREAD_DEATH_CTOR_SIGNATURE = "()V"; |
150 const char* THREAD_DEATH_CTOR_SIGNATURE = "()V"; |
159 jclass cls = NULL; |
151 jclass cls = NULL; |
160 jmethodID ctor = NULL; |
152 jmethodID ctor = NULL; |
161 jobject exception = NULL; |
153 jobject exception = NULL; |
162 |
154 |
163 if (!NSK_JNI_VERIFY(jni, (cls = |
155 if (!NSK_JNI_VERIFY(jni, (cls = jni->FindClass(THREAD_DEATH_CLASS_NAME)) != NULL)) |
164 NSK_CPP_STUB2(FindClass, jni, THREAD_DEATH_CLASS_NAME)) != NULL)) |
|
165 return NSK_FALSE; |
156 return NSK_FALSE; |
166 |
157 |
167 if (!NSK_JNI_VERIFY(jni, (ctor = |
158 if (!NSK_JNI_VERIFY(jni, (ctor = |
168 NSK_CPP_STUB4(GetMethodID, jni, cls, |
159 jni->GetMethodID(cls, THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL)) |
169 THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL)) |
160 return NSK_FALSE; |
170 return NSK_FALSE; |
161 |
171 |
162 if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL)) |
172 if (!NSK_JNI_VERIFY(jni, (exception = |
|
173 NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL)) |
|
174 return NSK_FALSE; |
163 return NSK_FALSE; |
175 |
164 |
176 NSK_DISPLAY0("Checking negative: StopThread\n"); |
165 NSK_DISPLAY0("Checking negative: StopThread\n"); |
177 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
166 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
178 NSK_CPP_STUB3(StopThread, jvmti, thread, exception))) |
167 jvmti->StopThread(thread, exception))) |
179 return NSK_FALSE; |
168 return NSK_FALSE; |
180 |
169 |
181 NSK_DISPLAY0("Checking negative: InterruptThread\n"); |
170 NSK_DISPLAY0("Checking negative: InterruptThread\n"); |
182 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
171 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread))) |
183 NSK_CPP_STUB2(InterruptThread, jvmti, thread))) |
|
184 return NSK_FALSE; |
172 return NSK_FALSE; |
185 |
173 |
186 return NSK_TRUE; |
174 return NSK_TRUE; |
187 } |
175 } |
188 |
176 |
221 |
209 |
222 NSK_DISPLAY0("Checking positive: PopFrame\n"); |
210 NSK_DISPLAY0("Checking positive: PopFrame\n"); |
223 |
211 |
224 memset(&caps, 0, sizeof(caps)); |
212 memset(&caps, 0, sizeof(caps)); |
225 caps.can_suspend = 1; |
213 caps.can_suspend = 1; |
226 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) |
214 if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) |
227 return JNI_ERR; |
215 return JNI_ERR; |
228 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, thread))) |
216 if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread))) |
229 return NSK_FALSE; |
217 return NSK_FALSE; |
230 |
218 |
231 // PopFrame is allowed to fail with JVMTI_ERROR_OPAQUE_FRAME. |
219 // PopFrame is allowed to fail with JVMTI_ERROR_OPAQUE_FRAME. |
232 // That will happen if we are in a native function, for example while waiting for a Condition. |
220 // That will happen if we are in a native function, for example while waiting for a Condition. |
233 // See JCK-5020108. |
221 // See JCK-5020108. |
234 err = NSK_CPP_STUB2(PopFrame, jvmti, thread); |
222 err = jvmti->PopFrame(thread); |
235 if (err != JVMTI_ERROR_NONE && err != JVMTI_ERROR_OPAQUE_FRAME) { |
223 if (err != JVMTI_ERROR_NONE && err != JVMTI_ERROR_OPAQUE_FRAME) { |
236 NSK_DISPLAY1("jvmti error from PopFrame: %d\n", err); |
224 NSK_DISPLAY1("jvmti error from PopFrame: %d\n", err); |
237 return NSK_FALSE; |
225 return NSK_FALSE; |
238 } |
226 } |
239 |
227 |
240 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread))) |
228 if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread))) |
241 return NSK_FALSE; |
229 return NSK_FALSE; |
242 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps))) |
230 if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps))) |
243 return JNI_ERR; |
231 return JNI_ERR; |
244 |
232 |
245 return NSK_TRUE; |
233 return NSK_TRUE; |
246 } |
234 } |
247 |
235 |
281 jlong *res_tags = NULL; |
269 jlong *res_tags = NULL; |
282 jint dummy_user_data = 0; |
270 jint dummy_user_data = 0; |
283 |
271 |
284 NSK_DISPLAY0("Checking negative: SetTag\n"); |
272 NSK_DISPLAY0("Checking negative: SetTag\n"); |
285 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
273 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
286 NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE))) |
274 jvmti->SetTag(thread, TAG_VALUE))) |
287 return NSK_FALSE; |
275 return NSK_FALSE; |
288 |
276 |
289 NSK_DISPLAY0("Checking negative: GetTag\n"); |
277 NSK_DISPLAY0("Checking negative: GetTag\n"); |
290 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
278 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag))) |
291 NSK_CPP_STUB3(GetTag, jvmti, thread, &tag))) |
|
292 return NSK_FALSE; |
279 return NSK_FALSE; |
293 |
280 |
294 NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n"); |
281 NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n"); |
295 tag = TAG_VALUE; |
282 tag = TAG_VALUE; |
296 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
283 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
297 NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag, |
284 jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags))) |
298 &count, &res_objects, &res_tags))) |
|
299 return NSK_FALSE; |
285 return NSK_FALSE; |
300 |
286 |
301 NSK_DISPLAY0("Checking negative: IterateOverHeap\n"); |
287 NSK_DISPLAY0("Checking negative: IterateOverHeap\n"); |
302 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
288 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
303 NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED, |
289 jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, |
304 HeapObject, &dummy_user_data))) |
290 HeapObject, |
|
291 &dummy_user_data))) |
305 return NSK_FALSE; |
292 return NSK_FALSE; |
306 |
293 |
307 NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n"); |
294 NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n"); |
308 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
295 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
309 NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass, |
296 jvmti->IterateOverInstancesOfClass(klass, |
310 JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data))) |
297 JVMTI_HEAP_OBJECT_UNTAGGED, |
|
298 HeapObject, |
|
299 &dummy_user_data))) |
311 return NSK_FALSE; |
300 return NSK_FALSE; |
312 |
301 |
313 NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n"); |
302 NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n"); |
314 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
303 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
315 NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread, |
304 jvmti->IterateOverObjectsReachableFromObject(thread, |
316 ObjectReference, &dummy_user_data))) |
305 ObjectReference, |
|
306 &dummy_user_data))) |
317 return NSK_FALSE; |
307 return NSK_FALSE; |
318 |
308 |
319 NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n"); |
309 NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n"); |
320 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
310 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
321 NSK_CPP_STUB5(IterateOverReachableObjects, jvmti, |
311 jvmti->IterateOverReachableObjects(HeapRoot, |
322 HeapRoot, StackReference, ObjectReference, &dummy_user_data))) |
312 StackReference, |
|
313 ObjectReference, |
|
314 &dummy_user_data))) |
323 return NSK_FALSE; |
315 return NSK_FALSE; |
324 |
316 |
325 return NSK_TRUE; |
317 return NSK_TRUE; |
326 } |
318 } |
327 |
319 |
336 jfloat float_value; |
328 jfloat float_value; |
337 jdouble double_value; |
329 jdouble double_value; |
338 |
330 |
339 NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n"); |
331 NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n"); |
340 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
332 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
341 NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count, |
333 jvmti->GetLocalVariableTable(method, &count, &local_variable_table))) |
342 &local_variable_table))) |
|
343 return NSK_FALSE; |
334 return NSK_FALSE; |
344 |
335 |
345 NSK_DISPLAY0("Checking negative: GetLocalObject\n"); |
336 NSK_DISPLAY0("Checking negative: GetLocalObject\n"); |
346 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
337 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
347 NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value))) |
338 jvmti->GetLocalObject(thread, 0, 0, &object_value))) |
348 return NSK_FALSE; |
339 return NSK_FALSE; |
349 |
340 |
350 NSK_DISPLAY0("Checking negative: GetLocalInt\n"); |
341 NSK_DISPLAY0("Checking negative: GetLocalInt\n"); |
351 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
342 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
352 NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value))) |
343 jvmti->GetLocalInt(thread, 0, 0, &int_value))) |
353 return NSK_FALSE; |
344 return NSK_FALSE; |
354 |
345 |
355 NSK_DISPLAY0("Checking negative: GetLocalLong\n"); |
346 NSK_DISPLAY0("Checking negative: GetLocalLong\n"); |
356 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
347 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
357 NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value))) |
348 jvmti->GetLocalLong(thread, 0, 0, &long_value))) |
358 return NSK_FALSE; |
349 return NSK_FALSE; |
359 |
350 |
360 NSK_DISPLAY0("Checking negative: GetLocalFloat\n"); |
351 NSK_DISPLAY0("Checking negative: GetLocalFloat\n"); |
361 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
352 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
362 NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value))) |
353 jvmti->GetLocalFloat(thread, 0, 0, &float_value))) |
363 return NSK_FALSE; |
354 return NSK_FALSE; |
364 |
355 |
365 NSK_DISPLAY0("Checking negative: GetLocalDouble\n"); |
356 NSK_DISPLAY0("Checking negative: GetLocalDouble\n"); |
366 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
357 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
367 NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value))) |
358 jvmti->GetLocalDouble(thread, 0, 0, &double_value))) |
368 return NSK_FALSE; |
359 return NSK_FALSE; |
369 |
360 |
370 NSK_DISPLAY0("Checking negative: SetLocalObject\n"); |
361 NSK_DISPLAY0("Checking negative: SetLocalObject\n"); |
371 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
362 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
372 NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread))) |
363 jvmti->SetLocalObject(thread, 0, 0, thread))) |
373 return NSK_FALSE; |
364 return NSK_FALSE; |
374 |
365 |
375 NSK_DISPLAY0("Checking negative: SetLocalInt\n"); |
366 NSK_DISPLAY0("Checking negative: SetLocalInt\n"); |
376 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
367 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
377 NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0))) |
368 jvmti->SetLocalInt(thread, 0, 0, (jint)0))) |
378 return NSK_FALSE; |
369 return NSK_FALSE; |
379 |
370 |
380 NSK_DISPLAY0("Checking negative: SetLocalLong\n"); |
371 NSK_DISPLAY0("Checking negative: SetLocalLong\n"); |
381 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
372 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
382 NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0))) |
373 jvmti->SetLocalLong(thread, 0, 0, (jlong)0))) |
383 return NSK_FALSE; |
374 return NSK_FALSE; |
384 |
375 |
385 NSK_DISPLAY0("Checking negative: SetLocalFloat\n"); |
376 NSK_DISPLAY0("Checking negative: SetLocalFloat\n"); |
386 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
377 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
387 NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0))) |
378 jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0))) |
388 return NSK_FALSE; |
379 return NSK_FALSE; |
389 |
380 |
390 NSK_DISPLAY0("Checking negative: SetLocalDouble\n"); |
381 NSK_DISPLAY0("Checking negative: SetLocalDouble\n"); |
391 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
382 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
392 NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0))) |
383 jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0))) |
393 return NSK_FALSE; |
384 return NSK_FALSE; |
394 |
385 |
395 return NSK_TRUE; |
386 return NSK_TRUE; |
396 } |
387 } |
397 |
388 |
402 jint count; |
393 jint count; |
403 jvmtiLineNumberEntry *line_number_table = NULL; |
394 jvmtiLineNumberEntry *line_number_table = NULL; |
404 |
395 |
405 NSK_DISPLAY0("Checking negative: GetSourceFileName\n"); |
396 NSK_DISPLAY0("Checking negative: GetSourceFileName\n"); |
406 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
397 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
407 NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name))) |
398 jvmti->GetSourceFileName(klass, &name))) |
408 return NSK_FALSE; |
399 return NSK_FALSE; |
409 |
400 |
410 NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n"); |
401 NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n"); |
411 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
402 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
412 NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name))) |
403 jvmti->GetSourceDebugExtension(klass, &name))) |
413 return NSK_FALSE; |
404 return NSK_FALSE; |
414 |
405 |
415 NSK_DISPLAY0("Checking negative: GetLineNumberTable\n"); |
406 NSK_DISPLAY0("Checking negative: GetLineNumberTable\n"); |
416 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
407 if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, |
417 NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count, |
408 jvmti->GetLineNumberTable(method, &count, &line_number_table))) |
418 &line_number_table))) |
|
419 return NSK_FALSE; |
409 return NSK_FALSE; |
420 |
410 |
421 return NSK_TRUE; |
411 return NSK_TRUE; |
422 } |
412 } |
423 |
413 |
620 |
610 |
621 /* testcase #2: add the capability during Onload phase */ |
611 /* testcase #2: add the capability during Onload phase */ |
622 NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n"); |
612 NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n"); |
623 memset(&caps, 0, sizeof(caps)); |
613 memset(&caps, 0, sizeof(caps)); |
624 caps.CAPABILITY = 1; |
614 caps.CAPABILITY = 1; |
625 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) |
615 if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) |
626 return JNI_ERR; |
616 return JNI_ERR; |
627 |
617 |
628 /* testcase #3: check if GetCapabilities returns the capability */ |
618 /* testcase #3: check if GetCapabilities returns the capability */ |
629 NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n"); |
619 NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n"); |
630 memset(&caps, 0, sizeof(caps)); |
620 memset(&caps, 0, sizeof(caps)); |
631 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps))) |
621 if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps))) |
632 return JNI_ERR; |
622 return JNI_ERR; |
633 if (!caps.CAPABILITY) { |
623 if (!caps.CAPABILITY) { |
634 NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n", |
624 NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n", |
635 CAPABILITY_STR); |
625 CAPABILITY_STR); |
636 return JNI_ERR; |
626 return JNI_ERR; |
638 |
628 |
639 /* testcase #4: relinquish the capability during Onload phase */ |
629 /* testcase #4: relinquish the capability during Onload phase */ |
640 NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n"); |
630 NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n"); |
641 memset(&caps, 0, sizeof(caps)); |
631 memset(&caps, 0, sizeof(caps)); |
642 caps.CAPABILITY = 1; |
632 caps.CAPABILITY = 1; |
643 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps))) |
633 if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps))) |
644 return JNI_ERR; |
634 return JNI_ERR; |
645 |
635 |
646 /* testcase #5: check if GetCapabilities does not return the capability */ |
636 /* testcase #5: check if GetCapabilities does not return the capability */ |
647 NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n"); |
637 NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n"); |
648 memset(&caps, 0, sizeof(caps)); |
638 memset(&caps, 0, sizeof(caps)); |
649 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps))) |
639 if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps))) |
650 return JNI_ERR; |
640 return JNI_ERR; |
651 if (caps.CAPABILITY) { |
641 if (caps.CAPABILITY) { |
652 NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n", |
642 NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n", |
653 CAPABILITY_STR); |
643 CAPABILITY_STR); |
654 return JNI_ERR; |
644 return JNI_ERR; |