pan/bi: Add BIT_ASSERT helper for unit testing

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12109>
This commit is contained in:
Alyssa Rosenzweig 2021-07-28 12:25:39 -04:00 committed by Marge Bot
parent 9358d1fca6
commit ca36943466
1 changed files with 9 additions and 0 deletions

View File

@ -84,4 +84,13 @@ bit_instr_equal(bi_instr *A, bi_instr *B)
} \
} while(0)
#define BIT_ASSERT(condition) do { \
if (condition) { \
nr_pass++; \
} else { \
fprintf(stderr, "Assertion failed: %s\n", #condition); \
nr_fail++; \
} \
} while(0)
#endif