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

Function test_rethrow_nested

test/test_from_exception.cpp:131–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131BOOST_NOINLINE BOOST_SYMBOL_VISIBLE void test_rethrow_nested() {
132 std::exception_ptr ptr;
133
134 try {
135 in_test_throw_1("test_other_exception_active");
136 } catch (const std::exception&) {
137 try {
138 in_test_throw_2("test_other_exception_active 2");
139 } catch (const std::exception&) {
140 ptr = std::current_exception();
141 }
142 }
143
144 try {
145 std::rethrow_exception(ptr);
146 } catch (...) {
147 auto trace = stacktrace::from_current_exception();
148 BOOST_TEST(trace);
149 std::cout << "Tarce in test_rethrow_nested(): " << trace << '\n';
150 BOOST_TEST(to_string(trace).find("in_test_throw_1") == std::string::npos);
151#if defined(BOOST_MSVC)
152 BOOST_TEST(to_string(trace).find("in_test_throw_2") == std::string::npos);
153#else
154 BOOST_TEST(to_string(trace).find("in_test_throw_2") != std::string::npos);
155#endif
156 }
157}
158
159BOOST_NOINLINE BOOST_SYMBOL_VISIBLE void test_from_other_thread() {
160

Callers 1

mainFunction · 0.85

Calls 4

in_test_throw_2Function · 0.85
from_current_exceptionFunction · 0.85
to_stringFunction · 0.85
in_test_throw_1Function · 0.70

Tested by

no test coverage detected