use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class BasicTest method testSetGet.
@Test
public void testSetGet() {
final DynamicObject object = LAYOUT.createBasicTest(14);
LAYOUT.setValue(object, 22);
Assert.assertEquals(22, LAYOUT.getValue(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class BuildArgumentsTest method testCreate.
@Test
public void testCreate() {
final DynamicObjectFactory factory = LAYOUT.createPrepareArgumentsShape(14);
final DynamicObject object = factory.newInstance(LAYOUT.build(1, 2));
Assert.assertEquals(14, LAYOUT.getShapeProperty(object));
Assert.assertEquals(1, LAYOUT.getA(object));
Assert.assertEquals(2, LAYOUT.getB(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class GuardsTest method testGuardDynamicObjectPositive.
@Test
public void testGuardDynamicObjectPositive() {
final DynamicObject object = LAYOUT.createGuardsTest();
Assert.assertTrue(LAYOUT.isGuardsTest(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class GuardsTest method testGuardObjectTypeNegative.
@Test
public void testGuardObjectTypeNegative() {
final DynamicObject object = NEGATIVE_LAYOUT.createGuardsTestNegative();
Assert.assertFalse(LAYOUT.isGuardsTest(object.getShape().getObjectType()));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class GuardsTest method testGuardDynamicObjectNegative.
@Test
public void testGuardDynamicObjectNegative() {
final DynamicObject object = NEGATIVE_LAYOUT.createGuardsTestNegative();
Assert.assertFalse(LAYOUT.isGuardsTest(object));
}
Aggregations