Search in sources :

Example 6 with BoxedTestValue

use of com.oracle.truffle.llvm.test.interop.values.BoxedTestValue in project sulong by graalvm.

the class TypeCheckTest method data.

@Parameters(name = "{0}")
public static Collection<Object[]> data() {
    ArrayList<Object[]> tests = new ArrayList<>();
    tests.add(new Object[] { "boolean", true });
    tests.add(new Object[] { "byte", (byte) 5 });
    tests.add(new Object[] { "short", (short) 5 });
    tests.add(new Object[] { "int", 5 });
    tests.add(new Object[] { "boxedint", new BoxedTestValue(42) });
    tests.add(new Object[] { "long", 5L });
    tests.add(new Object[] { "big_long", Long.MAX_VALUE });
    tests.add(new Object[] { "float", 5.7f });
    tests.add(new Object[] { "small_float", Float.MIN_VALUE });
    tests.add(new Object[] { "big_float", Float.MAX_VALUE });
    tests.add(new Object[] { "double", 5.7 });
    tests.add(new Object[] { "small_double", Double.MIN_VALUE });
    tests.add(new Object[] { "big_double", Double.MAX_VALUE });
    tests.add(new Object[] { "string", "Hello, World!" });
    tests.add(new Object[] { "null", null });
    tests.add(new Object[] { "object", ProxyObject.fromMap(new HashMap<>()) });
    tests.add(new Object[] { "array", ProxyArray.fromArray() });
    tests.add(new Object[] { "executable", new ProxyExecutable() {

        @Override
        public Object execute(Value... arguments) {
            return null;
        }
    } });
    return tests;
}
Also used : ProxyExecutable(org.graalvm.polyglot.proxy.ProxyExecutable) BoxedTestValue(com.oracle.truffle.llvm.test.interop.values.BoxedTestValue) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Value(org.graalvm.polyglot.Value) BoxedTestValue(com.oracle.truffle.llvm.test.interop.values.BoxedTestValue) ProxyObject(org.graalvm.polyglot.proxy.ProxyObject) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

BoxedTestValue (com.oracle.truffle.llvm.test.interop.values.BoxedTestValue)6 Test (org.junit.Test)5 TruffleObject (com.oracle.truffle.api.interop.TruffleObject)3 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Value (org.graalvm.polyglot.Value)1 ProxyExecutable (org.graalvm.polyglot.proxy.ProxyExecutable)1 ProxyObject (org.graalvm.polyglot.proxy.ProxyObject)1 Parameters (org.junit.runners.Parameterized.Parameters)1