@@ -9,13 +9,14 @@ class SimpleCondition : public BT::ConditionNode
99{
1010private:
1111 std::string port_name_;
12+
1213public:
1314 SimpleCondition (const std::string& name, const BT::NodeConfig& config,
14- std::string port_name) :
15- BT::ConditionNode (name, config),
16- port_name_ (port_name)
15+ std::string port_name)
16+ : BT::ConditionNode(name, config), port_name_(port_name)
1717 {}
18- static BT::PortsList providedPorts () {
18+ static BT::PortsList providedPorts ()
19+ {
1920 return {};
2021 }
2122 BT::NodeStatus tick () override
@@ -30,28 +31,35 @@ class AsyncTestAction : public BT::StatefulActionNode
3031{
3132 int counter_ = 0 ;
3233 std::string port_name_;
34+
3335public:
3436 AsyncTestAction (const std::string& name, const BT::NodeConfig& config,
35- std::string port_name) :
36- BT::StatefulActionNode (name, config),
37- port_name_ (port_name)
37+ std::string port_name)
38+ : BT::StatefulActionNode(name, config), port_name_(port_name)
3839 {}
3940
40- static BT::PortsList providedPorts (){ return {}; }
41+ static BT::PortsList providedPorts ()
42+ {
43+ return {};
44+ }
4145
42- NodeStatus onStart () override {
46+ NodeStatus onStart () override
47+ {
4348 counter_ = 0 ;
4449 return NodeStatus::RUNNING;
4550 }
4651
47- NodeStatus onRunning () override {
48- if (++counter_ == 2 ) {
52+ NodeStatus onRunning () override
53+ {
54+ if (++counter_ == 2 )
55+ {
4956 config ().blackboard ->set <bool >(port_name_, true );
5057 return NodeStatus::SUCCESS;
5158 }
5259 return NodeStatus::RUNNING;
5360 }
54- void onHalted () override {}
61+ void onHalted () override
62+ {}
5563};
5664// --------------------------
5765
@@ -112,7 +120,6 @@ TEST(ReactiveBackchaining, EnsureWarm)
112120 EXPECT_EQ (observer.getStatistics (" wear" ).success_count , 1 );
113121}
114122
115-
116123TEST (ReactiveBackchaining, EnsureWarmWithEnsureHoldingHacket)
117124{
118125 // This test backchains on HoldingHacket => EnsureHoldingHacket to iteratively add reactivity and functionality to the tree.
@@ -181,4 +188,4 @@ TEST(ReactiveBackchaining, EnsureWarmWithEnsureHoldingHacket)
181188 EXPECT_EQ (tree.tickExactlyOnce (), NodeStatus::SUCCESS);
182189}
183190
184- }
191+ } // namespace BT::test
0 commit comments