diff options
author | Pekka Paalanen <pekka.paalanen@collabora.com> | 2022-10-10 15:09:43 +0300 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2022-12-02 13:36:25 +0000 |
commit | 9b7084cfcaccf5c731cad23cf1239a16a1bbe308 (patch) | |
tree | 5325d4f534e2a185465fe643ff1000f1b7ce439a /tests | |
parent | e11a51709d118798b665a3d999633e92108be836 (diff) | |
download | weston-9b7084cfcaccf5c731cad23cf1239a16a1bbe308.tar.gz |
tests: change shot argument type in verify_image()
Only the 'image' field of struct buffer is ever used here, so just
pass pixman_image_t instead of struct buffer.
This allows a future test to mangle a screenshot (e.g. convert pixel
format) before feeding it in.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/alpha-blending-test.c | 2 | ||||
-rw-r--r-- | tests/color-icc-output-test.c | 4 | ||||
-rw-r--r-- | tests/weston-test-client-helper.c | 12 | ||||
-rw-r--r-- | tests/weston-test-client-helper.h | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/tests/alpha-blending-test.c b/tests/alpha-blending-test.c index 8ea9de36..9515a700 100644 --- a/tests/alpha-blending-test.c +++ b/tests/alpha-blending-test.c @@ -348,7 +348,7 @@ TEST(alpha_blend) shot = capture_screenshot_of_output(client); assert(shot); - match = verify_image(shot, "alpha_blend", seq_no, NULL, seq_no); + match = verify_image(shot->image, "alpha_blend", seq_no, NULL, seq_no); assert(check_blend_pattern(bg, fg, shot, space)); assert(match); diff --git a/tests/color-icc-output-test.c b/tests/color-icc-output-test.c index 55342440..e6371363 100644 --- a/tests/color-icc-output-test.c +++ b/tests/color-icc-output-test.c @@ -617,7 +617,7 @@ TEST(opaque_pixel_conversion) shot = capture_screenshot_of_output(client); assert(shot); - match = verify_image(shot, "shaper_matrix", arg->ref_image_index, + match = verify_image(shot->image, "shaper_matrix", arg->ref_image_index, NULL, seq_no); assert(process_pipeline_comparison(buf, shot, arg)); assert(match); @@ -832,7 +832,7 @@ TEST(output_icc_alpha_blend) shot = capture_screenshot_of_output(client); assert(shot); - match = verify_image(shot, "output_icc_alpha_blend", arg->ref_image_index, + match = verify_image(shot->image, "output_icc_alpha_blend", arg->ref_image_index, NULL, seq_no); assert(check_blend_pattern(bg, fg, shot, arg)); assert(match); diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c index f41ea513..c4d24f8e 100644 --- a/tests/weston-test-client-helper.c +++ b/tests/weston-test-client-helper.c @@ -1758,7 +1758,7 @@ capture_screenshot_of_output(struct client *client) static void write_visual_diff(pixman_image_t *ref_image, - struct buffer *shot, + pixman_image_t *shot, const struct rectangle *clip, const char *test_name, int seq_no, @@ -1773,7 +1773,7 @@ write_visual_diff(pixman_image_t *ref_image, assert(ret >= 0); fname = screenshot_output_filename(ext_test_name, seq_no); - diff = visualize_image_difference(ref_image, shot->image, clip, fuzz); + diff = visualize_image_difference(ref_image, shot, clip, fuzz); write_image_as_png(diff, fname); pixman_image_unref(diff); @@ -1812,7 +1812,7 @@ write_visual_diff(pixman_image_t *ref_image, * \sa verify_screen_content */ bool -verify_image(struct buffer *shot, +verify_image(pixman_image_t *shot, const char *ref_image, int ref_seq_no, const struct rectangle *clip, @@ -1833,7 +1833,7 @@ verify_image(struct buffer *shot, } if (ref) { - match = check_images_match(ref, shot->image, clip, &gl_fuzz); + match = check_images_match(ref, shot, clip, &gl_fuzz); testlog("Verify reference image %s vs. shot %s: %s\n", ref_fname, shot_fname, match ? "PASS" : "FAIL"); @@ -1848,7 +1848,7 @@ verify_image(struct buffer *shot, } if (!match) - write_image_as_png(shot->image, shot_fname); + write_image_as_png(shot, shot_fname); free(ref_fname); free(shot_fname); @@ -1881,7 +1881,7 @@ verify_screen_content(struct client *client, shot = capture_screenshot_of_output(client); assert(shot); - match = verify_image(shot, ref_image, ref_seq_no, clip, seq_no); + match = verify_image(shot->image, ref_image, ref_seq_no, clip, seq_no); buffer_destroy(shot); return match; diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h index 591acb11..3d6ab28e 100644 --- a/tests/weston-test-client-helper.h +++ b/tests/weston-test-client-helper.h @@ -276,7 +276,7 @@ struct buffer * capture_screenshot_of_output(struct client *client); bool -verify_image(struct buffer *shot, +verify_image(pixman_image_t *shot, const char *ref_image, int ref_seq_no, const struct rectangle *clip, |