Module: Mesa
Branch: main
Commit: ca36943466b3422c66964467d27f8f1e6994a382
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca36943466b3422c66964467d27f8f1e6994a382

Author: Alyssa Rosenzweig <[email protected]>
Date:   Wed Jul 28 12:25:39 2021 -0400

pan/bi: Add BIT_ASSERT helper for unit testing

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12109>

---

 src/panfrost/bifrost/bi_test.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/panfrost/bifrost/bi_test.h b/src/panfrost/bifrost/bi_test.h
index e4df7a2884c..4d93eeafd0c 100644
--- a/src/panfrost/bifrost/bi_test.h
+++ b/src/panfrost/bifrost/bi_test.h
@@ -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

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to