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>
This commit is contained in:
Chris Wilson 2015-03-29 14:11:28 +01:00
parent a1e4ec4a68
commit b9b82fdc5f

View File

@ -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)