use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.
the class LiftsTest method testFastDoors.
@Test
public void testFastDoors() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "FastDoors.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
}
use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.
the class LiftsTest method testMissingEmergencyCall.
@Test
public void testMissingEmergencyCall() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "EmergencyCallFail.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
}
use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.
the class LiftsTest method testLiftDoesNotMoveTowardsFirstPressedButton.
@Ignore("iseq not implemented in FormularToZ3Translator")
@Test
public void testLiftDoesNotMoveTowardsFirstPressedButton() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "LiftDoesNotMoveTowardsFirstPressedButton.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
}
use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.
the class LiftsTest method testInvalidPositions.
@Test
public void testInvalidPositions() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "LiftStopsAtInvalidPositions.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
assertEquals("{MAX_FLOOR=5, MIN_FLOOR=0, doors_open=false, moving=false, current_floor=1, betweenFloors=true}", result.getLastState().toString());
}
use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.
the class CSTAnalyserTest method testWarningInPropertiesClause.
@Test
public void testWarningInPropertiesClause() {
String machine = "MACHINE test\n";
machine += "PROPERTIES TRUE or FALSE & FALSE \n";
machine += "END";
MachineNode machineNode = parseMachine(machine);
List<String> warnings = machineNode.getWarnings();
assertEquals(1, warnings.size());
assertEquals("Ambiguous combination of operators 'or' (line 2, pos 16) and '&' (line 2, pos 25)." + " Use parentheses to avoid this.", warnings.get(0));
}
Aggregations