summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Xie <dxie@google.com>2015-12-21 22:44:53 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-12-21 22:44:53 +0000
commit1e6284ec29aff9eb30ef00eedea2f786ac95b9ca (patch)
tree44877bd09b6d2e2e05e4378d1d657c2fdeaa4cee
parent14fdf89b34cb0b41d9c1094724856a82b59953ba (diff)
parentd0ae2ffcb6246651504c36fec93f9c1fdcef0d4b (diff)
downloadlibcore-1e6284ec29aff9eb30ef00eedea2f786ac95b9ca.tar.gz
libcore-1e6284ec29aff9eb30ef00eedea2f786ac95b9ca.tar.bz2
libcore-1e6284ec29aff9eb30ef00eedea2f786ac95b9ca.zip
Merge "Change FinalizeTest to use helper function" into marshmallow-cts-dev
am: d0ae2ffcb6 * commit 'd0ae2ffcb6246651504c36fec93f9c1fdcef0d4b': Change FinalizeTest to use helper function
-rw-r--r--luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java b/luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java
index ef303bda8..d71b5b045 100644
--- a/luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java
+++ b/luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java
@@ -69,13 +69,18 @@ public final class FinalizeTest extends TestCase {
static class X {}
- // http://b/issue?id=2136462
- public void testBackFromTheDead() throws Exception {
+ // Helper function since we do not want a vreg to keep the allocated object live.
+ // For b/25851249
+ private void exceptionInConstructor() {
try {
new ConstructionFails();
} catch (AssertionError expected) {
}
+ }
+ // http://b/issue?id=2136462
+ public void testBackFromTheDead() throws Exception {
+ exceptionInConstructor();
FinalizationTester.induceFinalization();
assertTrue("object whose constructor threw was not finalized", ConstructionFails.finalized);
}