test_success = FALSE;
}
+void test_assert_failed_ucmp_intmax_idx(const char *code, const char *file,
+ unsigned int line,
+ uintmax_t src, uintmax_t dst,
+ const char *op, long long i)
+{
+ printf("%s:%u: Assert", file, line);
+ if (i == LLONG_MIN)
+ printf(" failed: %s\n", code);
+ else
+ printf("(#%lld) failed: %s\n", i, code);
+ printf(" %ju %s %ju is not true\n", src, op, dst);
+ fflush(stdout);
+ test_success = FALSE;
+}
+
#ifdef DEBUG
#include "randgen.h"
static void
#_op, _idx); \
} STMT_END
+#define test_assert_ucmp(_value1, _op, _value2) \
+ test_assert_ucmp_idx(_value1, _op, _value2, LLONG_MIN)
+#define test_assert_ucmp_idx(_value1, _op, _value2, _idx) STMT_START { \
+ uintmax_t _temp_value1 = (_value1); \
+ uintmax_t _temp_value2 = (_value2); \
+ if (!(_value1 _op _value2)) \
+ test_assert_failedu_cmp_intmax_idx( \
+ #_value1 " " #_op " " #_value2, \
+ __FILE__, __LINE__, _temp_value1, _temp_value2, \
+ #_op, _idx); \
+ } STMT_END
+
void test_assert_failed(const char *code, const char *file, unsigned int line);
void test_assert_failed_idx(const char *code, const char *file, unsigned int line, long long i);
void test_assert_failed_strcmp_idx(const char *code, const char *file, unsigned int line,
unsigned int line,
intmax_t src, intmax_t dst,
const char *op, long long i);
+void test_assert_failed_ucmp_intmax_idx(const char *code, const char *file,
+ unsigned int line,
+ uintmax_t src, uintmax_t dst,
+ const char *op, long long i);
bool test_has_failed(void);
/* If you're testing nasty cases which you want to warn, surround the noisy op with these */
void test_expect_errors(unsigned int expected);