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 <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro 2023-06-01 17:04:56 -03:00 committed by Pekka Paalanen
parent 3226417573
commit cf64fbe784

View file

@ -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);