Search in sources :

Example 1 with UnionAssumption

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

the class UnionAssumptionTest method testCheck.

@Test
public void testCheck() throws InvalidAssumptionException {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    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 2 with UnionAssumption

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

the class UnionAssumptionTest method testFirstInvalidateIsValid.

@Test
public void testFirstInvalidateIsValid() {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    first.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)

Example 3 with UnionAssumption

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

the class UnionAssumptionTest method testSecondInvalidateCheck.

@Test(expected = InvalidAssumptionException.class)
public void testSecondInvalidateCheck() throws InvalidAssumptionException {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    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 4 with UnionAssumption

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

the class UnionAssumptionTest method testFirstInvalidateCheck.

@Test(expected = InvalidAssumptionException.class)
public void testFirstInvalidateCheck() 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();
    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 5 with UnionAssumption

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

the class UnionAssumptionTest method testSecondInvalidateIsValid.

@Test
public void testSecondInvalidateIsValid() {
    final Assumption first = Truffle.getRuntime().createAssumption("first");
    final Assumption second = Truffle.getRuntime().createAssumption("second");
    final UnionAssumption union = new UnionAssumption(first, second);
    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