diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-10-03 12:46:10 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-10-03 14:37:44 +0100 |
commit | 0045085c632a1cf5b4e9272304ee0e61ff9a7e6f (patch) | |
tree | b98c60b8ea7eaeba2af79c0f642ebd497c1dd7ed /tests/gem_create.c | |
parent | 08a2f887b26c89cfb1e1b5715a23d561b75e0dab (diff) |
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 <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'tests/gem_create.c')
-rw-r--r-- | tests/gem_create.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); } /* |