diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-22 09:34:52 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-22 09:34:52 +0200 |
| commit | 95018d0e410c22fc56a6518d967be25428e3a6ed (patch) | |
| tree | 9bb0157a888f1c7ed1904a636d3a733d942dcccd /testing.h | |
| parent | 13fdee74dc28f0b068503843c6e14071a7c339f2 (diff) | |
feat(json): Float parsing
Diffstat (limited to 'testing.h')
| -rw-r--r-- | testing.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; \ } |
