#include <assert.hpp>
Go to the source code of this file.
|
void | libassert_specs_handler (libassert::assert_type type, ASSERTION fatal, const libassert::assertion_printer &printer) |
|
◆ libassert_specs_handler()
void libassert_specs_handler |
( |
libassert::assert_type |
type, |
|
|
ASSERTION |
fatal, |
|
|
const libassert::assertion_printer & |
printer |
|
) |
| |
|
inline |
Definition at line 20 of file LibAssertExceptionHandler.h.
22 {
23 std::string message = printer(libassert::utility::terminal_width(120));
25 std::string::size_type stack_trace_start = message.find("\nStack trace:");
26 if (stack_trace_start != std::string::npos) message.erase(stack_trace_start);
27 }
28 #ifdef NDEBUG
29
30
31 std::lock_guard<std::mutex> lock(SpecsCpp::LibAssert::AllAssertionFailureMessagesMutex);
32 SpecsCpp::LibAssert::AllAssertionFailureMessages.emplace_back(message);
33 throw SpecsCpp::LibAssert::AllAssertionFailureMessages.back().c_str();
34 #else
35 throw message.c_str();
36 #endif
37}