use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class GuardsTest method testGuardObjectTypePositive.
@Test
public void testGuardObjectTypePositive() {
final DynamicObject object = LAYOUT.createGuardsTest();
Assert.assertTrue(LAYOUT.isGuardsTest(object.getShape().getObjectType()));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class IdentifierTest method testSet.
@Test
public void testSet() {
final DynamicObject object = LAYOUT.createIdentifierTest(1, 2);
Assert.assertEquals(1, object.get(IdentifierTestLayout.A_IDENTIFIER));
object.set(IdentifierTestLayout.A_IDENTIFIER, 11);
Assert.assertEquals(11, object.get(IdentifierTestLayout.A_IDENTIFIER));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class ImplicitCastTest method testCantAssignIntToLong.
@Test(expected = IncompatibleLocationException.class)
public void testCantAssignIntToLong() throws IncompatibleLocationException, FinalLocationException {
final DynamicObject object = NO_CAST_LAYOUT.createNoCast(14, 14.2);
object.getShape().getProperty(NoCastLayout.LONG_VALUE_IDENTIFIER).set(object, 14, object.getShape());
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritanceTest method testTopGuardsOnMiddle.
@Test
public void testTopGuardsOnMiddle() {
final DynamicObject object = MIDDLE_LAYOUT.createMiddle(14, "foo");
Assert.assertFalse(TOP_LAYOUT.isTop(object));
Assert.assertFalse(TOP_LAYOUT.isTop((Object) object));
Assert.assertFalse(TOP_LAYOUT.isTop(object.getShape().getObjectType()));
Assert.assertFalse(TOP_LAYOUT.isTop(object));
Assert.assertFalse(TOP_LAYOUT.isTop((Object) object));
Assert.assertFalse(TOP_LAYOUT.isTop(object.getShape().getObjectType()));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritanceTest method testBaseGuardsOnBase.
@Test
public void testBaseGuardsOnBase() {
final DynamicObject object = BASE_LAYOUT.createBase(14);
Assert.assertTrue(BASE_LAYOUT.isBase(object));
Assert.assertTrue(BASE_LAYOUT.isBase((Object) object));
Assert.assertTrue(BASE_LAYOUT.isBase(object.getShape().getObjectType()));
Assert.assertTrue(BASE_LAYOUT.isBase(object));
Assert.assertTrue(BASE_LAYOUT.isBase((Object) object));
Assert.assertTrue(BASE_LAYOUT.isBase(object.getShape().getObjectType()));
}
Aggregations