| 32 | #endif |
| 33 | |
| 34 | void 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 | |
| 51 | std::size_t count_unprintable_chars(const std::string& s) { |
| 52 | std::size_t result = 0; |
no test coverage detected