@@ -298,3 +298,41 @@ TEST(Preconditions, Issue615_NoSkipWhenRunning_B)
298
298
tree.rootBlackboard ()->set (" check" , false );
299
299
ASSERT_EQ ( tree.tickOnce (), NodeStatus::RUNNING );
300
300
}
301
+
302
+
303
+
304
+ TEST (Preconditions, Remapping)
305
+ {
306
+ static constexpr auto xml_text = R"(
307
+ <root BTCPP_format="4">
308
+
309
+ <BehaviorTree ID="Main">
310
+ <Sequence>
311
+ <Script code="value:=1" />
312
+ <SubTree ID="Sub1" param="{value}"/>
313
+ <TestA _skipIf="value!=1" />
314
+ </Sequence>
315
+ </BehaviorTree>
316
+
317
+ <BehaviorTree ID="Sub1">
318
+ <Sequence>
319
+ <TestB _skipIf="param!=1" />
320
+ </Sequence>
321
+ </BehaviorTree>
322
+ </root>
323
+ )" ;
324
+
325
+ BehaviorTreeFactory factory;
326
+
327
+ std::array<int , 2 > counters;
328
+ RegisterTestTick (factory, " Test" , counters);
329
+
330
+ factory.registerBehaviorTreeFromText (xml_text);
331
+ auto tree = factory.createTree (" Main" );
332
+
333
+ auto status = tree.tickWhileRunning ();
334
+
335
+ ASSERT_EQ (status, BT::NodeStatus::SUCCESS);
336
+ ASSERT_EQ ( counters[0 ], 1 );
337
+ ASSERT_EQ ( counters[1 ], 1 );
338
+ }
0 commit comments