static NORETURN void _expect_failure(const char *file, unsigned line)
Function to handle failed expectation.
abort the program if condition is false
This is similar to assert(), but will not be excluded from a build even if NDEBUG is set. Use e.g., in test application to "assert" conditions, in order to prevent a different compilation mode (a release build?) from making the test non-functional.
Otherwise, the macro expect() prints an error message to standard error and terminates the application by calling core_panic().
The purpose of this macro is to help programmers find bugs in their programs.
A failed condition generates output similar to:
*** RIOT kernel panic:
Where 0x89abcdef is an address. This address can be used with tools like
addr2line (or e.g.
arm-none-eabi-addr2line for ARM-based code),
gdb (with the command
info line *(0x89abcdef)) to identify the line the condition failed in.
Definition at line 83 of file expect.h.