From ce67167dc48c9a800fd402206d94740b35c134fb Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Date: Thu, 19 Apr 2018 00:28:59 -0400
Subject: [PATCH] test: renamed tests with issue in the name to be descriptive.
 Ignored failing tests,

---
 ...ssue102Test.java => AccessGetterSetterTest.java} |  2 +-
 ...pportAdvTest.java => AtomicsSupportAdvTest.java} |  2 +-
 ...micsSupportTest.java => AtomicsSupportTest.java} |  2 +-
 ...rierSupportTest.java => BarrierSupportTest.java} |  2 +-
 ...t.java => FastNumberTheoreticTransformTest.java} |  6 +++---
 ...t.java => KernelManagerPreferredDeviceTest.java} |  2 +-
 ...alArrayArgsTest.java => LocalArrayArgsTest.java} |  2 +-
 .../{Test12x4_4x2.java => Matrix12x4_4x2Test.java}  |  2 +-
 ...ava => MultiplePassesMemoryConsumptionTest.java} | 13 ++++++++-----
 ...rrayTest.java => StaticArrayAssignmentTest.java} |  7 +++----
 .../runtime/StaticVariableAssignmentTest.java       |  2 +-
 11 files changed, 22 insertions(+), 20 deletions(-)
 rename src/test/java/com/aparapi/runtime/{Issue102Test.java => AccessGetterSetterTest.java} (98%)
 rename src/test/java/com/aparapi/runtime/{Issue81AtomicsSupportAdvTest.java => AtomicsSupportAdvTest.java} (99%)
 rename src/test/java/com/aparapi/runtime/{Issue81AtomicsSupportTest.java => AtomicsSupportTest.java} (99%)
 rename src/test/java/com/aparapi/runtime/{Issue84BarrierSupportTest.java => BarrierSupportTest.java} (99%)
 rename src/test/java/com/aparapi/runtime/{Issue68Test.java => FastNumberTheoreticTransformTest.java} (97%)
 rename src/test/java/com/aparapi/runtime/{Issue55Test.java => KernelManagerPreferredDeviceTest.java} (97%)
 rename src/test/java/com/aparapi/runtime/{Issue79LocalArrayArgsTest.java => LocalArrayArgsTest.java} (98%)
 rename src/test/java/com/aparapi/runtime/{Test12x4_4x2.java => Matrix12x4_4x2Test.java} (99%)
 rename src/test/java/com/aparapi/runtime/{Issue69Test.java => MultiplePassesMemoryConsumptionTest.java} (75%)
 rename src/test/java/com/aparapi/runtime/{UseStaticArrayTest.java => StaticArrayAssignmentTest.java} (91%)

diff --git a/src/test/java/com/aparapi/runtime/Issue102Test.java b/src/test/java/com/aparapi/runtime/AccessGetterSetterTest.java
similarity index 98%
rename from src/test/java/com/aparapi/runtime/Issue102Test.java
rename to src/test/java/com/aparapi/runtime/AccessGetterSetterTest.java
index b3892d93..9c7c1d6b 100644
--- a/src/test/java/com/aparapi/runtime/Issue102Test.java
+++ b/src/test/java/com/aparapi/runtime/AccessGetterSetterTest.java
@@ -21,7 +21,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertTrue;
 
 
-public class Issue102Test {
+public class AccessGetterSetterTest {
 
     @Test
     public void test() {
diff --git a/src/test/java/com/aparapi/runtime/Issue81AtomicsSupportAdvTest.java b/src/test/java/com/aparapi/runtime/AtomicsSupportAdvTest.java
similarity index 99%
rename from src/test/java/com/aparapi/runtime/Issue81AtomicsSupportAdvTest.java
rename to src/test/java/com/aparapi/runtime/AtomicsSupportAdvTest.java
index 81d5a02d..09ab4af6 100644
--- a/src/test/java/com/aparapi/runtime/Issue81AtomicsSupportAdvTest.java
+++ b/src/test/java/com/aparapi/runtime/AtomicsSupportAdvTest.java
@@ -39,7 +39,7 @@ import com.aparapi.internal.kernel.KernelManager;
  * Advanced tests for validation of the correctness of the atomics implementation both on Java and on OpenCL.
  * @author CodeRasurae
  */
-public class Issue81AtomicsSupportAdvTest {
+public class AtomicsSupportAdvTest {
 
     private static OpenCLDevice openCLDevice = null;
 
diff --git a/src/test/java/com/aparapi/runtime/Issue81AtomicsSupportTest.java b/src/test/java/com/aparapi/runtime/AtomicsSupportTest.java
similarity index 99%
rename from src/test/java/com/aparapi/runtime/Issue81AtomicsSupportTest.java
rename to src/test/java/com/aparapi/runtime/AtomicsSupportTest.java
index c1b6e3e1..2a8e7722 100644
--- a/src/test/java/com/aparapi/runtime/Issue81AtomicsSupportTest.java
+++ b/src/test/java/com/aparapi/runtime/AtomicsSupportTest.java
@@ -38,7 +38,7 @@ import com.aparapi.internal.kernel.KernelManager;
  * Base tests for validation of the correctness of the atomics function computations, both on Java and on OpenCL.
  * @author CodeRasurae
  */
-public class Issue81AtomicsSupportTest {
+public class AtomicsSupportTest {
 
     private static OpenCLDevice openCLDevice = null;
 
diff --git a/src/test/java/com/aparapi/runtime/Issue84BarrierSupportTest.java b/src/test/java/com/aparapi/runtime/BarrierSupportTest.java
similarity index 99%
rename from src/test/java/com/aparapi/runtime/Issue84BarrierSupportTest.java
rename to src/test/java/com/aparapi/runtime/BarrierSupportTest.java
index a2b2c8e8..f32468b4 100644
--- a/src/test/java/com/aparapi/runtime/Issue84BarrierSupportTest.java
+++ b/src/test/java/com/aparapi/runtime/BarrierSupportTest.java
@@ -32,7 +32,7 @@ import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
 
-public class Issue84BarrierSupportTest {
+public class BarrierSupportTest {
     private static OpenCLDevice openCLDevice = null;
     private static int SIZE;
     private int[] targetArray;
diff --git a/src/test/java/com/aparapi/runtime/Issue68Test.java b/src/test/java/com/aparapi/runtime/FastNumberTheoreticTransformTest.java
similarity index 97%
rename from src/test/java/com/aparapi/runtime/Issue68Test.java
rename to src/test/java/com/aparapi/runtime/FastNumberTheoreticTransformTest.java
index fbc9e0dc..738d5756 100644
--- a/src/test/java/com/aparapi/runtime/Issue68Test.java
+++ b/src/test/java/com/aparapi/runtime/FastNumberTheoreticTransformTest.java
@@ -19,14 +19,14 @@ import com.aparapi.Kernel;
 import org.junit.Ignore;
 import org.junit.Test;
 
-public class Issue68Test {
-    @Ignore("Ported over but not working yet")
+public class FastNumberTheoreticTransformTest {
+    @Ignore("No solution found yet")
     @Test
     public void test() {
         final int SQRT_LENGTH = 1024;
         final int LENGTH = SQRT_LENGTH * SQRT_LENGTH;
         final ArrayAccess arrayAccess = new IntMemoryArrayAccess(new int[LENGTH], 0, LENGTH);
-        new Issue68Test().transformColumns(SQRT_LENGTH, SQRT_LENGTH, false, arrayAccess, new int[SQRT_LENGTH], null);
+        new FastNumberTheoreticTransformTest().transformColumns(SQRT_LENGTH, SQRT_LENGTH, false, arrayAccess, new int[SQRT_LENGTH], null);
     }
 
     private void transformColumns(final int length, final int count, final boolean isInverse, final ArrayAccess arrayAccess,
diff --git a/src/test/java/com/aparapi/runtime/Issue55Test.java b/src/test/java/com/aparapi/runtime/KernelManagerPreferredDeviceTest.java
similarity index 97%
rename from src/test/java/com/aparapi/runtime/Issue55Test.java
rename to src/test/java/com/aparapi/runtime/KernelManagerPreferredDeviceTest.java
index c2e9a268..096c6948 100644
--- a/src/test/java/com/aparapi/runtime/Issue55Test.java
+++ b/src/test/java/com/aparapi/runtime/KernelManagerPreferredDeviceTest.java
@@ -28,7 +28,7 @@ import com.aparapi.device.Device;
 import com.aparapi.internal.kernel.KernelManager;
 import com.aparapi.internal.kernel.KernelManagers;
 
-public class Issue55Test {
+public class KernelManagerPreferredDeviceTest {
 	private Kernel testKernel;
 
 	@Before
diff --git a/src/test/java/com/aparapi/runtime/Issue79LocalArrayArgsTest.java b/src/test/java/com/aparapi/runtime/LocalArrayArgsTest.java
similarity index 98%
rename from src/test/java/com/aparapi/runtime/Issue79LocalArrayArgsTest.java
rename to src/test/java/com/aparapi/runtime/LocalArrayArgsTest.java
index 2d13b5c7..aba45b9e 100644
--- a/src/test/java/com/aparapi/runtime/Issue79LocalArrayArgsTest.java
+++ b/src/test/java/com/aparapi/runtime/LocalArrayArgsTest.java
@@ -27,7 +27,7 @@ import static org.junit.Assume.*;
 import org.junit.Before;
 import org.junit.Test;
 
-public class Issue79LocalArrayArgsTest {
+public class LocalArrayArgsTest {
     private static OpenCLDevice openCLDevice = null;
     private static final int SIZE = 32;
     private int[] targetArray;
diff --git a/src/test/java/com/aparapi/runtime/Test12x4_4x2.java b/src/test/java/com/aparapi/runtime/Matrix12x4_4x2Test.java
similarity index 99%
rename from src/test/java/com/aparapi/runtime/Test12x4_4x2.java
rename to src/test/java/com/aparapi/runtime/Matrix12x4_4x2Test.java
index a1a72032..e41882c5 100644
--- a/src/test/java/com/aparapi/runtime/Test12x4_4x2.java
+++ b/src/test/java/com/aparapi/runtime/Matrix12x4_4x2Test.java
@@ -20,7 +20,7 @@ import com.aparapi.Range;
 import com.aparapi.device.Device;
 import org.junit.Test;
 
-public class Test12x4_4x2 {
+public class Matrix12x4_4x2Test {
     @SuppressWarnings("deprecation")
     @Test
     public void test() {
diff --git a/src/test/java/com/aparapi/runtime/Issue69Test.java b/src/test/java/com/aparapi/runtime/MultiplePassesMemoryConsumptionTest.java
similarity index 75%
rename from src/test/java/com/aparapi/runtime/Issue69Test.java
rename to src/test/java/com/aparapi/runtime/MultiplePassesMemoryConsumptionTest.java
index d33243cb..aaa84cd9 100644
--- a/src/test/java/com/aparapi/runtime/Issue69Test.java
+++ b/src/test/java/com/aparapi/runtime/MultiplePassesMemoryConsumptionTest.java
@@ -20,7 +20,7 @@ import com.aparapi.Range;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class Issue69Test {
+public class MultiplePassesMemoryConsumptionTest {
 
     @Test
     public void test() {
@@ -31,22 +31,25 @@ public class Issue69Test {
                 globalArray[getGlobalId()] = getGlobalId();
             }
         };
+        long baseFree = Runtime.getRuntime().freeMemory();
         for (int loop = 0; loop < 100; loop++) {
-
-            System.out.printf("%3d free = %10d\n", loop, Runtime.getRuntime().freeMemory());
+            if( baseFree > Runtime.getRuntime().freeMemory())
+                baseFree = Runtime.getRuntime().freeMemory();
             kernel.execute(Range.create(512, 64), 1);
             for (int i = 0; i < globalArray.length; ++i) {
                 Assert.assertEquals("Wrong", i, globalArray[i]);
             }
         }
+        long testFree = Runtime.getRuntime().freeMemory();
         for (int loop = 0; loop < 100; loop++) {
-
-            System.out.printf("%3d free = %10d\n", loop, Runtime.getRuntime().freeMemory());
+            if( testFree > Runtime.getRuntime().freeMemory())
+                testFree = Runtime.getRuntime().freeMemory();
             kernel.execute(Range.create(512, 64), 2);
             for (int i = 0; i < globalArray.length; ++i) {
                 Assert.assertEquals("Wrong", i, globalArray[i]);
             }
         }
+        Assert.assertTrue("Too much memory consumed", (baseFree - testFree) < 1000);
     }
 
 }
diff --git a/src/test/java/com/aparapi/runtime/UseStaticArrayTest.java b/src/test/java/com/aparapi/runtime/StaticArrayAssignmentTest.java
similarity index 91%
rename from src/test/java/com/aparapi/runtime/UseStaticArrayTest.java
rename to src/test/java/com/aparapi/runtime/StaticArrayAssignmentTest.java
index 44e2a822..887a13b9 100644
--- a/src/test/java/com/aparapi/runtime/UseStaticArrayTest.java
+++ b/src/test/java/com/aparapi/runtime/StaticArrayAssignmentTest.java
@@ -17,13 +17,15 @@ package com.aparapi.runtime;
 
 import com.aparapi.Kernel;
 import com.aparapi.device.Device;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertTrue;
 
-public class UseStaticArrayTest {
+public class StaticArrayAssignmentTest {
     @Test
+    @Ignore("Solution not implemented yet, will pass on cpu but not gpu")
     public void test() {
         UseStaticArrayKernel k = new UseStaticArrayKernel();
         k.test();
@@ -54,9 +56,6 @@ public class UseStaticArrayTest {
             execute(size);
 
             assertArrayEquals("results == fooBar", results, values);
-//      for (int i = 0; i < size; i++) {
-//         assertTrue("results == fooBar", results[i] == values[i]);
-//      }
         }
     }
 }
diff --git a/src/test/java/com/aparapi/runtime/StaticVariableAssignmentTest.java b/src/test/java/com/aparapi/runtime/StaticVariableAssignmentTest.java
index f9e27b2c..2eec2c87 100644
--- a/src/test/java/com/aparapi/runtime/StaticVariableAssignmentTest.java
+++ b/src/test/java/com/aparapi/runtime/StaticVariableAssignmentTest.java
@@ -24,7 +24,7 @@ import static org.junit.Assert.assertArrayEquals;
 
 public class StaticVariableAssignmentTest {
     @Test
-    @Ignore
+    @Ignore("Solution not implemented yet, will pass on cpu but not gpu")
     public void test() {
         Issue103Kernel b = new Issue103Kernel();
         b.test();
-- 
GitLab