Search in sources :

Example 6 with UnionAssumption

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

the class UnionAssumptionTest method testIsValid.

@Test
public void testIsValid() {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    assertTrue(union.isValid());
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Example 7 with UnionAssumption

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

the class UnionAssumptionTest method testBothInvalidateCheck.

@Test(expected = InvalidAssumptionException.class)
public void testBothInvalidateCheck() throws InvalidAssumptionException {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    first.invalidate();
    second.invalidate();
    union.check();
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Example 8 with UnionAssumption

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

the class UnionAssumptionTest method testBothInvalidateIsValid.

@Test
public void testBothInvalidateIsValid() {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    first.invalidate();
    second.invalidate();
    assertFalse(union.isValid());
}
Also used : UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Assumption(com.oracle.truffle.api.Assumption) UnionAssumption(com.oracle.truffle.api.utilities.UnionAssumption) Test(org.junit.Test)

Aggregations

Assumption (com.oracle.truffle.api.Assumption)8 UnionAssumption (com.oracle.truffle.api.utilities.UnionAssumption)8 Test (org.junit.Test)8