[Intel-gfx] [PATCH 1/3] lib/igt_core: Add igt_assert_eq

Daniel Vetter daniel.vetter at ffwll.ch
Fri Jun 13 11:18:07 CEST 2014


Suggested by Chris Wilson. Not yet rolled out since I'm trying to use
cocci for this.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 lib/igt_core.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/igt_core.h b/lib/igt_core.h
index f7f7015a32f5..b54ef61565d0 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -253,6 +253,19 @@ void igt_exit(void) __attribute__((noreturn));
 	} while (0)
 
 /**
+ * igt_assert_eq:
+ * @n1: first integer
+ * @n2: second integer
+ *
+ * Fails (sub-)test if the two integers are not equal. Beware that for now this
+ * only works on integers.
+ *
+ * Like igt_assert(), but displays the values being compared on failure instead
+ * of simply printing the stringified expression.
+ */
+#define igt_assert_eq(n1, n2) igt_assert_cmpint(n1, ==, n2)
+
+/**
  * igt_require:
  * @expr: condition to test
  *
-- 
2.0.0




More information about the Intel-gfx mailing list