Skip to content

Commit b090e49

Browse files
committed
[MINOR] Fix missing result correctness check in selected tests
A while ago the internals of TestUtils.compareCellValue changed to not raise assertion failures directly. This change caused some tests to miss a proper result comparison check.
1 parent 3d714d3 commit b090e49

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/test/java/org/apache/sysds/test/component/codegen/CPlanVectorPrimitivesTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.lang.reflect.Method;
2323

2424
import org.apache.sysds.runtime.data.SparseRowVector;
25+
import org.junit.Assert;
2526
import org.junit.Test;
2627
import org.apache.sysds.common.Types.OpOp2;
2728
import org.apache.sysds.hops.codegen.cplan.CNodeBinary.BinType;
@@ -44,7 +45,7 @@ public class CPlanVectorPrimitivesTest extends AutomatedTestBase
4445
private static final int n = 132;
4546
private static final double sparsity1 = 0.9;
4647
private static final double sparsity2 = 0.09;
47-
private static final double eps = Math.pow(10, -10);
48+
private static final double eps = 1e-10;
4849

4950
private enum InputType {
5051
SCALAR,
@@ -998,7 +999,6 @@ public void testVectorSignSparseToSparse() {
998999
testVectorUnarySparsePrimitive(UnaryType.VECT_SIGN, InputType.VECTOR_SPARSE);
9991000
}
10001001

1001-
@SuppressWarnings("incomplete-switch")
10021002
private static void testVectorAggPrimitive(UnaryType aggtype, InputType type1)
10031003
{
10041004
try {
@@ -1031,7 +1031,7 @@ private static void testVectorAggPrimitive(UnaryType aggtype, InputType type1)
10311031
}
10321032

10331033
//compare results
1034-
TestUtils.compareCellValue(ret1, ret2, eps, false);
1034+
Assert.assertEquals(ret1, ret2, eps);
10351035
}
10361036
}
10371037
catch( Exception ex ) {

src/test/java/org/apache/sysds/test/component/compress/CompressedVectorTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.apache.sysds.test.component.compress.TestConstants.SparsityType;
3939
import org.apache.sysds.test.component.compress.TestConstants.ValueRange;
4040
import org.apache.sysds.test.component.compress.TestConstants.ValueType;
41+
import org.junit.Assert;
4142
import org.junit.Test;
4243
import org.junit.runner.RunWith;
4344
import org.junit.runners.Parameterized;
@@ -117,7 +118,7 @@ public void testQuartile() {
117118
double ret2 = cmb.sortOperations().pickValue(0.95);
118119

119120
if(_cs.lossy)
120-
TestUtils.compareCellValue(ret1, ret2, lossyTolerance, false);
121+
Assert.assertEquals(ret1, ret2, lossyTolerance);
121122
else
122123
assertTrue(bufferedToString, TestUtils.compareScalarBits(ret1, ret2, 0));
123124

0 commit comments

Comments
 (0)