From 2cf7cecd664fab89c63b5381f0d5daf3f6163597 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 26 May 2026 14:52:58 +0000 Subject: [PATCH] tests/color-representation-protocol-test: migrate to DECLARE_TEST_LIST API Replace TEST() and TEST_P() macros with explicit static functions and DECLARE_TEST_LIST() registration for better type safety and to prepare for removing the custom ELF section. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: Pekka Paalanen --- tests/color-representation-protocol-test.c | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tests/color-representation-protocol-test.c b/tests/color-representation-protocol-test.c index 1dd16f1ca..2d3d3573b 100644 --- a/tests/color-representation-protocol-test.c +++ b/tests/color-representation-protocol-test.c @@ -48,7 +48,8 @@ DECLARE_FIXTURE_SETUP(fixture_setup); /* * Test that the SURFACE_EXISTS error is send by the compositor. */ -TEST(color_presentation_protocol_surface_exists) +static enum test_result_code +color_presentation_protocol_surface_exists(struct wet_testsuite_data *suite_data) { struct wp_color_representation_surface_v1 *color_representation_surface; struct wp_color_representation_surface_v1 *color_representation_surface_2; @@ -81,7 +82,8 @@ TEST(color_presentation_protocol_surface_exists) * Test that a color representation can successfully be recreated after * destruction without e.g. triggering a SURFACE_EXISTS error. */ -TEST(color_presentation_protocol_surface_recreate) +static enum test_result_code +color_presentation_protocol_surface_recreate(struct wet_testsuite_data *suite_data) { struct wp_color_representation_surface_v1 *color_representation_surface; struct wp_color_representation_surface_v1 *color_representation_surface_2; @@ -159,9 +161,10 @@ static const struct coefficients_case coefficients_cases[] = { * format, matrix coefficients and quantization range are send by the compositor * as required by the protocol. */ -TEST_P(color_presentation_protocol_valid_coefficients, coefficients_cases) +static enum test_result_code +color_presentation_protocol_valid_coefficients(struct wet_testsuite_data *suite_data, + const struct coefficients_case *coefficients_case) { - const struct coefficients_case *coefficients_case = data; struct wp_color_representation_surface_v1 *color_representation_surface; struct client *client; struct wl_surface *surface; @@ -213,9 +216,10 @@ static const struct alpha_mode_case alpha_mode_cases[] = { /* * Test that PREMULTIPLIED_ELECTRICAL is the only alpha mode currently supported. */ -TEST_P(color_presentation_protocol_alpha_mode, alpha_mode_cases) +static enum test_result_code +color_presentation_protocol_alpha_mode(struct wet_testsuite_data *suite_data, + const struct alpha_mode_case *alpha_mode_case) { - const struct alpha_mode_case *alpha_mode_case = data; struct wp_color_representation_surface_v1 *color_representation_surface; struct client *client; @@ -260,9 +264,10 @@ static const struct chroma_location_case chroma_location_cases[] = { /* * Test that all chroma location values are accepted, but not invalid values. */ -TEST_P(color_presentation_protocol_chroma_location, chroma_location_cases) +static enum test_result_code +color_presentation_protocol_chroma_location(struct wet_testsuite_data *suite_data, + const struct chroma_location_case *chroma_location_case) { - const struct chroma_location_case *chroma_location_case = data; struct wp_color_representation_surface_v1 *color_representation_surface; struct client *client; @@ -289,3 +294,11 @@ TEST_P(color_presentation_protocol_chroma_location, chroma_location_cases) return RESULT_OK; } + +DECLARE_TEST_LIST( + TESTFN(color_presentation_protocol_surface_exists), + TESTFN(color_presentation_protocol_surface_recreate), + TESTFN_ARG(color_presentation_protocol_valid_coefficients, coefficients_cases), + TESTFN_ARG(color_presentation_protocol_alpha_mode, alpha_mode_cases), + TESTFN_ARG(color_presentation_protocol_chroma_location, chroma_location_cases), +);