SpinParser
1.0
|
Lightweight macro library for assertions. More...
#include "lib/Exception.hpp"
Go to the source code of this file.
Macros | |
#define | __RESOLVE_ASSERT_OVERLOAD(_1, _2, FUNCTIONNAME, ...) FUNCTIONNAME |
Wrapper for macro overlading. | |
#define | ASSERT(...) __RESOLVE_ASSERT_OVERLOAD(__VA_ARGS__, __ASSERT_OVERLOAD2, __ASSERT_OVERLOAD1)(__VA_ARGS__) |
Ensure that the first argument is true. Optionally provide a message as the second argument, which is printed with an error message if the assertion fails. | |
#define | __ASSERT_OVERLOAD1(x) |
Ensure that a statement is true. If statement is false, throw AssertionFail exception. More... | |
#define | __ASSERT_OVERLOAD2(x, msg) |
Ensure that a statement is true. If statement is false, throw AssertionFail exception. More... | |
Lightweight macro library for assertions.
#define __ASSERT_OVERLOAD1 | ( | x | ) |
Ensure that a statement is true. If statement is false, throw AssertionFail exception.
x | Statement to assess. |
#define __ASSERT_OVERLOAD2 | ( | x, | |
msg | |||
) |
Ensure that a statement is true. If statement is false, throw AssertionFail exception.
x | Statement to assess. |
msg | Message to print with the exception. |