Add assert_return to use in testcases instead of assert. The issues
with assert are:
1) It's disabled when NDEBUG is defined
2) Even if it's well supported by testsuite (the parent will
report the child died) it can't output any meaningful
error message
#define WARN(fmt, ...) _LOG("WARN: ", fmt, ## __VA_ARGS__)
#define ERR(fmt, ...) _LOG("ERR: ", fmt, ## __VA_ARGS__)
+#define assert_return(expr, r) \
+ do { \
+ if ((!(expr))) { \
+ ERR("Failed assertion: " #expr, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ return (r); \
+ } \
+ } while (false)
+
+
/* Test definitions */
#define DEFINE_TEST(_name, ...) \
const struct test s##_name = { \