diff --git a/tests/gtest_blackboard.cpp b/tests/gtest_blackboard.cpp index 345bf7ba5..172115474 100644 --- a/tests/gtest_blackboard.cpp +++ b/tests/gtest_blackboard.cpp @@ -18,6 +18,8 @@ #include "behaviortree_cpp_v3/blackboard.h" #include "behaviortree_cpp_v3/xml_parsing.h" +#include "../sample_nodes/dummy_nodes.h" + using namespace BT; class BB_TestNode : public SyncActionNode @@ -295,3 +297,28 @@ TEST(BlackboardTest, CheckTypeSafety) is = std::is_constructible::value; ASSERT_TRUE(is); } + +TEST(BlackboardTest, SetBlackboard_Issue725) +{ + BT::BehaviorTreeFactory factory; + + const std::string xml_text = R"( + + + + + + + + + )"; + + factory.registerNodeType("SaySomething"); + factory.registerBehaviorTreeFromText(xml_text); + auto tree = factory.createTree("MainTree"); + const auto status = tree.tickRoot(); + + ASSERT_EQ(status, BT::NodeStatus::SUCCESS); + ASSERT_EQ("hello world", tree.rootBlackboard()->get("value")); + ASSERT_EQ("hello world", tree.rootBlackboard()->get("other_value")); +}