From 0045085c632a1cf5b4e9272304ee0e61ff9a7e6f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 3 Oct 2017 12:46:10 +0100 Subject: lib: Report the error from __gem_create() We have two style of ioctl wrappers. The principle interface does error checking on behalf of the caller (to avoid having lots of repetitious code in each test), and for the few cases where the error is important for the test, we also expose a double underscore version. Fix up __gem_create() to follow this pattern and report the negative error code returned by the kernel. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen --- tests/gem_create.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/gem_create.c') diff --git a/tests/gem_create.c b/tests/gem_create.c index de7b8209..25c5e808 100644 --- a/tests/gem_create.c +++ b/tests/gem_create.c @@ -95,10 +95,9 @@ static void invalid_flag_test(int fd) static void invalid_size_test(int fd) { - int handle; + uint32_t handle; - handle = __gem_create(fd, 0); - igt_assert(!handle); + igt_assert_eq(__gem_create(fd, 0, &handle), -EINVAL); } /* -- cgit v1.2.3