Cambridge SMT System
|
Provides smarter assert methods. More...
Go to the source code of this file.
Macros | |
#define | USER_CHECK_CONTINUE(exp, comment) (bool)( (exp) || (check (#exp,#comment, __FILE__, __PRETTY_FUNCTION__,__LINE__,false), 0) ) |
#define | USER_CHECK(exp, comment) (bool)( (exp) || (check (#exp,#comment, __FILE__, __PRETTY_FUNCTION__,__LINE__,true), 0) ) |
Tests whether exp is true. If not, comment is printed and program ends. More... | |
Functions | |
bool | check (const char *expression, const char *message, const char *filename, const char *function, uint line, bool abort=true) |
Function that reports as many details as possible if the assertion USER_CHECK has failed. Combined with USER_CHECK, it reports file, function/class method, and file line. In addition, execution is ended unless USER_CHECK_DEBUG defined, and a reason is reported. the value returned by check can also be used to decide subsequent actions in USER_CHECK_DEBUG mode (e.g. return inmediately). check function also provides backtrace information to help the user. More... | |
#define USER_CHECK | ( | exp, | |
comment | |||
) | (bool)( (exp) || (check (#exp,#comment, __FILE__, __PRETTY_FUNCTION__,__LINE__,true), 0) ) |
Tests whether exp is true. If not, comment is printed and program ends.
Definition at line 41 of file custom_assert.hpp.
#define USER_CHECK_CONTINUE | ( | exp, | |
comment | |||
) | (bool)( (exp) || (check (#exp,#comment, __FILE__, __PRETTY_FUNCTION__,__LINE__,false), 0) ) |
Definition at line 35 of file custom_assert.hpp.
|
inline |
Function that reports as many details as possible if the assertion USER_CHECK has failed. Combined with USER_CHECK, it reports file, function/class method, and file line. In addition, execution is ended unless USER_CHECK_DEBUG defined, and a reason is reported. the value returned by check can also be used to decide subsequent actions in USER_CHECK_DEBUG mode (e.g. return inmediately). check function also provides backtrace information to help the user.
Definition at line 51 of file custom_assert.hpp.