From 36db704ef153c6c617e936146c303e704033969f Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Date: Thu, 19 Apr 2018 13:44:16 -0400
Subject: [PATCH] test: added unit test demonstrating inability to return
 instantiated array immediately.

---
 .../ReturnInstantiatedArrayDirectlyTest.java  | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 src/test/java/com/aparapi/runtime/ReturnInstantiatedArrayDirectlyTest.java

diff --git a/src/test/java/com/aparapi/runtime/ReturnInstantiatedArrayDirectlyTest.java b/src/test/java/com/aparapi/runtime/ReturnInstantiatedArrayDirectlyTest.java
new file mode 100644
index 00000000..c880f799
--- /dev/null
+++ b/src/test/java/com/aparapi/runtime/ReturnInstantiatedArrayDirectlyTest.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2016 - 2017 Syncleus, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.aparapi.runtime;
+
+import com.aparapi.Kernel;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Arrays;
+
+import static org.junit.Assert.assertArrayEquals;
+
+
+public class ReturnInstantiatedArrayDirectlyTest {
+    @Test
+    @Ignore("Knon bug, ignoring until fixed.")
+    public void test() {
+        ReturnDoubleArrayNew kernel = new ReturnDoubleArrayNew();
+        kernel.execute(1);
+    }
+
+    public class ReturnDoubleArrayNew extends Kernel {
+
+        double[] returnDoubleArrayNew() {
+            return new double[1024];
+        }
+
+        public void run() {
+            returnDoubleArrayNew();
+        }
+    }
+}
-- 
GitLab