summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-04 13:19:42 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-04 13:19:42 +0200
commit5113df7891e7ca323bd74449b7d649d5bd0b80a9 (patch)
treebed802b25c4bd94294a88e414e2fe95bd5b6d946 /lib
parent1f9d201be404fc277680d416d11f0d2d0d97f2cb (diff)
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 <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/drmtest.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 663e309a..f55825e7 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);