# HG changeset patch # User Doug Simon # Date 1367582658 -7200 # Node ID 63b4cea1ed3fce9cad4e3c1e7dd46c4c402fb7de # Parent 2777aafe689ba28854459777f1a72461ebc9557f suppressed output for expected AssertionError in WriteBarrierVerificationTest diff -r 2777aafe689b -r 63b4cea1ed3f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/WriteBarrierVerificationTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/WriteBarrierVerificationTest.java Thu May 02 21:28:13 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/WriteBarrierVerificationTest.java Fri May 03 14:04:18 2013 +0200 @@ -23,12 +23,14 @@ package com.oracle.graal.compiler.test; import java.util.*; +import java.util.concurrent.*; import org.junit.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.debug.*; +import com.oracle.graal.debug.internal.*; import com.oracle.graal.hotspot.phases.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.LocationNode.LocationIdentity; @@ -615,9 +617,10 @@ } private void test(final String snippet, final int expectedBarriers, final int... removedBarrierIndices) { - Debug.scope("WriteBarrierVerificationTest", new DebugDumpScope(snippet), new Runnable() { - public void run() { + AssertionError expectedError = Debug.scope("WriteBarrierVerificationTest", new DebugDumpScope(snippet), new Callable() { + + public AssertionError call() { final StructuredGraph graph = parse(snippet); HighTierContext highTierContext = new HighTierContext(runtime(), new Assumptions(false), replacements); MidTierContext midTierContext = new MidTierContext(runtime(), new Assumptions(false), replacements, runtime().getTarget(), OptimisticOptimizations.ALL); @@ -690,8 +693,10 @@ } }; + DebugConfig config = DebugScope.getConfig(); try { ReentrantNodeIterator.apply(closure, graph.start(), new State(), null); + Debug.setConfig(Debug.fixedConfig(false, false, false, false, config.dumpHandlers(), config.output())); new WriteBarrierVerificationPhase().apply(graph); } catch (AssertionError error) { /* @@ -699,10 +704,15 @@ * test. */ Assert.assertTrue(error.getMessage().equals("Write barrier must be present")); - throw new AssertionError(); + return error; + } finally { + Debug.setConfig(config); } - + return null; } }); + if (expectedError != null) { + throw expectedError; + } } }