1.1. assert
— Assertions¶
Source code: src/kernel/assert.h
Defines
-
FATAL
(n) (-n)¶
-
IS_FATAL
(n) (n < 0)¶ Check is an error code is fatal (negative error code).
-
ASSERT
(cond, ...) ASSERTNR(cond, EASSERT, FATAL(EASSERT), __VA_ARGS__)¶ Assert given condition and print an error message on assertion failure. Call the system on fatal callback with error code
EASSERT
on fatal error, otherwise return NULL.
-
ASSERTN
(cond, n, ...) ASSERTNR(cond, n, FATAL(n), __VA_ARGS__)¶ Assert given condition and print an error message on assertion failure. Call the system on fatal callback with given error code
n
on fatal error, otherwise return the error code negated.
-
ASSERTRV
(cond, ...) ASSERTNRV(cond, EASSERT, __VA_ARGS__)¶ Assert given condition and print an error message on assertion failure. Call the system on fatal callback with error code
EASSERT
on fatal error, otherwise return NULL.
-
ASSERTRN
(cond, ...) ASSERTNR(cond, EASSERT, NULL, __VA_ARGS__)¶ Assert given condition and print an error message on assertion failure. Call the system on fatal callback with error code
EASSERT
on fatal error, otherwise return NULL.
-
ASSERTNR
(cond, n, ...)¶ Assert given condition and print an error message. Call the system on fatal callback with given error code
n
on fatal error, otherwise return given error coderes
.
-
ASSERTNRV
(cond, n, ...)¶ Assert given condition and print an error message on assertion failure. Call the system on fatal callback with given error code
n
on fatal error, otherwise return.
-
ASSERTNRN
(cond, n, ...) ASSERTNR(cond, n, NULL, __VA_ARGS__)¶ Assert given condition and print an error message on assertion failure. Call the system on fatal callback with given error code
n
on fatal error, otherwise return NULL.
-
FATAL_ASSERTN
(cond, n, ...)¶ Assert given condition and print an error message on assertion failure, then call the system on fatal callback with given error code
n
.This assertion is not affected by
CONFIG_ASSERT
, but insteadCONFIG_FATAL_ASSERT
.
-
FATAL_ASSERT
(cond, ...) FATAL_ASSERTN(cond, EASSERT, __VA_ARGS__)¶ Assert given condition and print an error message on assertion failure, then call the system on fatal callback with error code
EASSERT
.This assertion is not affected by
CONFIG_ASSERT
, but insteadCONFIG_FATAL_ASSERT
.
-
PANIC_ASSERTN
(cond, n, ...)¶ Assert given condition and call
sys_panic()
with given error coden
on assertion failure.This assertion is not affected by
CONFIG_ASSERT
, but insteadCONFIG_PANIC_ASSERT
.
-
PANIC_ASSERT
(cond, ...) PANIC_ASSERTN(cond, EASSERT, __VA_ARGS__)¶ Assert given condition and call
sys_panic()
with error codeEASSERT
.This assertion is not affected by
CONFIG_ASSERT
, but insteadCONFIG_PANIC_ASSERT
.