Skip to content
Snippets Groups Projects
Commit fe42f91e authored by Johannes Mey's avatar Johannes Mey
Browse files

fix problem with tests

parent 943ed3d3
No related branches found
No related tags found
No related merge requests found
aspect Tracing {
refine
public void Container.setElementCount(int x) {
refined(x);
World.printContextOf("Container.setElementCount()-AFTER", this, de.tudresden.inf.st.mg.common.MotionGrammarConfig.ADD_COLOR);
}
}
...@@ -38,7 +38,7 @@ public abstract class MotionGrammarParser<T extends MotionGrammarElement> { ...@@ -38,7 +38,7 @@ public abstract class MotionGrammarParser<T extends MotionGrammarElement> {
} }
} }
public void setDebugDiagramDir(Path p) { public static void setDebugDiagramDir(Path p) {
MotionGrammarConfig.astDiagramDir = p; MotionGrammarConfig.astDiagramDir = p;
} }
......
...@@ -40,11 +40,12 @@ public class ParserTest { ...@@ -40,11 +40,12 @@ public class ParserTest {
@Test @Test
void runLodUnloadParser() throws MotionGrammarParser.ParseException { void runLodUnloadParser() throws MotionGrammarParser.ParseException {
MotionGrammarParser.setDebugDiagramDir(LOAD_AST_DIAGRAM_DIR);
// for some reason, the best random seed value here is 1 and not 0??? // for some reason, the best random seed value here is 1 and not 0???
Container containerWorld = Container.initialWorld(new Random(1)); Container containerWorld = Container.initialWorld(new Random(1));
LoadWorldParser parser = new LoadWorldParser(containerWorld); LoadWorldParser parser = new LoadWorldParser(containerWorld);
parser.setDebugDiagramDir(LOAD_AST_DIAGRAM_DIR);
var result = parser.parse(); var result = parser.parse();
...@@ -54,13 +55,14 @@ public class ParserTest { ...@@ -54,13 +55,14 @@ public class ParserTest {
@Test @Test
void runTidyParser() throws MotionGrammarParser.ParseException { void runTidyParser() throws MotionGrammarParser.ParseException {
MotionGrammarParser.setDebugDiagramDir(TIDY_AST_DIAGRAM_DIR);
// for some reason, the best random seed value here is 1 and not 0??? // for some reason, the best random seed value here is 1 and not 0???
RobotWorld world = RobotWorld.initialWorld(new Random(1)); RobotWorld world = RobotWorld.initialWorld(new Random(1));
world.printContext("initial"); world.printContext("initial");
// create a parser using the world // create a parser using the world
RobotParser parser = new RobotParser(world); RobotParser parser = new RobotParser(world);
parser.setDebugDiagramDir(TIDY_AST_DIAGRAM_DIR);
world.addSelection(new Selection().setObject("boxRed").setTimeStamp(java.time.Instant.now())) world.addSelection(new Selection().setObject("boxRed").setTimeStamp(java.time.Instant.now()))
.addSelection(new Selection().setObject("boxGreen").setTimeStamp(java.time.Instant.now())) .addSelection(new Selection().setObject("boxGreen").setTimeStamp(java.time.Instant.now()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment