use of com.oracle.truffle.nfi.test.interop.NullObject in project graal by oracle.
the class NullArrayNFITest method testNullArray.
@Test
public void testNullArray(@Inject(NullArrayNode.class) CallTarget target) {
Object ret = target.call(new NullObject());
Assert.assertThat("return value", ret, is(instanceOf(TruffleObject.class)));
TruffleObject obj = (TruffleObject) ret;
Assert.assertTrue("isBoxed", isBoxed(obj));
Assert.assertEquals("return value", "null", unbox(obj));
}
use of com.oracle.truffle.nfi.test.interop.NullObject in project graal by oracle.
the class NullNFITest method testNullArg.
@Test
public void testNullArg(@Inject(TestNullArgNode.class) CallTarget callTarget) {
String expected = getExpected();
Object ret = callTarget.call(new NullObject());
Assert.assertThat("return value", ret, is(instanceOf(TruffleObject.class)));
TruffleObject obj = (TruffleObject) ret;
Assert.assertTrue("isBoxed", isBoxed(obj));
Assert.assertEquals("return value", expected, unbox(obj));
}
use of com.oracle.truffle.nfi.test.interop.NullObject in project graal by oracle.
the class NullNFITest method testNullCallbackRet.
@Test
public void testNullCallbackRet(@Inject(TestNullCallbackRetNode.class) CallTarget callTarget) {
String expected = getExpected();
TruffleObject nullCallback = new TestCallback(0, (args) -> {
return new NullObject();
});
Object ret = callTarget.call(nullCallback);
Assert.assertThat("return value", ret, is(instanceOf(TruffleObject.class)));
TruffleObject obj = (TruffleObject) ret;
Assert.assertTrue("isBoxed", isBoxed(obj));
Assert.assertEquals("return value", expected, unbox(obj));
}
Aggregations