Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/utilities/CountingConditionProfileTest.java @ 16910:c9437b07c26a
Truffle: changed return types of condition profile factory methods.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Sat, 23 Aug 2014 19:31:22 +0200 |
parents | fa5e62620593 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/utilities/CountingConditionProfileTest.java Sat Aug 23 19:31:18 2014 +0200 +++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/utilities/CountingConditionProfileTest.java Sat Aug 23 19:31:22 2014 +0200 @@ -36,16 +36,21 @@ @DataPoints public static boolean[] data = new boolean[]{true, false}; + private CountingConditionProfile profile; + + @Before + public void create() { + profile = (CountingConditionProfile) ConditionProfile.createCountingProfile(); + } + @Test public void testInitial() { - CountingConditionProfile profile = ConditionProfile.createCountingProfile(); assertThat(profile.getTrueCount(), is(0)); assertThat(profile.getFalseCount(), is(0)); } @Theory public void testProfileOne(boolean value) { - CountingConditionProfile profile = ConditionProfile.createCountingProfile(); boolean result = profile.profile(value); assertThat(result, is(value)); @@ -55,7 +60,6 @@ @Theory public void testProfileTwo(boolean value0, boolean value1) { - CountingConditionProfile profile = ConditionProfile.createCountingProfile(); boolean result0 = profile.profile(value0); boolean result1 = profile.profile(value1); @@ -67,7 +71,6 @@ @Theory public void testProfileThree(boolean value0, boolean value1, boolean value2) { - CountingConditionProfile profile = ConditionProfile.createCountingProfile(); boolean result0 = profile.profile(value0); boolean result1 = profile.profile(value1); boolean result2 = profile.profile(value2);