diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-03-29 14:11:28 +0100 |
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-03-29 14:13:05 +0100 |
| commit | b9b82fdc5fdcbc43d0720b6aaf79e1f00f407d3a (patch) | |
| tree | fa6ef998b17afbb0e3a2f9489cc22b83ad846693 /tests | |
| parent | a1e4ec4a68ff1144249aa2f98c6834d296ee2061 (diff) | |
igt/gem_exec_parse: Use a macro for pretty printing the test failure
By moving the assert up a level, we get an much improved assertion
failure message (e.g. it includes the batch string that fails).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gem_exec_parse.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index fff166a4..6105f496 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -103,8 +103,8 @@ static void exec_batch_patched(int fd, uint32_t cmd_bo, uint32_t *cmds, gem_close(fd, target_bo); } -static void exec_batch(int fd, uint32_t cmd_bo, uint32_t *cmds, - int size, int ring, int expected_ret) +static int __exec_batch(int fd, uint32_t cmd_bo, uint32_t *cmds, + int size, int ring) { struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 objs[1]; @@ -132,10 +132,10 @@ static void exec_batch(int fd, uint32_t cmd_bo, uint32_t *cmds, i915_execbuffer2_set_context_id(execbuf, 0); execbuf.rsvd2 = 0; - igt_assert_eq(__gem_execbuf(fd, &execbuf), expected_ret); - - gem_sync(fd, cmd_bo); + return __gem_execbuf(fd, &execbuf); } +#define exec_batch(fd, bo, cmds, sz, ring, expected) \ + igt_assert_eq(__exec_batch(fd, bo, cmds, sz, ring), expected) static void exec_split_batch(int fd, uint32_t *cmds, int size, int ring, int expected_ret) |
