From 4cf1d089ebc83ca21abbc9714bcebecf8a759714 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 7 Nov 2013 13:43:43 +0100 Subject: [PATCH] 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 --- tests/gem_reloc_overflow.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c index 38ad2a5..537e32b 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") { -- 2.7.4