mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-20 14:26:17 +00:00
lib/igt_core: Add igt_assert_fd
Skip open-coding and assert that fds are valid. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
715a17bb35
commit
6ead44d70b
@ -506,6 +506,18 @@ void igt_exit(void) __attribute__((noreturn));
|
|||||||
*/
|
*/
|
||||||
#define igt_assert_lt(n1, n2) igt_assert_cmpint(n1, <, >=, n2)
|
#define igt_assert_lt(n1, n2) igt_assert_cmpint(n1, <, >=, n2)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* igt_assert_fd:
|
||||||
|
* @fd: file descriptor
|
||||||
|
*
|
||||||
|
* Fails (sub-) test if the given file descriptor is invalid.
|
||||||
|
*
|
||||||
|
* Like igt_assert(), but displays the values being compared on failure instead
|
||||||
|
* of simply printing the stringified expression.
|
||||||
|
*/
|
||||||
|
#define igt_assert_fd(fd) \
|
||||||
|
igt_assert_f(fd >= 0, "file descriptor " #fd " failed\n");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* igt_require:
|
* igt_require:
|
||||||
* @expr: condition to test
|
* @expr: condition to test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user