MCPcopy Create free account
hub / github.com/boostorg/stacktrace / test_deeply_nested_namespaces

Function test_deeply_nested_namespaces

test/test.cpp:34–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#endif
33
34void test_deeply_nested_namespaces() {
35 std::stringstream ss;
36 ss << return_from_nested_namespaces();
37 std::cout << ss.str() << '\n';
38#if BOOST_STACKTRACE_TEST_SHOULD_OUTPUT_READABLE_NAMES
39 BOOST_TEST(ss.str().find("main") != std::string::npos);
40
41 BOOST_TEST(ss.str().find("get_backtrace_from_nested_namespaces") != std::string::npos
42 || ss.str().find("1# return_from_nested_namespaces") != std::string::npos); // GCC with -O1 has strange inlining, so this line is true while the prev one is false.
43
44 BOOST_TEST(ss.str().find("return_from_nested_namespaces") != std::string::npos);
45#endif
46
47 stacktrace ns1 = return_from_nested_namespaces();
48 BOOST_TEST(ns1 != return_from_nested_namespaces()); // Different addresses in test_deeply_nested_namespaces() function
49}
50
51std::size_t count_unprintable_chars(const std::string& s) {
52 std::size_t result = 0;

Callers 1

mainFunction · 0.70

Calls 1

Tested by

no test coverage detected