MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / TEST

Function TEST

tests/gtest_updates.cpp:31–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 </root>)";
30
31TEST(EntryUpdates, NoEntry)
32{
33 BehaviorTreeFactory factory;
34 std::array<int, 2> counters{};
35 RegisterTestTick(factory, "Test", counters);
36
37 const std::string xml_text = R"(
38 <root BTCPP_format="4" >
39 <BehaviorTree ID="Main">
40 <Sequence>
41 <SubTree ID="Check" _autoremap="true"/>
42 </Sequence>
43 </BehaviorTree>
44 </root>)";
45
46 factory.registerBehaviorTreeFromText(xml_text_check);
47 factory.registerBehaviorTreeFromText(xml_text);
48 auto tree = factory.createTree("Main");
49 const auto status = tree.tickWhileRunning();
50 ASSERT_EQ(status, NodeStatus::SUCCESS);
51 EXPECT_EQ(1, counters[0]); // fallback!
52 EXPECT_EQ(0, counters[1]); // skipped
53}
54
55TEST(EntryUpdates, Initialized)
56{

Callers

nothing calls this directly

Calls 4

RegisterTestTickFunction · 0.85
createTreeMethod · 0.80
tickWhileRunningMethod · 0.80

Tested by

no test coverage detected