opensurgsim
|
The assertion API used by OpenSurgSim code. More...
Modules | |
Internal assertion helpers | |
Not meant for public consumption. | |
Files | |
file | Assert.h |
The header that provides the assertion API. | |
Classes | |
class | SurgSim::Framework::AssertionFailure |
An exception class thrown by SURGSIM_ASSERT() failures and SURGSIM_FAILURE(). More... | |
Macros | |
#define | SURGSIM_ASSERT(condition) |
Assert that condition is true. More... | |
#define | SURGSIM_FAILURE() |
Report that something very bad has happened and abort program execution. More... | |
The assertion API used by OpenSurgSim code.
#define SURGSIM_ASSERT | ( | condition | ) |
Assert that condition
is true.
If not, abort program execution, printing an error message that will include failText
, the condition, source file/line, etc.
condition | Condition to test |
Example: SURGSIM_ASSERT(index >= 0) << "bad index: " << index;
#define SURGSIM_FAILURE | ( | ) |
Report that something very bad has happened and abort program execution.
An error message will be printed, and will include failText
, source file/line, etc. This is pretty similar to SURGSIM_ASSERT(true, ...), except "true" won't be included in the resulting message. =)
Example: SURGSIM_FAILURE() << failText;