mt_fail(3)
bofc manual pages
mt_fail(3)
NAME
mt_assert, mt_fail - test checks macros
SYNOPSIS
c/c++
#include <mtest.h>
mt_assert(expression)
mt_fail(expression)
shell
DESCRIPTION
Macro mt_assert(3) evaluates expression and if it evaluates to false, test will be marked as failed and information about assert will be printed. Information contains function_name, line where assert occured, and expression that caused test to fail. Also macro forces function it was called in to immediately return.
mt_fail(3) works just as mt_assert(3) but function is not forced to exit and can continue execution. This is good when test allocates some memory and we need to clean up before returning.
EXAMPLE
Proper example can be found in mtest_overview(7).
SEE ALSO
mt_defs(3), mt_defs_ext(3), mt_run(3), mt_run_named(3), mt_fok(3), mt_ferr(3), mt_return(3), mtest_overview(7)
3 September 2018 (1.1.3)
mt_fail(3)