summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-11-07 13:43:43 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-11-07 13:43:43 +0100
commit4cf1d089ebc83ca21abbc9714bcebecf8a759714 (patch)
tree293aedba91b854582b1578cf917fd88317ee2c17 /tests
parentc537c23efc8173d6526236b6b311ac44c10a14af (diff)
tests/gem_reloc_overflow: Polish after Rafael's patch
- use void* for generic pointer. - Fix const usage. - Shut up gcc about uninitizialized var. - Be paranoid about the moved tests and make double-sure that the batch would indeed work safe for the condition being tested. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_reloc_overflow.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c
index 38ad2a52..537e32ba 100644
--- a/tests/gem_reloc_overflow.c
+++ b/tests/gem_reloc_overflow.c
@@ -64,8 +64,8 @@ uint32_t batch_handle;
static void source_offset_tests(int devid, bool reloc_gtt)
{
struct drm_i915_gem_relocation_entry single_reloc;
- char *dst_gtt;
- char *relocation_type;
+ void *dst_gtt;
+ const char *relocation_type = "";
igt_fixture {
handle = gem_create(fd, 8192);
@@ -214,6 +214,12 @@ static void reloc_tests(void)
execobjs[0].relocs_ptr = 0;
execbuf.buffer_count = 1;
+
+ /* Make sure the batch would succeed except for the thing we're
+ * testing. */
+ execbuf.batch_start_offset = 0;
+ execbuf.batch_len = 8;
+ igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf) == 0);
}
igt_subtest("batch-start-unaligned") {