Skip to content

Commit b7e101e

Browse files
committed
[MINOR] Fix old tests with redundant writes of inputs files
1 parent 283359a commit b7e101e

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/test/java/org/apache/sysds/test/functions/binary/matrix/ElementwiseAdditionMultiplicationTest.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ public void testTerm1() {
5353
config.addVariable("cols", cols);
5454
loadTestConfiguration(config);
5555

56-
double[][] a = createRandomMatrix("a", rows, cols, 0, 10, 1, new Date().getTime());
57-
double[][] b = createRandomMatrix("b", rows, cols, 0, 10, 1, new Date().getTime() + 1);
58-
double[][] c = createRandomMatrix("c", rows, cols, 0, 10, 1, new Date().getTime() + 2);
59-
double[][] d = createRandomMatrix("d", rows, cols, 0, 10, 1, new Date().getTime() + 4);
56+
cleanupDir(baseDirectory + INPUT_DIR, true);
57+
double[][] a = getRandomMatrix( rows, cols, 0, 10, 1, new Date().getTime());
58+
double[][] b = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime() + 1);
59+
double[][] c = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime() + 2);
60+
double[][] d = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime() + 4);
6061
writeInputMatrixWithMTD("a", a, false);
6162
writeInputMatrixWithMTD("b", b, false);
6263
writeInputMatrixWithMTD("c", c, false);
@@ -85,9 +86,9 @@ public void testTerm2() {
8586
config.addVariable("cols", cols);
8687
loadTestConfiguration(config);
8788

88-
double[][] a = createRandomMatrix("a", rows, cols, 0, 10, 1, new Date().getTime());
89-
double[][] b = createRandomMatrix("b", rows, cols, 0, 10, 1, new Date().getTime() + 1);
90-
double[][] c = createRandomMatrix("c", rows, cols, 0, 10, 1, new Date().getTime() + 4);
89+
double[][] a = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime());
90+
double[][] b = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime() + 1);
91+
double[][] c = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime() + 4);
9192
writeInputMatrixWithMTD("a", a, false);
9293
writeInputMatrixWithMTD("b", b, false);
9394
writeInputMatrixWithMTD("c", c, false);
@@ -115,9 +116,9 @@ public void testTerm3() {
115116
config.addVariable("cols", cols);
116117
loadTestConfiguration(config);
117118

118-
double[][] a = createRandomMatrix("a", rows, cols, 0, 10, 1, new Date().getTime());
119-
double[][] b = createRandomMatrix("b", rows, cols, 0, 10, 1, new Date().getTime() + 1);
120-
double[][] c = createRandomMatrix("c", rows, cols, 0, 10, 1, new Date().getTime() + 2);
119+
double[][] a = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime());
120+
double[][] b = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime() + 1);
121+
double[][] c = getRandomMatrix(rows, cols, 0, 10, 1, new Date().getTime() + 2);
121122
writeInputMatrixWithMTD("a", a, false);
122123
writeInputMatrixWithMTD("b", b, false);
123124
writeInputMatrixWithMTD("c", c, false);

0 commit comments

Comments
 (0)