CLibs
|
Go to the source code of this file.
Macros | |
#define | CLIBS_ASSERT_THAT_EXIT_VAL RV_EXCEPTION |
#define | assert_that(EXPRESSION, ...) |
Asserts a given expression and exits with an error message if the assertion fails. |
#define assert_that | ( | EXPRESSION, | |
... ) |
Asserts a given expression and exits with an error message if the assertion fails.
EXPRESSION | The condition to be evaluated. If false, the assertion fails. |
... | Additional arguments for the formatted error message (format string + varargs). These are passed to fflwarnx_ret for constructing the error message. |
Example:
In this example, if x > 10 evaluates to false, the program will exit and print an error message (the expression is printed in COLOR_DEFAULT, the rest in COLOR_WARNING):
#define CLIBS_ASSERT_THAT_EXIT_VAL RV_EXCEPTION |