Skip to content

Commit 3e5e1da

Browse files
committed
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.
1 parent 9cf3c01 commit 3e5e1da

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

core/test/test_serial.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,22 @@ TEST(ConnectConnect, FailSucc) {
182182
EXPECT_FALSE(t.plan());
183183
}
184184

185+
TEST(Pruning, PropagatorFailure) {
186+
resetIds();
187+
Task t;
188+
t.setRobotModel(getModel());
189+
BackwardMockup* b;
190+
t.add(Stage::pointer(b = new BackwardMockup()));
191+
t.add(Stage::pointer(new GeneratorMockup({ 0 })));
192+
t.add(Stage::pointer(new ForwardMockup({ inf })));
193+
194+
t.plan();
195+
196+
ASSERT_EQ(t.solutions().size(), 0);
197+
// ForwardMockup fails, so the backward stage should never compute
198+
EXPECT_EQ(b->calls_, 0);
199+
}
200+
185201
TEST(Pruning, PruningMultiForward) {
186202
resetIds();
187203
Task t;

0 commit comments

Comments
 (0)