1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2024-11-12 01:10:49 +01:00

test/check: Add check_failed func

This commit is contained in:
icex2 2019-10-06 21:20:39 +02:00
parent c5d39d82d5
commit 77906205b5
2 changed files with 18 additions and 0 deletions

View File

@ -140,3 +140,9 @@ void _Noreturn check_null_failed(const char *file, int line, const char *func,
"\tExpected null value\n\n",
expr);
}
void _Noreturn check_failed(const char *file, int line,
const char *func, char *expr)
{
fail(file, line, func, "\t%s\n", expr);
}

View File

@ -109,6 +109,16 @@
} \
} \
#define check_fail() \
{ \
check_failed(__FILE__, __LINE__, __func__, ""); \
} \
#define check_fail_msg(expr) \
{ \
check_failed(__FILE__, __LINE__, __func__, expr); \
} \
void _Noreturn check_char_eq_failed(const char *file, int line,
const char *func, char *expr, char result, char expected);
void _Noreturn check_char_neq_failed(const char *file, int line,
@ -132,5 +142,7 @@ void _Noreturn check_non_null_failed(const char *file, int line, const char *fun
char *expr);
void _Noreturn check_null_failed(const char *file, int line, const char *func,
char *expr);
void _Noreturn check_failed(const char *file, int line,
const char *func, char *expr);
#endif