From 22f6b4ecc7ea497ec451761aa4d8a136ad43d864 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 16 Apr 2026 15:47:04 +0300 Subject: [PATCH] tests/color-management-protocol: add set_inert_surface_image_description Extend test coverage. Signed-off-by: Pekka Paalanen --- tests/color-management-protocol-test.c | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/color-management-protocol-test.c b/tests/color-management-protocol-test.c index d6d8a4cc8..b30fbeb8c 100644 --- a/tests/color-management-protocol-test.c +++ b/tests/color-management-protocol-test.c @@ -452,6 +452,39 @@ TEST(set_surface_image_description) return RESULT_OK; } +TEST(set_inert_surface_image_description) +{ + struct client *client; + struct color_manager_client *cm; + struct image_description *image_descr; + struct wp_color_management_surface_v1 *cm_surface; + + client = create_client_and_test_surface(100, 100, 100, 100); + cm = color_manager_get(client); + + /* Get guaranteed good image description. */ + image_descr = image_description_create_for_preferred(cm, client->surface); + image_description_wait_until_ready(client, image_descr); + + /* Destroy the wl_surface, making cm_surface inert. */ + cm_surface = wp_color_manager_v1_get_surface(cm->manager_proxy, client->surface->wl_surface); + surface_destroy(client->surface); + client->surface = NULL; + + /* Set image description on inert surface. */ + wp_color_management_surface_v1_set_image_description(cm_surface, + image_descr->proxy, + WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL); + expect_protocol_error(client, &wp_color_management_surface_v1_interface, + WP_COLOR_MANAGEMENT_SURFACE_V1_ERROR_INERT); + + wp_color_management_surface_v1_destroy(cm_surface); + image_description_destroy(image_descr); + client_destroy(client); + + return RESULT_OK; +} + #define NOT_SET -99 #define BAD_ENUM 99999