From 5113df7891e7ca323bd74449b7d649d5bd0b80a9 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 4 Sep 2013 13:19:42 +0200 Subject: [PATCH] lib/drmtest: add igt_skip_on macro I've fumbled the logic inversion when converting to igt_require way too often, so lets add something for dummies like me ;-) Signed-off-by: Daniel Vetter --- lib/drmtest.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/drmtest.h b/lib/drmtest.h index 663e309..f55825e 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -186,7 +186,8 @@ void igt_exit(void) __attribute__((noreturn)); * This is useful to streamline the skip logic since it allows for a more flat * code control flow. */ -#define igt_require(expr) do { if (!(expr)) __igt_skip_check(__FILE__, __LINE__, __func__, #expr ); } while (0) +#define igt_require(expr) igt_skip_on(!(expr)) +#define igt_skip_on(expr) do { if ((expr)) __igt_skip_check(__FILE__, __LINE__, __func__, #expr ); } while (0) bool __igt_fixture(void); void __igt_fixture_complete(void); -- 2.7.4