[igt-dev] [PATCH i-g-t 7/9] tests/kms_lease: Adjust to kernel errno changes

Daniel Vetter daniel.vetter at ffwll.ch
Thu Feb 28 14:19:16 UTC 2019


I dropped a superfluous check for negative object id (the kernel
did a cast to s32, despite that object ids are always unsigned).
Which changes the errno from EINVAL to ENOENT. Allow both.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 tests/kms_lease.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/kms_lease.c b/tests/kms_lease.c
index 7930d0737ace..7d7576cbb634 100644
--- a/tests/kms_lease.c
+++ b/tests/kms_lease.c
@@ -713,6 +713,10 @@ static void lease_again(data_t *data)
 	terminate_lease(&lease_b);
 }
 
+#define assert_unleased(ret) \
+	igt_assert_f((ret) == -EINVAL || (ret) == -ENOENT, \
+		     "wrong return code %i, %s\n", ret, \
+		     strerror(ret))
 /* Test leasing an invalid connector */
 static void lease_invalid_connector(data_t *data)
 {
@@ -725,7 +729,7 @@ static void lease_invalid_connector(data_t *data)
 	data->connector_id = 0xbaadf00d;
 	ret = make_lease(data, &lease);
 	data->connector_id = save_connector_id;
-	igt_assert_eq(ret, -EINVAL);
+	assert_unleased(ret);
 }
 
 /* Test leasing an invalid crtc */
@@ -740,7 +744,7 @@ static void lease_invalid_crtc(data_t *data)
 	data->crtc_id = 0xbaadf00d;
 	ret = make_lease(data, &lease);
 	data->crtc_id = save_crtc_id;
-	igt_assert_eq(ret, -EINVAL);
+	assert_unleased(ret);
 }
 
 static void lease_invalid_plane(data_t *data)
@@ -754,7 +758,7 @@ static void lease_invalid_plane(data_t *data)
 	data->plane_id = 0xbaadf00d;
 	ret = make_lease(data, &lease);
 	data->plane_id = save_plane_id;
-	igt_assert_eq(ret, -EINVAL);
+	assert_unleased(ret);
 }
 
 
-- 
2.14.4



More information about the igt-dev mailing list