Commit 26fcc753 authored by René Schöne's avatar René Schöne
Browse files

Always check for empty solution in tests.

parent 0c4e491f
......@@ -91,6 +91,9 @@ public abstract class HandwrittenTestSuite {
private void assertValidSolution(Tuple<Root, Solution> modelAndSolution) {
// Assert.assertTrue("Solution is not valid", modelAndSolution.getSecondElement().isValid());
if (modelAndSolution.getSecondElement().getNumAssignment() == 0) {
logger.warn("Solution is empty");
}
collector.checkThat("Solution is not valid", true,
equalTo(modelAndSolution.getSecondElement().isValid()));
}
......@@ -98,19 +101,19 @@ public abstract class HandwrittenTestSuite {
@Test
public void test_01() throws IOException, Parser.Exception, SolvingException {
Tuple<Root, Solution> modelAndSolution = loadAndSolve("test_01.txt");
assertValidSolution(modelAndSolution);
Assignment config_0i0m0 = assertAssignment(modelAndSolution, 0, "config_0i0m0", "r0");
Assignment config_1i0m0 = assertAssignment(modelAndSolution, 0, "config_1i0m0", "r1");
assertComponentRequirement(config_0i0m0,"other", config_1i0m0);
assertValidSolution(modelAndSolution);
}
@Test
public void test_02() throws IOException, Parser.Exception, SolvingException {
Tuple<Root, Solution> modelAndSolution = loadAndSolve("test_02.txt");
assertValidSolution(modelAndSolution);
Assignment config_0i0m0 = assertAssignment(modelAndSolution, 0, "config_0i0m0", "r0");
Assignment config_1i0m0 = assertAssignment(modelAndSolution, 0, "config_1i0m0", "r1");
assertComponentRequirement(config_0i0m0,"other", config_1i0m0);
assertValidSolution(modelAndSolution);
}
@Test
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment