diff options
Diffstat (limited to 'test/115-native-bridge')
-rw-r--r-- | test/115-native-bridge/expected.txt | 5 | ||||
-rw-r--r-- | test/115-native-bridge/nativebridge.cc | 10 | ||||
-rw-r--r-- | test/115-native-bridge/src/NativeBridgeMain.java | 3 |
3 files changed, 17 insertions, 1 deletions
diff --git a/test/115-native-bridge/expected.txt b/test/115-native-bridge/expected.txt index 16a71e4..deb70ba 100644 --- a/test/115-native-bridge/expected.txt +++ b/test/115-native-bridge/expected.txt @@ -4,7 +4,7 @@ Checking for getEnvValues. Ready for native bridge tests. Checking for support. Getting trampoline for JNI_OnLoad with shorty (null). -Test ART callbacks: all JNI function number is 9. +Test ART callbacks: all JNI function number is 10. name:booleanMethod, signature:(ZZZZZZZZZZ)Z, shorty:ZZZZZZZZZZZ. name:byteMethod, signature:(BBBBBBBBBB)B, shorty:BBBBBBBBBBB. name:charMethod, signature:(CCCCCCCCCC)C, shorty:CCCCCCCCCCC. @@ -13,6 +13,7 @@ Test ART callbacks: all JNI function number is 9. name:testFindClassOnAttachedNativeThread, signature:()V, shorty:V. name:testFindFieldOnAttachedNativeThreadNative, signature:()V, shorty:V. name:testGetMirandaMethodNative, signature:()Ljava/lang/reflect/Method;, shorty:L. + name:testNewStringObject, signature:()V, shorty:V. name:testZeroLengthByteBuffers, signature:()V, shorty:V. trampoline_JNI_OnLoad called! Getting trampoline for Java_Main_testFindClassOnAttachedNativeThread with shorty V. @@ -55,3 +56,5 @@ trampoline_Java_Main_charMethod called! trampoline_Java_Main_charMethod called! trampoline_Java_Main_charMethod called! trampoline_Java_Main_charMethod called! +Getting trampoline for Java_Main_testNewStringObject with shorty V. +trampoline_Java_Main_testNewStringObject called! diff --git a/test/115-native-bridge/nativebridge.cc b/test/115-native-bridge/nativebridge.cc index 6bcc1f5..24e9600 100644 --- a/test/115-native-bridge/nativebridge.cc +++ b/test/115-native-bridge/nativebridge.cc @@ -122,6 +122,14 @@ static jobject trampoline_Java_Main_testGetMirandaMethodNative(JNIEnv* env, jcla return fnPtr(env, klass); } +static void trampoline_Java_Main_testNewStringObject(JNIEnv* env, jclass klass) { + typedef void (*FnPtr_t)(JNIEnv*, jclass); + FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> + (find_native_bridge_method("testNewStringObject")->fnPtr); + printf("%s called!\n", __FUNCTION__); + return fnPtr(env, klass); +} + static void trampoline_Java_Main_testZeroLengthByteBuffers(JNIEnv* env, jclass klass) { typedef void (*FnPtr_t)(JNIEnv*, jclass); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> @@ -190,6 +198,8 @@ NativeBridgeMethod gNativeBridgeMethods[] = { reinterpret_cast<void*>(trampoline_Java_Main_testFindFieldOnAttachedNativeThreadNative) }, { "testGetMirandaMethodNative", "()Ljava/lang/reflect/Method;", true, nullptr, reinterpret_cast<void*>(trampoline_Java_Main_testGetMirandaMethodNative) }, + { "testNewStringObject", "()V", true, nullptr, + reinterpret_cast<void*>(trampoline_Java_Main_testNewStringObject) }, { "testZeroLengthByteBuffers", "()V", true, nullptr, reinterpret_cast<void*>(trampoline_Java_Main_testZeroLengthByteBuffers) }, }; diff --git a/test/115-native-bridge/src/NativeBridgeMain.java b/test/115-native-bridge/src/NativeBridgeMain.java index 2405627..c843707 100644 --- a/test/115-native-bridge/src/NativeBridgeMain.java +++ b/test/115-native-bridge/src/NativeBridgeMain.java @@ -31,6 +31,7 @@ class Main { testBooleanMethod(); testCharMethod(); testEnvironment(); + testNewStringObject(); } public static native void testFindClassOnAttachedNativeThread(); @@ -167,6 +168,8 @@ class Main { // throw new AssertionError("unexpected value for supported_abis"); // } } + + private static native void testNewStringObject(); } public class NativeBridgeMain { |