diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-24 23:56:04 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-25 00:20:43 +0000 |
commit | 947f5d8037cafbff3cee0c36219a26f25c5e5204 (patch) | |
tree | 2a41d08bca45fbeafb2498f8c03942db39ff3fc0 /tests/kms_pipe_crc_basic.c | |
parent | 4e8b533fe82cb14dde9c730e10e77a4436c28741 (diff) |
igt/kms_pipe_crc_basic: Fix assertion for bad commands
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/kms_pipe_crc_basic.c')
-rw-r--r-- | tests/kms_pipe_crc_basic.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c index a6996d43..45da200d 100644 --- a/tests/kms_pipe_crc_basic.c +++ b/tests/kms_pipe_crc_basic.c @@ -28,10 +28,12 @@ #include <stdbool.h> #include <stdio.h> #include <string.h> +#include <fcntl.h> typedef struct { int drm_fd; + int debugfs; igt_display_t display; struct igt_fb fb; } data_t; @@ -46,18 +48,15 @@ static struct { static void test_bad_command(data_t *data, const char *cmd) { - int dir = igt_debugfs_dir(data->drm_fd); - - igt_require(igt_sysfs_set(dir, "i915_display_crc_ctl", cmd)); - close(dir); + igt_assert(!igt_sysfs_set(data->debugfs, "i915_display_crc_ctl", cmd)); + igt_skip_on(errno == ENOENT); + igt_assert(errno == EINVAL); } static void test_bad_source(data_t *data) { - int dir = igt_debugfs_dir(data->drm_fd); - - igt_require(igt_sysfs_set(dir, "crtc-0/crc/control", "foo")); - close(dir); + igt_assert(igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo")); + igt_assert(openat(data->debugfs, "crtc-0/crc/data", O_WRONLY) == -1); } #define N_CRCS 3 @@ -192,6 +191,7 @@ igt_main igt_require_pipe_crc(data.drm_fd); igt_display_init(&data.display, data.drm_fd); + data.debugfs = igt_debugfs_dir(data.drm_fd); } igt_subtest("bad-pipe") |