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

Function TEST

tests/gtest_groot2_publisher.cpp:45–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43} // namespace
44
45TEST(Groot2PublisherTest, EnsureNoInfiniteLoopOnThrow)
46{
47 EXPECT_EXIT(
48 {
49 auto fut = std::async(std::launch::async, throwRuntimeError);
50 auto status = fut.wait_for(1s); // shouldn't run for more than 1 second
51 if(status != std::future_status::ready)
52 {
53 std::cerr << "Test took too long. Possible infinite loop.\n";
54 std::exit(EXIT_FAILURE);
55 }
56 std::exit(EXIT_SUCCESS);
57 },
58 ::testing::ExitedWithCode(EXIT_SUCCESS), ".*");
59}
60
61// Test that destructor completes quickly even after exception
62// This test runs multiple times to catch race conditions

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