use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class DivisionTest method testPositiveDoubleDivisionByZero.
@Test
public void testPositiveDoubleDivisionByZero() {
double op1 = 5;
double op2 = 0;
TestConfiguration config = availableTestConfigurations.get("PositiveDivisionByZeroTest");
config.addVariable("vardeclaration", "");
config.addVariable("op1", op1);
config.addVariable("op2", op2);
loadTestConfiguration(config);
createHelperMatrix();
writeExpectedHelperMatrix("computed", Double.POSITIVE_INFINITY);
runTest();
compareResults();
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class OrTest method testOr.
@Test
public void testOr() {
TestConfiguration config = getTestConfiguration("OrTest");
loadTestConfiguration(config);
createHelperMatrix();
writeExpectedHelperMatrix("left_1", 2);
writeExpectedHelperMatrix("left_2", 2);
writeExpectedHelperMatrix("left_3", 2);
writeExpectedHelperMatrix("left_4", 1);
writeExpectedHelperMatrix("right_1", 2);
writeExpectedHelperMatrix("right_2", 2);
writeExpectedHelperMatrix("right_3", 2);
writeExpectedHelperMatrix("right_4", 1);
runTest();
compareResults();
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class PowerTest method setUp.
@Override
public void setUp() {
addTestConfiguration("ConstConstTest", new TestConfiguration(TEST_CLASS_DIR, "PowerTest", new String[] { "int_int", "int_double", "double_double", "double_double" }));
addTestConfiguration("VarConstTest", new TestConfiguration(TEST_CLASS_DIR, "PowerTest", new String[] { "int_int", "int_double", "double_double", "double_double" }));
addTestConfiguration("ConstVarTest", new TestConfiguration(TEST_CLASS_DIR, "PowerTest", new String[] { "int_int", "int_double", "double_double", "double_double" }));
addTestConfiguration("VarVarTest", new TestConfiguration(TEST_CLASS_DIR, "PowerTest", new String[] { "int_int", "int_double", "double_double", "double_double" }));
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class PowerTest method testConstConst.
@Test
public void testConstConst() {
int intIntValue1 = 2;
int intIntValue2 = 3;
int intDoubleValue1 = 2;
double intDoubleValue2 = 3;
double doubleDoubleValue1 = 2;
double doubleDoubleValue2 = 3;
double doubleIntValue1 = 2;
int doubleIntValue2 = 3;
TestConfiguration config = availableTestConfigurations.get("ConstConstTest");
config.addVariable("intintvardeclaration", "");
config.addVariable("intintop1", intIntValue1);
config.addVariable("intintop2", intIntValue2);
config.addVariable("intdoublevardeclaration", "");
config.addVariable("intdoubleop1", intDoubleValue1);
config.addVariable("intdoubleop2", intDoubleValue2);
config.addVariable("doubledoublevardeclaration", "");
config.addVariable("doubledoubleop1", doubleDoubleValue1);
config.addVariable("doubledoubleop2", doubleDoubleValue2);
config.addVariable("doubleintvardeclaration", "");
config.addVariable("doubleintop1", doubleIntValue1);
config.addVariable("doubleintop2", doubleIntValue2);
loadTestConfiguration(config);
double computedIntIntValue = Math.pow(intIntValue1, intIntValue2);
double computedIntDoubleValue = Math.pow(intDoubleValue1, intDoubleValue2);
double computedDoubleDoubleValue = Math.pow(doubleDoubleValue1, doubleDoubleValue2);
double computedDoubleIntValue = Math.pow(doubleIntValue1, doubleIntValue2);
createHelperMatrix();
writeExpectedHelperMatrix("int_int", computedIntIntValue);
writeExpectedHelperMatrix("int_double", computedIntDoubleValue);
writeExpectedHelperMatrix("double_double", computedDoubleDoubleValue);
writeExpectedHelperMatrix("double_int", computedDoubleIntValue);
runTest();
compareResults();
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class LessThanTest method setUp.
@Override
public void setUp() {
TestUtils.clearAssertionInformation();
addTestConfiguration("LessThanTest", new TestConfiguration(TEST_CLASS_DIR, "LessThanTest", new String[] { "left_1", "left_2", "left_3", "right_1", "right_2", "right_3" }));
}
Aggregations