[PATCH i-g-t] lib: add igt_assert_lt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Found one user in gem_wait.c

Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
---
 lib/igt_core.h   | 13 +++++++++++++
 tests/gem_wait.c |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.h b/lib/igt_core.h
index cc73a712bb7b..c2c820d14c9f 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 39d20b01080c..46b381b9419e 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);
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux