summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Xie <dxie@google.com>2015-12-21 14:49:20 -0800
committerandroid-build-merger <android-build-merger@google.com>2015-12-21 14:49:20 -0800
commitc547ad05a040b638ef7d72acf118217d573e9d71 (patch)
tree44877bd09b6d2e2e05e4378d1d657c2fdeaa4cee
parent328aec5f379bde6e57adf788c949fd7935cab9e9 (diff)
parent762c0d8cc3761d0f91063d6f7e2512de06f83f63 (diff)
downloadlibcore-c547ad05a040b638ef7d72acf118217d573e9d71.zip
libcore-c547ad05a040b638ef7d72acf118217d573e9d71.tar.gz
libcore-c547ad05a040b638ef7d72acf118217d573e9d71.tar.bz2
Merge "Change FinalizeTest to use helper function" into marshmallow-cts-dev am: d0ae2ffcb6 am: 1e6284ec29
am: 762c0d8cc3 * commit '762c0d8cc3761d0f91063d6f7e2512de06f83f63': 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);
}