improve tests and debuggability

This commit is contained in:
Sergio R. Caprile committed 2024-12-30 12:25:27 -03:00
1 parent f95283e341
commit 6d0320be06
9 files changed
+100 -68

No files matched your search

+9 -1
View File
@@ -8,12 +8,20 @@ static int s_num_tests = 0;
static bool s_sent_fragment = 0;
static int s_seg_sent = 0;
#ifdef NO_SLEEP_ABORT
#define ABORT() abort()
#else
#define ABORT() \
sleep(2); /* 2s, GH print reason */ \
abort();
#endif
#define ASSERT(expr) \
do { \
s_num_tests++; \
if (!(expr)) { \
printf("FAILURE %s:%d: %s\n", __FILE__, __LINE__, #expr); \
abort(); \
ABORT(); \
} \
} while (0)