Commit Graph

3 Commits

Author SHA1 Message Date
Leandro Ribeiro 0c1ab2ad76 tests/color-metadata-errors: add mock stock sRGB color profile
In the following commits, we'll create the stock sRGB color profile for
outputs in weston_output_init(), and destroy it in
weston_output_release().

We already have a mock color manager in the tests, but we still need
to add the functions to create/destroy a mock stock sRGB color profile.
This should avoid crashes in the following commits.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-10-30 11:47:35 +00:00
Derek Foreman 4def21c196 tests: prevent tests from breaking when they use invalid weston_compositor
The color-metadata-errors test inits outputs with a NULL compositor, and
makes a compositor that's entirely 0s except for the bits it's interested
in.

This makes a mess in a future where the primary_plane is split up per
output, as initializing the primary plane tries to add it to the
compositor's plane_list.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Pekka Paalanen ccb4c383d7 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>
2022-05-27 10:30:35 +00:00