From 848138b019f9dcb61cde99303983c32aa147580e Mon Sep 17 00:00:00 2001 From: Tomas Stupka <tomas.stupka@oracle.com> Date: Tue, 3 Jul 2018 15:59:24 +0200 Subject: [PATCH] minor fix in java interop tests --- .../truffle/r/test/ExpectedTestOutput.test | 72 +++++++++++++++++++ .../r/test/library/fastr/TestJavaInterop.java | 4 +- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index 1002a5c992..b6eaccf56c 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -152082,10 +152082,34 @@ com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.complex(to$fieldBooleanArray), 'complex')); } com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.complex(to$fieldDoubleArray), 'complex')); } +com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.complex(to$fieldIntegerArray), 'complex')); } +com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.complex(to$fieldStringArray), 'complex')); } +com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldBooleanArray), 'complex')); } com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldDoubleArray), 'complex')); } +com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldIntegerArray), 'complex')); } +com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldStringArray), 'complex')); } +com.oracle.truffle.r.runtime.data.closures.RToComplexVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.double(as.vector(to$fieldBooleanArray))); } com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure @@ -152102,10 +152126,26 @@ com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.double(to$fieldBooleanArray), 'double')); } com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.double(to$fieldIntegerArray), 'double')); } +com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.double(to$fieldStringArray), 'double')); } +com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldBooleanArray), 'double')); } com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldIntegerArray), 'double')); } +com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldStringArray), 'double')); } +com.oracle.truffle.r.runtime.data.closures.RToDoubleVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.integer(as.vector(to$fieldBooleanArray))); } com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure @@ -152122,10 +152162,26 @@ com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.integer(to$fieldBooleanArray), 'integer')); } com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.integer(to$fieldDoubleArray), 'integer')); } +com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.integer(to$fieldStringArray), 'integer')); } +com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldBooleanArray), 'integer')); } com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldDoubleArray), 'integer')); } +com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldStringArray), 'integer')); } +com.oracle.truffle.r.runtime.data.closures.RToIntVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.character(as.vector(to$fieldBooleanArray))); } com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure @@ -152142,10 +152198,26 @@ com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.character(to$fieldBooleanArray), 'character')); } com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.character(to$fieldDoubleArray), 'character')); } +com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.character(to$fieldIntegerArray), 'character')); } +com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# #if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldBooleanArray), 'character')); } com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldDoubleArray), 'character')); } +com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNoCopyOncast# +#if (!any(R.version$engine == "FastR")) { cat('com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure<<<NEWLINE>>>') } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));.fastr.inspect(as.vector(as.vector(to$fieldIntegerArray), 'character')); } +com.oracle.truffle.r.runtime.data.closures.RToStringVectorClosure + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNonPrimitiveParameter# #if (!any(R.version$engine == "FastR")) { TRUE } else { to <- .fastr.interop.new(java.type('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$equals(to) } [1] TRUE diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java index 81ecae1ebc..e3a3625125 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java @@ -1083,9 +1083,9 @@ public class TestJavaInterop extends TestBase { } assertEvalFastR(CREATE_TRUFFLE_OBJECT + ".fastr.inspect(as." + type + "(as.vector(to$" + field + ")));", "cat('com.oracle.truffle.r.runtime.data.closures." + closure + "\n')"); assertEvalFastR(CREATE_TRUFFLE_OBJECT + - ".fastr.inspect(as.vector(as.vector(to$fieldBooleanArray), '" + type + "'));", "cat('com.oracle.truffle.r.runtime.data.closures." + closure + "\n')"); + ".fastr.inspect(as.vector(as.vector(to$" + field + "), '" + type + "'));", "cat('com.oracle.truffle.r.runtime.data.closures." + closure + "\n')"); assertEvalFastR(CREATE_TRUFFLE_OBJECT + - ".fastr.inspect(as.vector(as." + type + "(to$fieldBooleanArray), '" + type + "'));", "cat('com.oracle.truffle.r.runtime.data.closures." + closure + "\n')"); + ".fastr.inspect(as.vector(as." + type + "(to$" + field + "), '" + type + "'));", "cat('com.oracle.truffle.r.runtime.data.closures." + closure + "\n')"); } } -- GitLab