Search in sources :

Example 1 with CyclicAssumption

use of com.oracle.truffle.api.utilities.CyclicAssumption in project graal by oracle.

the class CyclicAssumptionTest method testInvalidate.

@Test
public void testInvalidate() {
    final CyclicAssumption cyclicAssumption = new CyclicAssumption("cyclic-assumption");
    final Assumption firstAssumption = cyclicAssumption.getAssumption();
    assertEquals("cyclic-assumption", firstAssumption.getName());
    assertTrue(firstAssumption.isValid());
    cyclicAssumption.invalidate();
    assertFalse(firstAssumption.isValid());
    final Assumption secondAssumption = cyclicAssumption.getAssumption();
    assertEquals("cyclic-assumption", secondAssumption.getName());
    assertTrue(secondAssumption.isValid());
    cyclicAssumption.invalidate();
    assertFalse(firstAssumption.isValid());
    assertFalse(secondAssumption.isValid());
}
Also used : CyclicAssumption(com.oracle.truffle.api.utilities.CyclicAssumption) Assumption(com.oracle.truffle.api.Assumption) CyclicAssumption(com.oracle.truffle.api.utilities.CyclicAssumption) Test(org.junit.Test)

Example 2 with CyclicAssumption

use of com.oracle.truffle.api.utilities.CyclicAssumption in project graal by oracle.

the class CyclicAssumptionTest method testIsValid.

@Test
public void testIsValid() {
    final CyclicAssumption assumption = new CyclicAssumption("cyclic-assumption");
    assertTrue(assumption.getAssumption().isValid());
}
Also used : CyclicAssumption(com.oracle.truffle.api.utilities.CyclicAssumption) Test(org.junit.Test)

Aggregations

CyclicAssumption (com.oracle.truffle.api.utilities.CyclicAssumption)2 Test (org.junit.Test)2 Assumption (com.oracle.truffle.api.Assumption)1