Some assert macros to strengthen you code. More...
#include <cstdlib>
#include <iostream>
#include <sstream>
Go to the source code of this file.
Namespaces | |
namespace | claw |
This is the main namespace. | |
Macros | |
#define | CLAW_ASSERT(b, s) |
Print a message on std::cerr and stop the program if a condition is not true. | |
#define | CLAW_FAIL(s) |
Print a message on std::cerr and stop the program. | |
#define | CLAW_PRECOND(b) |
Abort the program if a precondition is not true. | |
#define | CLAW_POSTCOND(b) |
Abort the program if a postcondition is not true. | |
Functions | |
void | claw::debug_assert (const char *file, const char *func, unsigned int line, bool b, const std::string &s) |
The method used by CLAW_ASSERT macro. Souldn't be used elsewhere. | |
Some assert macros to strengthen you code.
Definition in file assert.hpp.
#define CLAW_ASSERT | ( | b, | |
s ) |
Print a message on std::cerr and stop the program if a condition is not true.
b | Condition to verify. |
s | An error message. |
Definition at line 88 of file assert.hpp.
#define CLAW_FAIL | ( | s | ) |
Print a message on std::cerr and stop the program.
s | An error message. |
Definition at line 91 of file assert.hpp.
#define CLAW_POSTCOND | ( | b | ) |
Abort the program if a postcondition is not true.
b | Condition to verify. |
Definition at line 96 of file assert.hpp.
#define CLAW_PRECOND | ( | b | ) |
Abort the program if a precondition is not true.
b | Condition to verify. |
Definition at line 94 of file assert.hpp.