test: fixed test so it checks for exceptions. Ignoring as it is known to fail.
@@ -18,12 +18,11 @@ package com.aparapi.runtime;
import com.aparapi.Kernel;
import com.aparapi.Range;
import com.aparapi.device.Device;
+import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
public class Matrix12x4_4x2Test {
- @SuppressWarnings("deprecation")
- @Test
- public void test() {
// globalThreadId, threadId, globalX, globalY, localX, localY
final int[][] test = new int[][]{
{
@@ -461,7 +460,20 @@ public class Matrix12x4_4x2Test {
//localY
},
};
- Kernel kernel = new Kernel() {
+
+ @Ignore("Known bug, ignoring until fixed.")
+ @Test
+ public void test() {
+ MatrixKernel kernel = new MatrixKernel();
+ kernel.execute(Range.create2D(12, 4, 4, 2));
+ for(boolean hasPassed : kernel.passed) {
+ Assert.assertTrue("Resulting matrix was invalid", hasPassed);
+ }
+
+ }
+
+ private class MatrixKernel extends Kernel {
+ public boolean passed[] = new boolean[test.length];
@Override
public boolean isAllowDevice(Device _device) {
@@ -505,17 +517,15 @@ public class Matrix12x4_4x2Test {
show = true;
}
if (show) {
- System.out.println("derived =>" + globalThreadId + " " + threadId + " " + x + "," + y + " " + lx + "," + ly + " "
- + w + "," + h);
- System.out.println("data =>" + test[globalThreadId][0] + " " + test[globalThreadId][1] + " "
- + test[globalThreadId][2] + "," + test[globalThreadId][3] + " " + test[globalThreadId][4] + ","
- + test[globalThreadId][5] + " " + w + "," + h);
+ passed[globalThreadId] = false;
+ System.out.println("derived =>" + globalThreadId + " " + threadId + " " + x + "," + y + " " + lx + "," + ly + " " + w + "," + h);
+ System.out.println("data =>" + test[globalThreadId][0] + " " + test[globalThreadId][1] + " " + test[globalThreadId][2] + "," + test[globalThreadId][3] + " " + test[globalThreadId][4] + "," + test[globalThreadId][5] + " " + w + "," + h);
+ System.out.println();
}
+ else
+ passed[globalThreadId] = true;
}
}
- };
- kernel.execute(Range.create2D(12, 4, 4, 2));
-
}
}
