diff mbox

[i-g-t] tests/gem_userptr_blits: test zero user_size

Message ID 20180502191700.28973-1-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Auld May 2, 2018, 7:17 p.m. UTC
Check that the kernel rejects a zero user_size.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_userptr_blits.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Chris Wilson May 2, 2018, 7:20 p.m. UTC | #1
Quoting Matthew Auld (2018-05-02 20:17:00)
> Check that the kernel rejects a zero user_size.
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>

Bleurgh, ugly looking test.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox

Patch

diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index 849054ad..7e3b6ef3 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -442,6 +442,14 @@  static int test_input_checking(int fd)
 	ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr);
 	igt_assert_neq(ret, 0);
 
+	/* Zero user_size. */
+	memset(&userptr, 0, sizeof(userptr));
+	userptr.user_ptr = 0;
+	userptr.user_size = 0;
+	userptr.flags = 0;
+	ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr);
+	igt_assert_neq(ret, 0);
+
 	return 0;
 }