3 #include <backward/backward.hpp> 4 #include <gflags/gflags.h> 9 DECLARE_bool(continue_on_assert);
16 std::string_view what,
17 const char*
file =
"unknown_file",
20 std::string_view what,
23 backward::StackTrace st);
39 std::string_view condition,
40 std::string_view message,
43 backward::StackTrace
const& st);
49 std::string_view condition,
50 std::string_view message);
58 #define ASSERT_MAKE_STR(s) #s 59 #define ASSERT_2(condition, message) \ 62 throw common::AssertionFailure( \ 63 ASSERT_MAKE_STR(condition), \ 67 common::createStackTrace()); \ 70 #define ASSERT_1(condition) ASSERT_2(condition, "") 75 #define GET_3RD_ARG(arg1, arg2, arg3, ...) arg3 76 #define ASSERT_MACRO_CHOOSER(...) GET_3RD_ARG(__VA_ARGS__, ASSERT_2, ASSERT_1, ) 79 #define ASSERT(...) ASSERT_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
const char * file
Definition: assert.h:25
Exception(std::string_view what, const char *file="unknown_file", int line=0)
Definition: assert.cpp:9
int line
Definition: assert.h:26
std::string_view condition
Definition: assert.h:45
void print()
Definition: assert.cpp:29
General utilities.
Definition: assert.cpp:7
backward::StackTrace stackTrace
Definition: assert.h:27
static std::string formatErrorMessage(std::string_view message, const char *file, int line)
Definition: assert.cpp:22
backward::StackTrace createStackTrace()
Definition: assert.cpp:59