add (failing) simple pruning test

to validate propagators do not compute disabled solutions.
It's also good to have a simpler test around than 2 connects.
This commit is contained in:
v4hn 2021-03-19 23:26:53 +01:00
parent 9cf3c01b9a
commit 3e5e1da429

View File

@ -182,6 +182,22 @@ TEST(ConnectConnect, FailSucc) {
EXPECT_FALSE(t.plan());
}
TEST(Pruning, PropagatorFailure) {
resetIds();
Task t;
t.setRobotModel(getModel());
BackwardMockup* b;
t.add(Stage::pointer(b = new BackwardMockup()));
t.add(Stage::pointer(new GeneratorMockup({ 0 })));
t.add(Stage::pointer(new ForwardMockup({ inf })));
t.plan();
ASSERT_EQ(t.solutions().size(), 0);
// ForwardMockup fails, so the backward stage should never compute
EXPECT_EQ(b->calls_, 0);
}
TEST(Pruning, PruningMultiForward) {
resetIds();
Task t;