From f45685d3373f6d755bf3cb4100f148715d669379 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Thu, 2 Aug 2018 13:03:49 +0200 Subject: tests/kms_pipe_crc_basic: expect setting bad source to fail, v2. Now crc-core framework verifies the source string passed by the user. So setting bad-source will fail. Expect file write to fail in bad-source subtest of kms_pipe_crc_basic. Signed-off-by: Mahesh Kumar Reviewed-by: Maarten Lankhorst #v1 Changes since v1: - Allow bad-source to succeed with current and future behavior. (mlankhorst) - Test that errno is set to EINVAL. Signed-off-by: Maarten Lankhorst [mlankhorst: Modified test to work with both behaviors, as long as errno is set to EINVAL] Reviewed-by: Mahesh Kumar --- tests/kms_pipe_crc_basic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/kms_pipe_crc_basic.c') diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c index 235fdc38..920eb6e0 100644 --- a/tests/kms_pipe_crc_basic.c +++ b/tests/kms_pipe_crc_basic.c @@ -48,8 +48,11 @@ static struct { static void test_bad_source(data_t *data) { - igt_assert(igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo")); - igt_assert(openat(data->debugfs, "crtc-0/crc/data", O_WRONLY) == -1); + errno = 0; + if (igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo")) + igt_assert(openat(data->debugfs, "crtc-0/crc/data", O_WRONLY) == -1); + + igt_assert_eq(errno, EINVAL); } #define N_CRCS 3 -- cgit v1.2.3