summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-19 14:19:07 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-19 14:19:47 +0100
commite56754965fad7c53130cecd26a91b841e22a8ab9 (patch)
tree24f94038433de82f19f10dca29f8adc438fc3eb7
parent5bb0897f73b2e42a32338432ae198289f6f8b91c (diff)
gem_lut_handle: Print some more information upon failure
References: https://bugs.freedesktop.org/show_bug.cgi?id=65391
-rw-r--r--tests/gem_lut_handle.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c
index ebc68dfd..d755e43a 100644
--- a/tests/gem_lut_handle.c
+++ b/tests/gem_lut_handle.c
@@ -169,8 +169,15 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsign
}
#define _fail(x) ((x) == -1 && errno == ENOENT)
-#define fail(x) assert(_fail(x))
-#define pass(x) assert(!_fail(x))
+#define ASSERT(x) do { \
+ if (!(x)) { \
+ fprintf(stderr, "%s:%d failed, errno=%d\n", \
+ __FUNCTION__, __LINE__, errno); \
+ abort(); \
+ } \
+} while (0)
+#define fail(x) ASSERT(_fail(x))
+#define pass(x) ASSERT(!_fail(x))
int main(int argc, char **argv)
{