diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-06-26 11:41:44 +0100 |
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-06-26 11:49:38 +0100 |
| commit | f78574101ffc3388ba7a948a6f5310358cdeaab2 (patch) | |
| tree | 62b58a296ed6ebbcf3daedf322633440f8de6e6e /tests | |
| parent | c69b13578399915f71f4ccc10cae188c31381c6a (diff) | |
igt/gem_fenced_exec_thrash: Tidy testing of expected execbuf errors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gem_fenced_exec_thrash.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c index c0e820f8..81cdff82 100644 --- a/tests/gem_fenced_exec_thrash.c +++ b/tests/gem_fenced_exec_thrash.c @@ -145,6 +145,14 @@ static void fill_reloc(struct drm_i915_gem_relocation_entry *reloc, uint32_t han reloc->write_domain = 0; } +static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *eb) +{ + int err = 0; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, eb)) + err = errno; + return err; +} + #define BUSY_LOAD (1 << 0) #define INTERRUPTIBLE (1 << 1) @@ -193,24 +201,11 @@ static void run_test(int fd, int num_fences, int expected_errno, } do { - int ret; - if (flags & BUSY_LOAD) emit_dummy_load(); - ret = drmIoctl(fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf[0]); - igt_assert(expected_errno ? - ret < 0 && errno == expected_errno : - ret == 0); - - ret = drmIoctl(fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf[1]); - igt_assert(expected_errno ? - ret < 0 && errno == expected_errno : - ret == 0); + igt_assert_eq(__gem_execbuf(fd, &execbuf[0]), expected_errno); + igt_assert_eq(__gem_execbuf(fd, &execbuf[1]), expected_errno); } while (--loop); if (flags & INTERRUPTIBLE) |
