use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritedShapePropertiesTest method testTop.
@Test
public void testTop() {
final DynamicObjectFactory factory = TOP_LAYOUT.createInheritedShapeTopShape(14, 2);
final DynamicObject object = TOP_LAYOUT.createInheritedShapeTop(factory);
Assert.assertEquals(14, TOP_LAYOUT.getA(object));
Assert.assertEquals(2, TOP_LAYOUT.getB(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritedShapePropertiesTest method testBase.
@Test
public void testBase() {
final DynamicObjectFactory factory = BASE_LAYOUT.createInheritedShapeBaseShape(14);
final DynamicObject object = BASE_LAYOUT.createInheritedShapeBase(factory);
Assert.assertEquals(14, BASE_LAYOUT.getA(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class NullabilityTest method testCreateAlllowedNull.
@Test
public void testCreateAlllowedNull() {
final DynamicObject object = LAYOUT.createNullabilityTest("foo", null);
Assert.assertNotNull(object);
Assert.assertEquals("foo", LAYOUT.getNotNullable(object));
Assert.assertNull(LAYOUT.getNullable(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class NullabilityTest method testCreateNonNull.
@Test
public void testCreateNonNull() {
final DynamicObject object = LAYOUT.createNullabilityTest("foo", "bar");
Assert.assertNotNull(object);
Assert.assertEquals("foo", LAYOUT.getNotNullable(object));
Assert.assertEquals("bar", LAYOUT.getNullable(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class NullabilityTest method testSetNullableToNull.
@Test
public void testSetNullableToNull() {
final DynamicObject object = LAYOUT.createNullabilityTest("foo", "bar");
Assert.assertNotNull(object);
Assert.assertEquals("bar", LAYOUT.getNullable(object));
LAYOUT.setNullable(object, null);
Assert.assertNull(LAYOUT.getNullable(object));
}
Aggregations