From 95018d0e410c22fc56a6518d967be25428e3a6ed Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 22 Jul 2025 09:34:52 +0200 Subject: feat(json): Float parsing --- testing.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'testing.h') diff --git a/testing.h b/testing.h index d7247f1..9e0c022 100644 --- a/testing.h +++ b/testing.h @@ -11,6 +11,14 @@ if (!(a == b)) { \ fprintf(stderr, \ "Assertion failed: %d (%s) != %d (%s) at %s:%d in %s()\n", \ - (int)a, #a, (int)b, #b, __FILE__, __LINE__, __func__); \ + (i32)a, #a, (i32)b, #b, __FILE__, __LINE__, __func__); \ + return 1; \ + } + +#define t_assert_fequal(a, b) \ + if ((a - b) > 1e-6 || (b - a) > 1e-6) { \ + fprintf(stderr, \ + "Assertion failed: %f (%s) != %f (%s) at %s:%d in %s()\n", a, \ + #a, b, #b, __FILE__, __LINE__, __func__); \ return 1; \ } -- cgit v1.3