diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-08-07 19:27:30 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-08-12 14:46:46 +0200 |
commit | adfc294384d2ee20d085e98f249fe73d1f4c4055 (patch) | |
tree | 89c5c062694d8d9103d3858056895aa2c089f8c6 | |
parent | 5b0a8433fd0ff35062f0b1d3f50f5e04e76b576b (diff) |
tests: Document ABI extension catchers
Our invalid-flags/params testcases are meant to catch abi extensions
by just testing for the next available flag/param. Unfortunately we
need that since without those we forgot to write testcases for these
new flags way too often :(
But it's not entirely clear why this is, so document this trick with
comments.
Also gem_wait wasn't this paranoid, so change the testcase to be so.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r-- | tests/gem_ctx_param_basic.c | 3 | ||||
-rw-r--r-- | tests/gem_exec_params.c | 3 | ||||
-rw-r--r-- | tests/gem_wait.c | 5 |
3 files changed, 10 insertions, 1 deletions
diff --git a/tests/gem_ctx_param_basic.c b/tests/gem_ctx_param_basic.c index 1e7e8ff4..430a53b2 100644 --- a/tests/gem_ctx_param_basic.c +++ b/tests/gem_ctx_param_basic.c @@ -149,6 +149,9 @@ igt_main TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); } + /* NOTE: This testcase intentionally tests for the next free parameter + * to catch ABI extensions. Don't "fix" this testcase without adding all + * the tests for the new param first. */ ctx_param.param = LOCAL_CONTEXT_PARAM_NO_ZEROMAP + 1; igt_subtest("invalid-param-get") { diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c index e9c13a40..b33a7408 100644 --- a/tests/gem_exec_params.c +++ b/tests/gem_exec_params.c @@ -221,6 +221,9 @@ igt_main /* HANDLE_LUT and NO_RELOC are already exercised by gem_exec_lut_handle */ igt_subtest("invalid-flag") { + /* NOTE: This test intentionally exercise the next available + * flag. Don't "fix" this testcase without adding the required + * tests for the new flag first. */ execbuf.flags = I915_EXEC_RENDER | (LOCAL_I915_EXEC_RESOURCE_STREAMER << 1); RUN_FAIL(EINVAL); } diff --git a/tests/gem_wait.c b/tests/gem_wait.c index 958bf93f..a785b16e 100644 --- a/tests/gem_wait.c +++ b/tests/gem_wait.c @@ -236,7 +236,10 @@ static void invalid_flags(int fd) wait.bo_handle = handle; wait.timeout_ns = 1; - wait.flags = 0xffffffff; + /* NOTE: This test intentionally tests for just the next available flag. + * Don't "fix" this testcase without the ABI testcases for new flags + * first. */ + wait.flags = 1; ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_WAIT, &wait); igt_assert(ret != 0 && errno == EINVAL); |