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

Function throwRuntimeError

tests/gtest_groot2_publisher.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30)";
31
32void throwRuntimeError()
33{
34 BT::BehaviorTreeFactory factory;
35 factory.registerSimpleAction("ThrowRuntimeError", [](BT::TreeNode&) -> BT::NodeStatus {
36 throw BT::RuntimeError("Oops!");
37 });
38
39 auto tree = factory.createTreeFromText(xml_text);
40 BT::Groot2Publisher publisher(tree);
41 EXPECT_THROW(tree.tickExactlyOnce(), BT::RuntimeError);
42}
43} // namespace
44
45TEST(Groot2PublisherTest, EnsureNoInfiniteLoopOnThrow)

Callers

nothing calls this directly

Calls 4

RuntimeErrorClass · 0.85
registerSimpleActionMethod · 0.80
createTreeFromTextMethod · 0.80
tickExactlyOnceMethod · 0.80

Tested by

no test coverage detected