From fc7bb13bbbd718f11426d1fef237f7b9541bd173 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 16 Apr 2026 14:52:58 -0500 Subject: [PATCH] tests: Skip udmabuf tests before initializing client We currently leak resources and hit asserts if dmabuf is unavailable. Move the check to before we initialize anything. Signed-off-by: Derek Foreman --- tests/output-capture-protocol-test.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/output-capture-protocol-test.c b/tests/output-capture-protocol-test.c index 64579adf1..1306e3ae9 100644 --- a/tests/output-capture-protocol-test.c +++ b/tests/output-capture-protocol-test.c @@ -252,6 +252,8 @@ TEST(simple_shot) struct capturer *capt; struct buffer *buf; + SKIP_NO_UDMABUF(fix->buffer_type); + client = create_client(); capt = capturer_create(client, client->output, WESTON_CAPTURE_V1_SOURCE_FRAMEBUFFER); @@ -266,7 +268,6 @@ TEST(simple_shot) test_assert_int_gt(capt->height, 0); test_assert_false(capt->events.reply); - SKIP_NO_UDMABUF(fix->buffer_type); buf = create_buffer(client, capt->width, capt->height, fix->expected_drm_format, fix->buffer_type); @@ -296,6 +297,8 @@ TEST(retry_on_wrong_format) struct capturer *capt; struct buffer *buf; + SKIP_NO_UDMABUF(fix->buffer_type); + client = create_client(); capt = capturer_create(client, client->output, WESTON_CAPTURE_V1_SOURCE_FRAMEBUFFER); @@ -313,7 +316,6 @@ TEST(retry_on_wrong_format) test_assert_int_gt(capt->height, 0); test_assert_false(capt->events.reply); - SKIP_NO_UDMABUF(fix->buffer_type); buf = create_buffer(client, capt->width, capt->height, drm_format, fix->buffer_type); @@ -342,6 +344,8 @@ TEST(retry_on_wrong_size) struct capturer *capt; struct buffer *buf; + SKIP_NO_UDMABUF(fix->buffer_type); + client = create_client(); capt = capturer_create(client, client->output, WESTON_CAPTURE_V1_SOURCE_FRAMEBUFFER); @@ -355,7 +359,6 @@ TEST(retry_on_wrong_size) test_assert_int_gt(capt->height, 5); test_assert_false(capt->events.reply); - SKIP_NO_UDMABUF(fix->buffer_type); buf = create_buffer(client, capt->width - 3, capt->height - 3, fix->expected_drm_format, fix->buffer_type);