vendor/scs/test/minunit.h in scs-0.2.3 vs vendor/scs/test/minunit.h in scs-0.3.0

- old
+ new

@@ -1,13 +1,22 @@ /* Taken from http://www.jera.com/techinfo/jtns/jtn002.html */ /* Simple Macros for testing */ -#define mu_assert(message, test) \ - do { \ - if (!(test)) return message; \ +#define mu_assert_less(message, a, b) \ + do { \ + if (a > b) { \ + scs_printf("%s: %1.3e > %1.3e\n", message, a, b); \ + return message; \ + } \ } while (0) -#define mu_run_test(test) \ - do { \ - const char *message = test(); \ - tests_run++; \ - if (message) return message; \ +#define mu_assert(message, test) \ + do { \ + if (!(test)) \ + return message; \ + } while (0) +#define mu_run_test(test) \ + do { \ + const char *message = test(); \ + tests_run++; \ + if (message) \ + return message; \ } while (0)