From 79abed393f7c92255a1263c5ef3694befbea6812 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 15 Aug 2013 11:55:32 +0200 Subject: [PATCH] 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 --- lib/drmtest.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/drmtest.h b/lib/drmtest.h index d246b7d..424fd04 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); -- 2.7.4