summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Xie <dxie@google.com>2015-12-21 22:46:55 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-12-21 22:46:55 +0000
commit762c0d8cc3761d0f91063d6f7e2512de06f83f63 (patch)
tree44877bd09b6d2e2e05e4378d1d657c2fdeaa4cee
parent45db0660a02f7cd613495b497ab3bac0bc28e5ba (diff)
parent1e6284ec29aff9eb30ef00eedea2f786ac95b9ca (diff)
downloadlibcore-762c0d8cc3761d0f91063d6f7e2512de06f83f63.zip
libcore-762c0d8cc3761d0f91063d6f7e2512de06f83f63.tar.gz
libcore-762c0d8cc3761d0f91063d6f7e2512de06f83f63.tar.bz2
Merge "Change FinalizeTest to use helper function" into marshmallow-cts-dev am: d0ae2ffcb6
am: 1e6284ec29 * commit '1e6284ec29aff9eb30ef00eedea2f786ac95b9ca': 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 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);
}