diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java index a92d2dfdbb3725ee7826f1d2b6e71accee2a04e9..45008be104c4d2adfb65bbbe0a174ed2fd1fb3f4 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java @@ -22,25 +22,24 @@ */ package com.oracle.truffle.r.test.engine.interop; -import com.oracle.truffle.api.interop.ForeignAccess; -import com.oracle.truffle.api.interop.InteropException; -import com.oracle.truffle.api.interop.Message; -import com.oracle.truffle.api.interop.TruffleObject; -import com.oracle.truffle.api.interop.UnsupportedMessageException; -import com.oracle.truffle.api.vm.PolyglotEngine; -import com.oracle.truffle.r.ffi.impl.interop.NativePointer; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.util.HashSet; import java.util.Set; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import org.junit.Test; +import com.oracle.truffle.api.interop.ForeignAccess; +import com.oracle.truffle.api.interop.InteropException; +import com.oracle.truffle.api.interop.Message; +import com.oracle.truffle.api.interop.TruffleObject; +import com.oracle.truffle.api.interop.UnsupportedMessageException; +import com.oracle.truffle.api.vm.PolyglotEngine; + public abstract class AbstractMRTest { protected static PolyglotEngine engine; @@ -117,7 +116,7 @@ public abstract class AbstractMRTest { @Test public void testIsPointer() throws Exception { for (TruffleObject obj : createTruffleObjects()) { - assertEquals(isPointer(obj), ForeignAccess.sendIsPointer(Message.IS_POINTER.createNode(), obj)); + assertEquals(obj.getClass().getSimpleName(), isPointer(obj), ForeignAccess.sendIsPointer(Message.IS_POINTER.createNode(), obj)); } } @@ -125,7 +124,7 @@ public abstract class AbstractMRTest { public void testNativePointer() throws Exception { for (TruffleObject obj : createTruffleObjects()) { try { - assertTrue(ForeignAccess.sendToNative(Message.TO_NATIVE.createNode(), obj) instanceof NativePointer); + assertTrue(obj.getClass().getSimpleName(), ForeignAccess.sendToNative(Message.TO_NATIVE.createNode(), obj) == obj); } catch (UnsupportedMessageException unsupportedMessageException) { } } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/ListMRTest.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/ListMRTest.java index d9c4aaa65ebeb5006ccd3d64187b81b4788ae5f8..2105850c641c044dc97d6b264dc5808f2aa54772 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/ListMRTest.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/ListMRTest.java @@ -38,7 +38,6 @@ import com.oracle.truffle.api.interop.UnsupportedTypeException; import com.oracle.truffle.api.interop.java.JavaInterop; import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.vm.PolyglotEngine; -import com.oracle.truffle.r.ffi.impl.interop.NativePointer; import com.oracle.truffle.r.runtime.data.RList; import com.oracle.truffle.r.runtime.data.RNull; import com.oracle.truffle.r.runtime.data.RPairList; @@ -51,8 +50,9 @@ public class ListMRTest extends AbstractMRTest { @Override @Test public void testNativePointer() throws UnsupportedMessageException, UnknownIdentifierException, UnsupportedTypeException { - assertTrue(ForeignAccess.sendToNative(Message.TO_NATIVE.createNode(), create("list", testValues)) instanceof NativePointer); - assertTrue(ForeignAccess.sendToNative(Message.TO_NATIVE.createNode(), create("pairlist", testValues)) instanceof NativePointer); + for (TruffleObject obj : new TruffleObject[]{create("list", testValues), create("pairlist", testValues)}) { + assertTrue(ForeignAccess.sendToNative(Message.TO_NATIVE.createNode(), obj) == obj); + } } @Test