tests: add color-metadata-errors test

'color_characteristics_config_error' test ensures that all code paths in
parse_color_characteristics() and wet_output_set_color_characteristics()
get exercised.  The return value and logged error messages are checked.

Other cases test the weston_hdr_metadata_type1 validation.

These are for the sake of test coverage, but also an example of how to
test a function from main.c, and how to capture messages from
weston_log().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2022-03-17 13:13:14 +02:00
committed by Pekka Paalanen
parent e13e64c4e0
commit ccb4c383d7
4 changed files with 348 additions and 1 deletions
+1 -1
View File
@@ -6516,7 +6516,7 @@ weston_output_color_outcome_destroy(struct weston_output_color_outcome **pco)
*pco = NULL;
}
static bool
WESTON_EXPORT_FOR_TESTS bool
weston_output_set_color_outcome(struct weston_output *output)
{
struct weston_color_manager *cm = output->compositor->color_manager;
+5
View File
@@ -462,4 +462,9 @@ weston_view_find_paint_node(struct weston_view *view,
int
wl_data_device_manager_init(struct wl_display *display);
/* Exclusively for unit tests */
bool
weston_output_set_color_outcome(struct weston_output *output);
#endif