mirror of
https://github.com/boostorg/stacktrace.git
synced 2026-01-26 07:02:10 +00:00
More tests
This commit is contained in:
@@ -97,6 +97,7 @@ void my_terminate_handler() {
|
||||
}
|
||||
|
||||
void my_signal_handler(int signum) {
|
||||
::signal(signum, SIG_DFL);
|
||||
boost::stacktrace::stacktrace bt;
|
||||
if (bt) {
|
||||
std::cerr << "Signal " << signum << ", backtrace:\n" << boost::stacktrace::stacktrace() << '\n'; // ``[footnote Strictly speaking this code is not async-signal-safe, because it uses std::cerr. [link boost_stacktrace.build_macros_and_backends Section "Build, Macros and Backends"] describes async-signal-safe backends, so if you will use the noop backend code becomes absolutely valid as that backens always returns 0 frames and `operator<<` will be never called. ]``
|
||||
@@ -173,7 +174,7 @@ int main() {
|
||||
setup_handlers();
|
||||
|
||||
BOOST_TRY {
|
||||
foo(5); // testing assert handler
|
||||
foo(105); // testing assert handler
|
||||
} BOOST_CATCH(...) {
|
||||
} BOOST_CATCH_END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user