Skip to content

Commit

Permalink
Extend unit test for blackboard backup to run the second tree (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmassy authored Mar 19, 2024
1 parent ca8d32a commit ead514d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/gtest_blackboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,18 +515,20 @@ TEST(BlackboardTest, BlackboardBackup)
<root BTCPP_format="4" >
<BehaviorTree ID="MySubtree">
<Sequence>
<Script code=" value:= sub_value " />
<Script code=" my_value=2 " />
<Script code=" important_value:= sub_value " />
<Script code=" my_value=false " />
<SaySomething message="{message}" />
</Sequence>
</BehaviorTree>
<BehaviorTree ID="MainTree">
<Sequence>
<Script code=" my_value:=1 " />
<SubTree ID="MySubtree" sub_value="true" _autoremap="true" />
<Script code=" my_value:=true; another_value:='hi' " />
<SubTree ID="MySubtree" sub_value="true" message="{another_value}" _autoremap="true" />
</Sequence>
</BehaviorTree>
</root> )";

factory.registerNodeType<DummyNodes::SaySomething>("SaySomething");
factory.registerBehaviorTreeFromText(xml_text);
auto tree = factory.createTree("MainTree");

Expand Down Expand Up @@ -556,4 +558,6 @@ TEST(BlackboardTest, BlackboardBackup)
ASSERT_EQ(expected_keys[i][a], keys[a]);
}
}
status = tree.tickWhileRunning();
ASSERT_EQ(status, BT::NodeStatus::SUCCESS);
}

0 comments on commit ead514d

Please sign in to comment.