summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Xie <dxie@google.com>2015-12-21 22:35:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-12-21 22:35:45 +0000
commitd0ae2ffcb6246651504c36fec93f9c1fdcef0d4b (patch)
treeb7b5b1b45ca84eb806fd00ca9a99330a73305939
parent1c48ac828ee205a8bd8052a6f17adfb965790432 (diff)
parent161ab7af0434978ad3a9512293a032861a18e16e (diff)
downloadlibcore-d0ae2ffcb6246651504c36fec93f9c1fdcef0d4b.zip
libcore-d0ae2ffcb6246651504c36fec93f9c1fdcef0d4b.tar.gz
libcore-d0ae2ffcb6246651504c36fec93f9c1fdcef0d4b.tar.bz2
Merge "Change FinalizeTest to use helper function" into marshmallow-cts-dev
-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 ef303bd..d71b5b0 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);
}