summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-27 16:24:25 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-27 16:24:25 +0100
commit305fb1db5c1ec231b1cef3fd4c2106bc36ef48d8 (patch)
tree35697b7bd5786198afb3eaaf79b78b6ba9275954
parente3f8eb58e64954f80207ff147de3eccba96769cd (diff)
lib: add igt_assert_lt
Found one user in gem_wait.c Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r--lib/igt_core.h13
-rw-r--r--tests/gem_wait.c2
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h
index cc73a712..c2c820d1 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -382,6 +382,19 @@ void igt_exit(void) __attribute__((noreturn));
#define igt_assert_lte(n1, n2) igt_assert_cmpint(n1, <=, >, n2)
/**
+ * igt_assert_lt:
+ * @n1: first integer
+ * @n2: second integer
+ *
+ * Fails (sub-)test if the second integers is strictly smaller than the first.
+ * 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_lt(n1, n2) igt_assert_cmpint(n1, <, >=, n2)
+
+/**
* igt_require:
* @expr: condition to test
*
diff --git a/tests/gem_wait.c b/tests/gem_wait.c
index 39d20b01..46b381b9 100644
--- a/tests/gem_wait.c
+++ b/tests/gem_wait.c
@@ -157,7 +157,7 @@ static void render_timeout(int fd)
iter <<= 1;
} while (!done && iter < 1000000);
- igt_assert_cmpint(iter, <, >=, 1000000);
+ igt_assert_lt(iter, 1000000);
igt_info("%d iters is enough work\n", iter);
gem_quiescent_gpu(fd);