summaryrefslogtreecommitdiff
path: root/lib/drmtest.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-15 11:55:32 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-15 14:01:10 +0200
commit79abed393f7c92255a1263c5ef3694befbea6812 (patch)
treee95c0e44611ffc764994f50e59919f4db84a5fcc /lib/drmtest.h
parent610630622b4f5f9570f6faf136a0273535728536 (diff)
lib/drmtest: Use igt_assert in the do_ioctl/do_or_die helpers
abort results in "crash" test results in the piglit runner, igt gives us neater output. The downside is that we can now only use these in igt tests, but that's already the case (and given their placement in drmtest.h their intended use-case, too). Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/drmtest.h')
-rw-r--r--lib/drmtest.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/drmtest.h b/lib/drmtest.h
index d246b7d1..424fd04c 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -287,17 +287,8 @@ const char *kmstest_connector_type_str(int type);
uint32_t drm_format_to_bpp(uint32_t drm_format);
-inline static void _do_or_die(const char *function, int line, int ret)
-{
- if (ret == 0)
- return;
-
- fprintf(stderr, "%s:%d failed, ret=%d, errno=%d\n",
- function, line, ret, errno);
- abort();
-}
-#define do_or_die(x) _do_or_die(__FUNCTION__, __LINE__, x)
-#define do_ioctl(fd, ptr, sz) do_or_die(drmIoctl((fd), (ptr), (sz)))
+#define do_or_die(x) igt_assert((x) == 0)
+#define do_ioctl(fd, ptr, sz) igt_assert(drmIoctl((fd), (ptr), (sz)) == 0)
typedef void (*igt_exit_handler_t)(int sig);