mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 09:26:10 +00:00
lib: Add a igt_assert_cmpint()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
parent
ffa2107abc
commit
5a97ea91e1
@ -192,6 +192,20 @@ void igt_exit(void) __attribute__((noreturn));
|
||||
do { if (!(expr)) \
|
||||
__igt_fail_assert(99, __FILE__, __LINE__, __func__, #expr , f); \
|
||||
} while (0)
|
||||
/**
|
||||
* igt_assert_cmptint
|
||||
*
|
||||
* Like igt_assert(), but displays the values being compared on failure.
|
||||
*/
|
||||
#define igt_assert_cmpint(n1, cmp, n2) \
|
||||
do { \
|
||||
int __n1 = (n1), __n2 = (n2); \
|
||||
if (__n1 cmp __n2) ; else \
|
||||
__igt_fail_assert(99, __FILE__, __LINE__, __func__, \
|
||||
#n1 " " #cmp " " #n2, \
|
||||
"error: %d %s %d\n", __n1, #cmp, __n2); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* igt_require - skip a (sub-)test if a condition is not met
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user