Lines Matching refs:check_jni
100 void ExpectClassNotFound(const char* name, bool check_jni, const char* check_jni_msg, in ExpectClassNotFound() argument
103 if (!check_jni || check_jni_msg == nullptr) { in ExpectClassNotFound()
111 void FindClassTest(bool check_jni) { in FindClassTest() argument
112 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in FindClassTest()
117 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in FindClassTest()
128 ExpectClassNotFound("C", check_jni, nullptr, &check_jni_abort_catcher); in FindClassTest()
129 ExpectClassNotFound("V", check_jni, nullptr, &check_jni_abort_catcher); in FindClassTest()
130 ExpectClassNotFound("K", check_jni, nullptr, &check_jni_abort_catcher); in FindClassTest()
132 if (check_jni) { in FindClassTest()
147 ExpectClassNotFound("Ljava.lang.String;", check_jni, "illegal class name 'Ljava.lang.String;'", in FindClassTest()
149 ExpectClassNotFound("[java.lang.String", check_jni, "illegal class name '[java.lang.String'", in FindClassTest()
153 ExpectClassNotFound("Ljava/lang/String;", check_jni, "illegal class name 'Ljava/lang/String;'", in FindClassTest()
157 ExpectClassNotFound("[java/lang/String", check_jni, "illegal class name '[java/lang/String'", in FindClassTest()
160 ExpectClassNotFound("[K", check_jni, "illegal class name '[K'", &check_jni_abort_catcher); in FindClassTest()
163 ExpectClassNotFound("[V", check_jni, "illegal class name '[V'", &check_jni_abort_catcher); in FindClassTest()
165 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in FindClassTest()
168 void GetFieldIdBadArgumentTest(bool check_jni) { in GetFieldIdBadArgumentTest() argument
169 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetFieldIdBadArgumentTest()
177 check_jni_abort_catcher.Check(check_jni ? "GetFieldID received NULL jclass" in GetFieldIdBadArgumentTest()
181 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetFieldIdBadArgumentTest()
185 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetFieldIdBadArgumentTest()
188 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetFieldIdBadArgumentTest()
191 void GetStaticFieldIdBadArgumentTest(bool check_jni) { in GetStaticFieldIdBadArgumentTest() argument
192 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetStaticFieldIdBadArgumentTest()
200 check_jni_abort_catcher.Check(check_jni ? "GetStaticFieldID received NULL jclass" in GetStaticFieldIdBadArgumentTest()
204 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetStaticFieldIdBadArgumentTest()
208 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetStaticFieldIdBadArgumentTest()
211 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetStaticFieldIdBadArgumentTest()
214 void GetMethodIdBadArgumentTest(bool check_jni) { in GetMethodIdBadArgumentTest() argument
215 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetMethodIdBadArgumentTest()
220 check_jni_abort_catcher.Check(check_jni ? "GetMethodID received NULL jclass" in GetMethodIdBadArgumentTest()
226 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetMethodIdBadArgumentTest()
230 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetMethodIdBadArgumentTest()
233 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetMethodIdBadArgumentTest()
236 void GetStaticMethodIdBadArgumentTest(bool check_jni) { in GetStaticMethodIdBadArgumentTest() argument
237 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetStaticMethodIdBadArgumentTest()
242 check_jni_abort_catcher.Check(check_jni ? "GetStaticMethodID received NULL jclass" in GetStaticMethodIdBadArgumentTest()
247 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetStaticMethodIdBadArgumentTest()
251 check_jni_abort_catcher.Check(check_jni ? "non-nullable const char* was NULL" in GetStaticMethodIdBadArgumentTest()
254 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetStaticMethodIdBadArgumentTest()
257 void GetFromReflectedField_ToReflectedFieldBadArgumentTest(bool check_jni) { in GetFromReflectedField_ToReflectedFieldBadArgumentTest() argument
258 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetFromReflectedField_ToReflectedFieldBadArgumentTest()
268 if (check_jni) { in GetFromReflectedField_ToReflectedFieldBadArgumentTest()
277 check_jni_abort_catcher.Check(check_jni ? "jfieldID was NULL" in GetFromReflectedField_ToReflectedFieldBadArgumentTest()
282 check_jni_abort_catcher.Check(check_jni ? "expected non-null java.lang.reflect.Field" in GetFromReflectedField_ToReflectedFieldBadArgumentTest()
285 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetFromReflectedField_ToReflectedFieldBadArgumentTest()
288 void GetFromReflectedMethod_ToReflectedMethodBadArgumentTest(bool check_jni) { in GetFromReflectedMethod_ToReflectedMethodBadArgumentTest() argument
289 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetFromReflectedMethod_ToReflectedMethodBadArgumentTest()
299 if (check_jni) { in GetFromReflectedMethod_ToReflectedMethodBadArgumentTest()
308 check_jni_abort_catcher.Check(check_jni ? "jmethodID was NULL" in GetFromReflectedMethod_ToReflectedMethodBadArgumentTest()
312 check_jni_abort_catcher.Check(check_jni ? "expected non-null method" : "jlr_method == null"); in GetFromReflectedMethod_ToReflectedMethodBadArgumentTest()
314 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetFromReflectedMethod_ToReflectedMethodBadArgumentTest()
317 void RegisterAndUnregisterNativesBadArguments(bool check_jni, in RegisterAndUnregisterNativesBadArguments() argument
319 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in RegisterAndUnregisterNativesBadArguments()
324 check_jni_abort_catcher->Check(check_jni ? "RegisterNatives received NULL jclass" in RegisterAndUnregisterNativesBadArguments()
335 check_jni_abort_catcher->Check(check_jni ? "UnregisterNatives received NULL jclass" in RegisterAndUnregisterNativesBadArguments()
338 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in RegisterAndUnregisterNativesBadArguments()
342 void GetPrimitiveArrayElementsOfWrongType(bool check_jni) { in GetPrimitiveArrayElementsOfWrongType() argument
343 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetPrimitiveArrayElementsOfWrongType()
350 check_jni ? "incompatible array type boolean[] expected byte[]" in GetPrimitiveArrayElementsOfWrongType()
354 check_jni ? "incompatible array type boolean[] expected short[]" in GetPrimitiveArrayElementsOfWrongType()
358 check_jni ? "incompatible array type boolean[] expected char[]" in GetPrimitiveArrayElementsOfWrongType()
362 check_jni ? "incompatible array type boolean[] expected int[]" in GetPrimitiveArrayElementsOfWrongType()
366 check_jni ? "incompatible array type boolean[] expected long[]" in GetPrimitiveArrayElementsOfWrongType()
370 check_jni ? "incompatible array type boolean[] expected float[]" in GetPrimitiveArrayElementsOfWrongType()
374 check_jni ? "incompatible array type boolean[] expected double[]" in GetPrimitiveArrayElementsOfWrongType()
380 check_jni ? "incompatible array type byte[] expected boolean[]" in GetPrimitiveArrayElementsOfWrongType()
386 check_jni ? "jarray argument has non-array type: java.lang.String" in GetPrimitiveArrayElementsOfWrongType()
389 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetPrimitiveArrayElementsOfWrongType()
392 void ReleasePrimitiveArrayElementsOfWrongType(bool check_jni) { in ReleasePrimitiveArrayElementsOfWrongType() argument
393 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in ReleasePrimitiveArrayElementsOfWrongType()
404 check_jni ? "incompatible array type boolean[] expected byte[]" in ReleasePrimitiveArrayElementsOfWrongType()
409 check_jni ? "incompatible array type boolean[] expected short[]" in ReleasePrimitiveArrayElementsOfWrongType()
414 check_jni ? "incompatible array type boolean[] expected char[]" in ReleasePrimitiveArrayElementsOfWrongType()
419 check_jni ? "incompatible array type boolean[] expected int[]" in ReleasePrimitiveArrayElementsOfWrongType()
424 check_jni ? "incompatible array type boolean[] expected long[]" in ReleasePrimitiveArrayElementsOfWrongType()
429 check_jni ? "incompatible array type boolean[] expected float[]" in ReleasePrimitiveArrayElementsOfWrongType()
434 check_jni ? "incompatible array type boolean[] expected double[]" in ReleasePrimitiveArrayElementsOfWrongType()
448 check_jni ? "incompatible array type byte[] expected boolean[]" in ReleasePrimitiveArrayElementsOfWrongType()
454 check_jni ? "jarray argument has non-array type: java.lang.String" in ReleasePrimitiveArrayElementsOfWrongType()
461 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in ReleasePrimitiveArrayElementsOfWrongType()
464 void GetReleasePrimitiveArrayCriticalOfWrongType(bool check_jni) { in GetReleasePrimitiveArrayCriticalOfWrongType() argument
465 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetReleasePrimitiveArrayCriticalOfWrongType()
471 jni_abort_catcher.Check(check_jni ? "jarray argument has non-array type: java.lang.String" in GetReleasePrimitiveArrayCriticalOfWrongType()
474 jni_abort_catcher.Check(check_jni ? "jarray argument has non-array type: java.lang.String" in GetReleasePrimitiveArrayCriticalOfWrongType()
477 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetReleasePrimitiveArrayCriticalOfWrongType()
480 void GetPrimitiveArrayRegionElementsOfWrongType(bool check_jni) { in GetPrimitiveArrayRegionElementsOfWrongType() argument
481 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in GetPrimitiveArrayRegionElementsOfWrongType()
490 check_jni ? "incompatible array type boolean[] expected byte[]" in GetPrimitiveArrayRegionElementsOfWrongType()
495 check_jni ? "incompatible array type boolean[] expected short[]" in GetPrimitiveArrayRegionElementsOfWrongType()
500 check_jni ? "incompatible array type boolean[] expected char[]" in GetPrimitiveArrayRegionElementsOfWrongType()
505 check_jni ? "incompatible array type boolean[] expected int[]" in GetPrimitiveArrayRegionElementsOfWrongType()
510 check_jni ? "incompatible array type boolean[] expected long[]" in GetPrimitiveArrayRegionElementsOfWrongType()
515 check_jni ? "incompatible array type boolean[] expected float[]" in GetPrimitiveArrayRegionElementsOfWrongType()
520 check_jni ? "incompatible array type boolean[] expected double[]" in GetPrimitiveArrayRegionElementsOfWrongType()
526 check_jni ? "incompatible array type byte[] expected boolean[]" in GetPrimitiveArrayRegionElementsOfWrongType()
531 jni_abort_catcher.Check(check_jni ? "jarray argument has non-array type: java.lang.String" in GetPrimitiveArrayRegionElementsOfWrongType()
535 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in GetPrimitiveArrayRegionElementsOfWrongType()
538 void SetPrimitiveArrayRegionElementsOfWrongType(bool check_jni) { in SetPrimitiveArrayRegionElementsOfWrongType() argument
539 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in SetPrimitiveArrayRegionElementsOfWrongType()
548 check_jni ? "incompatible array type boolean[] expected byte[]" in SetPrimitiveArrayRegionElementsOfWrongType()
553 check_jni ? "incompatible array type boolean[] expected short[]" in SetPrimitiveArrayRegionElementsOfWrongType()
558 check_jni ? "incompatible array type boolean[] expected char[]" in SetPrimitiveArrayRegionElementsOfWrongType()
563 check_jni ? "incompatible array type boolean[] expected int[]" in SetPrimitiveArrayRegionElementsOfWrongType()
568 check_jni ? "incompatible array type boolean[] expected long[]" in SetPrimitiveArrayRegionElementsOfWrongType()
573 check_jni ? "incompatible array type boolean[] expected float[]" in SetPrimitiveArrayRegionElementsOfWrongType()
578 check_jni ? "incompatible array type boolean[] expected double[]" in SetPrimitiveArrayRegionElementsOfWrongType()
584 check_jni ? "incompatible array type byte[] expected boolean[]" in SetPrimitiveArrayRegionElementsOfWrongType()
589 jni_abort_catcher.Check(check_jni ? "jarray argument has non-array type: java.lang.String" in SetPrimitiveArrayRegionElementsOfWrongType()
592 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in SetPrimitiveArrayRegionElementsOfWrongType()
595 void NewObjectArrayBadArguments(bool check_jni) { in NewObjectArrayBadArguments() argument
596 bool old_check_jni = vm_->SetCheckJniEnabled(check_jni); in NewObjectArrayBadArguments()
603 jni_abort_catcher.Check(check_jni ? "negative jsize: -1" : "negative array length: -1"); in NewObjectArrayBadArguments()
606 jni_abort_catcher.Check(check_jni ? "negative jsize: -2147483648" in NewObjectArrayBadArguments()
609 EXPECT_EQ(check_jni, vm_->SetCheckJniEnabled(old_check_jni)); in NewObjectArrayBadArguments()