diff options
Diffstat (limited to 'test/986-native-method-bind/native_bind.cc')
-rw-r--r-- | test/986-native-method-bind/native_bind.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/986-native-method-bind/native_bind.cc b/test/986-native-method-bind/native_bind.cc index 4f93f87dfe..eec635b2a0 100644 --- a/test/986-native-method-bind/native_bind.cc +++ b/test/986-native-method-bind/native_bind.cc @@ -38,11 +38,16 @@ static void doUpPrintCall(JNIEnv* env, const char* function) { env->CallStaticVoidMethod(klass.get(), targetMethod); } -extern "C" JNIEXPORT void JNICALL Java_art_Test986_00024Transform_sayHi( +extern "C" JNIEXPORT void JNICALL Java_art_Test986_00024Transform_sayHi__( JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) { doUpPrintCall(env, "doSayHi"); } +extern "C" JNIEXPORT void JNICALL Java_art_Test986_00024Transform_sayHi2( + JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) { + doUpPrintCall(env, "doSayHi2"); +} + extern "C" JNIEXPORT void JNICALL NoReallySayGoodbye(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) { doUpPrintCall(env, "doSayBye"); } @@ -106,5 +111,17 @@ extern "C" JNIEXPORT void JNICALL Java_art_Test986_setNativeBindNotify( } } +extern "C" JNIEXPORT void JNICALL Java_art_Test986_rebindTransformClass( + JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jclass k) { + JNINativeMethod m[2]; + m[0].name= "sayHi"; + m[0].signature = "()V"; + m[0].fnPtr = reinterpret_cast<void*>(Java_art_Test986_00024Transform_sayHi__); + m[1].name= "sayHi2"; + m[1].signature = "()V"; + m[1].fnPtr = reinterpret_cast<void*>(Java_art_Test986_00024Transform_sayHi2); + env->RegisterNatives(k, m, 2); +} + } // namespace Test986NativeBind } // namespace art |