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>
This commit is contained in:
parent
5f0eaeb083
commit
4def21c196
@ -7458,6 +7458,12 @@ weston_output_init(struct weston_output *output,
|
||||
|
||||
pixman_region32_init(&output->region);
|
||||
wl_list_init(&output->mode_list);
|
||||
|
||||
/* At least one test inits outputs with a NULL compositor,
|
||||
* So bail on anything that requires a valid compositor here.
|
||||
*/
|
||||
if (!compositor)
|
||||
return;
|
||||
}
|
||||
|
||||
/** Adds weston_output object to pending output list.
|
||||
|
@ -290,6 +290,7 @@ TEST_P(hdr_metadata_type1_errors, value_cases)
|
||||
|
||||
weston_log_set_handler(no_logger, no_logger);
|
||||
|
||||
wl_list_init(&mock_compositor.plane_list);
|
||||
weston_output_init(&mock_output, &mock_compositor, "mockoutput");
|
||||
|
||||
assert(t->field_index < ARRAY_LENGTH(fields));
|
||||
@ -326,6 +327,7 @@ TEST(hdr_metadata_type1_ignore_unflagged)
|
||||
struct weston_output mock_output = {};
|
||||
bool ret;
|
||||
|
||||
wl_list_init(&mock_compositor.plane_list);
|
||||
weston_log_set_handler(no_logger, no_logger);
|
||||
|
||||
weston_output_init(&mock_output, &mock_compositor, "mockoutput");
|
||||
|
Loading…
Reference in New Issue
Block a user