From c935c6021449fa442c51858e3d9cd79e1cec62ab Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 25 Aug 2010 11:56:59 +0100 Subject: [PATCH] tests: Fix fallout from s/EBADF/ENOENT/ in 2.6.36 After bf79cb914dbfe848add8bb76cbb8ff89110d29ff, drm uses ENOENT to report unknown handles buffer objects, update the tests accordingly. Fixes: Bug 29794 - some intel_gpu_tools cases fail https://bugs.freedesktop.org/show_bug.cgi?id=29794 Signed-off-by: Chris Wilson --- tests/gem_flink.c | 2 +- tests/gem_mmap.c | 2 +- tests/gem_readwrite.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/gem_flink.c b/tests/gem_flink.c index 4ec98d6d..0b00b1ec 100644 --- a/tests/gem_flink.c +++ b/tests/gem_flink.c @@ -98,7 +98,7 @@ test_bad_flink(int fd) flink.handle = 0x10101010; ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - assert(ret == -1 && errno == EBADF); + assert(ret == -1 && errno == ENOENT); } static void diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c index 57189145..32b7861c 100644 --- a/tests/gem_mmap.c +++ b/tests/gem_mmap.c @@ -76,7 +76,7 @@ int main(int argc, char **argv) mmap.size = 4096; printf("Testing mmaping of bad object.\n"); ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap); - assert(ret == -1 && errno == EBADF); + assert(ret == -1 && errno == ENOENT); memset(&create, 0, sizeof(create)); create.size = OBJECT_SIZE; diff --git a/tests/gem_readwrite.c b/tests/gem_readwrite.c index 26498fb4..e8a2b7e7 100644 --- a/tests/gem_readwrite.c +++ b/tests/gem_readwrite.c @@ -127,11 +127,11 @@ int main(int argc, char **argv) printf("Testing read of bad buffer handle\n"); ret = do_read(fd, 1234, buf, 0, 1024); - assert(ret == -1 && errno == EBADF); + assert(ret == -1 && errno == ENOENT); printf("Testing write of bad buffer handle\n"); ret = do_write(fd, 1234, buf, 0, 1024); - assert(ret == -1 && errno == EBADF); + assert(ret == -1 && errno == ENOENT); close(fd);