diff options
author | Andreas Gampe <agampe@google.com> | 2014-04-04 16:20:13 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-04-04 16:28:13 -0700 |
commit | ad61517890168ff6ed19063cc8032a9c033d135b (patch) | |
tree | 7bc9f0fa28eaedef854527c85cb15ff3d0afea8f /compiler/jni | |
parent | e8b4bbcef44f7fe76896850b2f5750cd46b1ade0 (diff) | |
download | art-ad61517890168ff6ed19063cc8032a9c033d135b.tar.gz art-ad61517890168ff6ed19063cc8032a9c033d135b.tar.bz2 art-ad61517890168ff6ed19063cc8032a9c033d135b.zip |
Fix wrong handling of Generic JNI not finding native method.
Code did not properly call JNIMethodEnd, such that locks etc
where not correctly handled.
Add a test case to jni_compiler_test.
Change-Id: If2d5c628517d65a56dd6bb5c4cabdff77c7664a1
Diffstat (limited to 'compiler/jni')
-rw-r--r-- | compiler/jni/jni_compiler_test.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc index 3204282e2..a0797f314 100644 --- a/compiler/jni/jni_compiler_test.cc +++ b/compiler/jni/jni_compiler_test.cc @@ -1268,4 +1268,14 @@ TEST_F(JniCompilerTest, MaxParamNumber) { env_->CallNonvirtualVoidMethodA(jobj_, jklass_, jmethod_, args); } +TEST_F(JniCompilerTest, WithoutImplementation) { + TEST_DISABLED_FOR_PORTABLE(); + SetUpForTest(false, "withoutImplementation", "()V", nullptr); + + env_->CallVoidMethod(jobj_, jmethod_); + + EXPECT_TRUE(Thread::Current()->IsExceptionPending()); + EXPECT_TRUE(env_->ExceptionCheck() == JNI_TRUE); +} + } // namespace art |