summaryrefslogtreecommitdiff
path: root/tests/i915
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-05-31 15:01:53 +0300
committerSimon Ser <simon.ser@intel.com>2019-06-06 10:28:02 +0300
commitf354607cee4baef103f209cc1cc13bbab7def386 (patch)
treed22c4699a20f4c2075395ce887004bcd0a18f5fa /tests/i915
parenteabd43908205dd4ca6ce1e568cbd5459f3d904f5 (diff)
tests/i915/gem_mmap: fix bad-object tests error value
These tests checked for EINVAL, but the correct error value is ENOENT, as pointed out by Chris Wilson: commit bf79cb914dbfe848add8bb76cbb8ff89110d29ff Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Aug 4 14:19:46 2010 +0100 drm: Use ENOENT consistently for the error return for an unmatched handle. This is consistent with trying to access a filename that not exist within a directory which is a good analogy here. The main reason for the change is that it is easy to confuse the error code of EBADF as an performing an ioctl on an invalid file descriptor (rather than an unknown object). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com> This commit fixes the two bad tests (the gem_mmap_gtt test already checks for ENOENT). Signed-off-by: Simon Ser <simon.ser@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r--tests/i915/gem_mmap.c2
-rw-r--r--tests/i915/gem_mmap_wc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index c96aa2c0..f8cf052e 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -173,7 +173,7 @@ igt_main
};
igt_debug("Trying MMAP IOCTL with handle %x\n", handles[i]);
- igt_assert_eq(mmap_ioctl(fd, &arg), -EINVAL);
+ igt_assert_eq(mmap_ioctl(fd, &arg), -ENOENT);
}
gem_close(fd, real_handle);
diff --git a/tests/i915/gem_mmap_wc.c b/tests/i915/gem_mmap_wc.c
index 63538f79..c9e5bf23 100644
--- a/tests/i915/gem_mmap_wc.c
+++ b/tests/i915/gem_mmap_wc.c
@@ -510,7 +510,7 @@ igt_main
.size = 4096,
.flags = I915_MMAP_WC,
};
- igt_assert_eq(mmap_ioctl(fd, &arg), -EINVAL);
+ igt_assert_eq(mmap_ioctl(fd, &arg), -ENOENT);
}
gem_close(fd, real_handle);