use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class ShapePropertiesTest method testObjectTypeGetter.
@Test
public void testObjectTypeGetter() {
final DynamicObjectFactory factory = LAYOUT.createShapePropertiesTestShape(14);
final DynamicObject object = LAYOUT.createShapePropertiesTest(factory, 22);
Assert.assertEquals(14, LAYOUT.getShapeProperty(object.getShape().getObjectType()));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class ShapePropertiesTest method testFactorySetter.
@Test
public void testFactorySetter() {
final DynamicObjectFactory factory = LAYOUT.createShapePropertiesTestShape(14);
Assert.assertEquals(14, LAYOUT.getShapeProperty(factory));
final DynamicObject object = LAYOUT.createShapePropertiesTest(factory, 22);
Assert.assertEquals(14, LAYOUT.getShapeProperty(object));
final DynamicObjectFactory newFactory = LAYOUT.setShapeProperty(factory, 44);
Assert.assertEquals(44, LAYOUT.getShapeProperty(newFactory));
final DynamicObject newObject = LAYOUT.createShapePropertiesTest(newFactory, 22);
Assert.assertEquals(44, LAYOUT.getShapeProperty(newObject));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class TypesTest method testObject.
@Test
public void testObject() {
final DynamicObject object = create();
Assert.assertEquals(Runtime.getRuntime(), LAYOUT.getO(object));
LAYOUT.setO(object, Object.class);
Assert.assertEquals(Object.class, LAYOUT.getO(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class TypesTest method testInt.
@Test
public void testInt() {
final DynamicObject object = create();
Assert.assertEquals(3, LAYOUT.getI(object));
LAYOUT.setI(object, 30);
Assert.assertEquals(30, LAYOUT.getI(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class TypesTest method testIntArray.
@Test
public void testIntArray() {
final DynamicObject object = create();
Assert.assertArrayEquals(new int[] { 14 }, LAYOUT.getIa(object));
LAYOUT.setIa(object, new int[] { 22 });
Assert.assertArrayEquals(new int[] { 22 }, LAYOUT.getIa(object));
}
Aggregations