From cf64fbe7847859ca11d4722f056d2ebfa8d10177 Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Thu, 1 Jun 2023 17:04:56 -0300 Subject: [PATCH] tests: assert that capture info was received before trying screenshot If the source is not supported, we won't receive the capture information. So the capture info (size/format) will be zeroed, and we fail while trying to create a buffer for the screenshot with size/format zeroed. With this patch we fail if we don't receive the capture info, what makes the failure reason more explicit. Signed-off-by: Leandro Ribeiro --- tests/weston-test-client-helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c index 3e24a031..2a7f938d 100644 --- a/tests/weston-test-client-helper.c +++ b/tests/weston-test-client-helper.c @@ -1705,6 +1705,9 @@ client_capture_output(struct client *client, client_roundtrip(client); + assert(capt.width != 0 && capt.height != 0 && capt.drm_format != 0 && + "capture source not available"); + buf = create_shm_buffer(client, capt.width, capt.height, capt.drm_format);