summaryrefslogtreecommitdiff
path: root/lib/igt_core.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-13 10:46:55 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-13 11:17:04 +0200
commit3448b5ad4b2536c1eca3ecc5060739ea8dbec1e5 (patch)
tree5dff5926813d86c2ac06ae42bbc8aaa0a4acd4d9 /lib/igt_core.h
parentb4c1f2ea0fc3fc3e361c26a83dc9468682a3c8e0 (diff)
lib/igt_core: Add igt_assert_eq
Suggested by Chris Wilson. Not yet rolled out since I'm trying to use cocci for this. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/igt_core.h')
-rw-r--r--lib/igt_core.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h
index f7f7015a..b54ef615 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
*