# HG changeset patch # User Gilles Duboscq # Date 1378887711 -7200 # Node ID 5d6ff483a5e92ffb0c131a1010d7275ecca3d681 # Parent ccf047a30f18fb08f2d8d74edb602e041d94fef4 Strengthen and simplify ConditionTest diff -r ccf047a30f18 -r 5d6ff483a5e9 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java Fri Sep 13 13:02:40 2013 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java Wed Sep 11 10:21:51 2013 +0200 @@ -45,7 +45,7 @@ Constant b = Constant.forInt(i < 100 ? a.asInt() : rand.nextInt()); boolean result1 = c1.foldCondition(a, b, null, false); boolean result2 = c2.foldCondition(a, b, null, false); - if (result1 && implies) { + if (result1) { assertTrue(result2); } } @@ -60,7 +60,7 @@ for (Condition c1 : Condition.values()) { for (Condition c2 : Condition.values()) { Condition join = c1.join(c2); - assertTrue(join == c2.join(c1)); + assertEquals(join, c2.join(c1)); if (join != null) { for (int i = 0; i < 1000; i++) { Constant a = Constant.forInt(rand.nextInt()); @@ -70,6 +70,8 @@ boolean resultJoin = join.foldCondition(a, b, null, false); if (result1 && result2) { assertTrue(resultJoin); + } else { + assertFalse(resultJoin); } } } @@ -83,7 +85,7 @@ for (Condition c1 : Condition.values()) { for (Condition c2 : Condition.values()) { Condition meet = c1.meet(c2); - assertTrue(meet == c2.meet(c1)); + assertEquals(meet, c2.meet(c1)); if (meet != null) { for (int i = 0; i < 1000; i++) { Constant a = Constant.forInt(rand.nextInt()); @@ -93,6 +95,8 @@ boolean resultMeet = meet.foldCondition(a, b, null, false); if (result1 || result2) { assertTrue(resultMeet); + } else { + assertFalse(resultMeet); } } }