From c0fe9cee9788825deb8d4c7385a30cf47e881041 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 18 Jun 2023 18:34:25 -0400 Subject: [PATCH] Tests: Move webp test images into webp/ subfolder --- Tests/LibGfx/TestImageDecoder.cpp | 42 +++++++++--------- .../{ => webp}/4-with-8-partitions.webp | Bin Tests/LibGfx/test-inputs/{ => webp}/4.webp | Bin .../test-inputs/{ => webp}/Qpalette.webp | Bin .../{ => webp}/catdog-alert-13.webp | Bin .../{ => webp}/catdog-alert-2.webp | Bin .../{ => webp}/catdog-alert-3.webp | Bin .../{ => webp}/catdog-alert-8.webp | Bin .../extended-lossless-animated.webp | Bin .../{ => webp}/extended-lossless.webp | Bin .../extended-lossy-uncompressed-alpha.webp | Bin .../{ => webp}/extended-lossy.webp | Bin .../test-inputs/{ => webp}/simple-vp8.webp | Bin .../simple-vp8l-alpha-used-false.webp | Bin .../test-inputs/{ => webp}/simple-vp8l.webp | Bin .../{ => webp}/smolkling-gradient-alpha.webp | Bin .../smolkling-horizontal-alpha.webp | Bin .../{ => webp}/smolkling-vertical-alpha.webp | Bin .../test-inputs/{ => webp}/smolkling.webp | Bin .../{ => webp}/width11-height11-colors15.webp | Bin .../{ => webp}/width11-height11-colors2.webp | Bin .../{ => webp}/width11-height11-colors3.webp | Bin 22 files changed, 21 insertions(+), 21 deletions(-) rename Tests/LibGfx/test-inputs/{ => webp}/4-with-8-partitions.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/4.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/Qpalette.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/catdog-alert-13.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/catdog-alert-2.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/catdog-alert-3.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/catdog-alert-8.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/extended-lossless-animated.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/extended-lossless.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/extended-lossy-uncompressed-alpha.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/extended-lossy.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/simple-vp8.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/simple-vp8l-alpha-used-false.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/simple-vp8l.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/smolkling-gradient-alpha.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/smolkling-horizontal-alpha.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/smolkling-vertical-alpha.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/smolkling.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/width11-height11-colors15.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/width11-height11-colors2.webp (100%) rename Tests/LibGfx/test-inputs/{ => webp}/width11-height11-colors3.webp (100%) diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index 5787845c25..05d1feff4e 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -300,7 +300,7 @@ TEST_CASE(test_targa_top_left_compressed) TEST_CASE(test_webp_simple_lossy) { - auto file = MUST(Core::MappedFile::map(TEST_INPUT("simple-vp8.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/simple-vp8.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -322,7 +322,7 @@ TEST_CASE(test_webp_simple_lossy) TEST_CASE(test_webp_simple_lossless) { - auto file = MUST(Core::MappedFile::map(TEST_INPUT("simple-vp8l.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/simple-vp8l.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -352,7 +352,7 @@ TEST_CASE(test_webp_simple_lossless_alpha_used_false) { // This file is identical to simple-vp8l.webp, but the `is_alpha_used` used bit is false. // The file still contains alpha data. This tests that the decoder replaces the stored alpha data with 0xff if `is_alpha_used` is false. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("simple-vp8l-alpha-used-false.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/simple-vp8l-alpha-used-false.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -372,7 +372,7 @@ TEST_CASE(test_webp_simple_lossless_alpha_used_false) TEST_CASE(test_webp_extended_lossy) { // This extended lossy image has an ALPH chunk for (losslessly compressed) alpha data. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("extended-lossy.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/extended-lossy.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -407,7 +407,7 @@ TEST_CASE(test_webp_extended_lossy_alpha_horizontal_filter) { // Also lossy rgb + lossless alpha, but with a horizontal alpha filtering method. // The image should look like smolkling.webp, but with a horizontal alpha gradient. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("smolkling-horizontal-alpha.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/smolkling-horizontal-alpha.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -431,7 +431,7 @@ TEST_CASE(test_webp_extended_lossy_alpha_vertical_filter) { // Also lossy rgb + lossless alpha, but with a vertical alpha filtering method. // The image should look like smolkling.webp, but with a vertical alpha gradient, and with a fully transparent first column. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("smolkling-vertical-alpha.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/smolkling-vertical-alpha.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -455,7 +455,7 @@ TEST_CASE(test_webp_extended_lossy_alpha_gradient_filter) { // Also lossy rgb + lossless alpha, but with a gradient alpha filtering method. // The image should look like smolkling.webp, but with a few transparent pixels in the shape of a C on it. Most of the image should not be transparent. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("smolkling-gradient-alpha.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/smolkling-gradient-alpha.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -478,7 +478,7 @@ TEST_CASE(test_webp_extended_lossy_alpha_gradient_filter) TEST_CASE(test_webp_extended_lossy_uncompressed_alpha) { - auto file = MUST(Core::MappedFile::map(TEST_INPUT("extended-lossy-uncompressed-alpha.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/extended-lossy-uncompressed-alpha.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -503,7 +503,7 @@ TEST_CASE(test_webp_extended_lossy_uncompressed_alpha) TEST_CASE(test_webp_extended_lossy_negative_quantization_offset) { - auto file = MUST(Core::MappedFile::map(TEST_INPUT("smolkling.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/smolkling.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -528,7 +528,7 @@ TEST_CASE(test_webp_lossy_4) // under the Creative Commons Attribution-Share Alike 3.0 Unported license. The image was re-encoded // as webp at https://developers.google.com/speed/webp/gallery1 and the webp version is from there. // No other changes have been made. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("4.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/4.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -549,7 +549,7 @@ TEST_CASE(test_webp_lossy_4) TEST_CASE(test_webp_lossy_4_with_partitions) { // Same input file as in the previous test, but re-encoded to use 8 secondary partitions. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("4-with-8-partitions.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/4-with-8-partitions.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -568,7 +568,7 @@ TEST_CASE(test_webp_lossy_4_with_partitions) TEST_CASE(test_webp_extended_lossless) { - auto file = MUST(Core::MappedFile::map(TEST_INPUT("extended-lossless.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/extended-lossless.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -599,7 +599,7 @@ TEST_CASE(test_webp_extended_lossless) TEST_CASE(test_webp_simple_lossless_color_index_transform) { // In addition to testing the index transform, this file also tests handling of explicity setting max_symbol. - auto file = MUST(Core::MappedFile::map(TEST_INPUT("Qpalette.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/Qpalette.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); @@ -629,10 +629,10 @@ TEST_CASE(test_webp_simple_lossless_color_index_transform_pixel_bundling) // catdog-alert-3 tests the 2-bit-per-pixel case, // catdog-alert-8 and catdog-alert-13 both test the 4-bits-per-pixel case. TestCase test_cases[] = { - { "catdog-alert-2.webp"sv, Gfx::Color(0x35, 0x12, 0x0a, 0xff), Gfx::Color(0xf3, 0xe6, 0xd8, 0xff) }, - { "catdog-alert-3.webp"sv, Gfx::Color(0x35, 0x12, 0x0a, 0xff), Gfx::Color(0, 0, 0, 0) }, - { "catdog-alert-8.webp"sv, Gfx::Color(0, 0, 0, 255), Gfx::Color(0, 0, 0, 0) }, - { "catdog-alert-13.webp"sv, Gfx::Color(0, 0, 0, 255), Gfx::Color(0, 0, 0, 0) }, + { "webp/catdog-alert-2.webp"sv, Gfx::Color(0x35, 0x12, 0x0a, 0xff), Gfx::Color(0xf3, 0xe6, 0xd8, 0xff) }, + { "webp/catdog-alert-3.webp"sv, Gfx::Color(0x35, 0x12, 0x0a, 0xff), Gfx::Color(0, 0, 0, 0) }, + { "webp/catdog-alert-8.webp"sv, Gfx::Color(0, 0, 0, 255), Gfx::Color(0, 0, 0, 0) }, + { "webp/catdog-alert-13.webp"sv, Gfx::Color(0, 0, 0, 255), Gfx::Color(0, 0, 0, 0) }, }; for (auto test_case : test_cases) { @@ -659,9 +659,9 @@ TEST_CASE(test_webp_simple_lossless_color_index_transform_pixel_bundling) TEST_CASE(test_webp_simple_lossless_color_index_transform_pixel_bundling_odd_width) { StringView file_names[] = { - "width11-height11-colors2.webp"sv, - "width11-height11-colors3.webp"sv, - "width11-height11-colors15.webp"sv, + "webp/width11-height11-colors2.webp"sv, + "webp/width11-height11-colors3.webp"sv, + "webp/width11-height11-colors15.webp"sv, }; for (auto file_name : file_names) { @@ -679,7 +679,7 @@ TEST_CASE(test_webp_simple_lossless_color_index_transform_pixel_bundling_odd_wid TEST_CASE(test_webp_extended_lossless_animated) { - auto file = MUST(Core::MappedFile::map(TEST_INPUT("extended-lossless-animated.webp"sv))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/extended-lossless-animated.webp"sv))); EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes())); auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes())); MUST(plugin_decoder->initialize()); diff --git a/Tests/LibGfx/test-inputs/4-with-8-partitions.webp b/Tests/LibGfx/test-inputs/webp/4-with-8-partitions.webp similarity index 100% rename from Tests/LibGfx/test-inputs/4-with-8-partitions.webp rename to Tests/LibGfx/test-inputs/webp/4-with-8-partitions.webp diff --git a/Tests/LibGfx/test-inputs/4.webp b/Tests/LibGfx/test-inputs/webp/4.webp similarity index 100% rename from Tests/LibGfx/test-inputs/4.webp rename to Tests/LibGfx/test-inputs/webp/4.webp diff --git a/Tests/LibGfx/test-inputs/Qpalette.webp b/Tests/LibGfx/test-inputs/webp/Qpalette.webp similarity index 100% rename from Tests/LibGfx/test-inputs/Qpalette.webp rename to Tests/LibGfx/test-inputs/webp/Qpalette.webp diff --git a/Tests/LibGfx/test-inputs/catdog-alert-13.webp b/Tests/LibGfx/test-inputs/webp/catdog-alert-13.webp similarity index 100% rename from Tests/LibGfx/test-inputs/catdog-alert-13.webp rename to Tests/LibGfx/test-inputs/webp/catdog-alert-13.webp diff --git a/Tests/LibGfx/test-inputs/catdog-alert-2.webp b/Tests/LibGfx/test-inputs/webp/catdog-alert-2.webp similarity index 100% rename from Tests/LibGfx/test-inputs/catdog-alert-2.webp rename to Tests/LibGfx/test-inputs/webp/catdog-alert-2.webp diff --git a/Tests/LibGfx/test-inputs/catdog-alert-3.webp b/Tests/LibGfx/test-inputs/webp/catdog-alert-3.webp similarity index 100% rename from Tests/LibGfx/test-inputs/catdog-alert-3.webp rename to Tests/LibGfx/test-inputs/webp/catdog-alert-3.webp diff --git a/Tests/LibGfx/test-inputs/catdog-alert-8.webp b/Tests/LibGfx/test-inputs/webp/catdog-alert-8.webp similarity index 100% rename from Tests/LibGfx/test-inputs/catdog-alert-8.webp rename to Tests/LibGfx/test-inputs/webp/catdog-alert-8.webp diff --git a/Tests/LibGfx/test-inputs/extended-lossless-animated.webp b/Tests/LibGfx/test-inputs/webp/extended-lossless-animated.webp similarity index 100% rename from Tests/LibGfx/test-inputs/extended-lossless-animated.webp rename to Tests/LibGfx/test-inputs/webp/extended-lossless-animated.webp diff --git a/Tests/LibGfx/test-inputs/extended-lossless.webp b/Tests/LibGfx/test-inputs/webp/extended-lossless.webp similarity index 100% rename from Tests/LibGfx/test-inputs/extended-lossless.webp rename to Tests/LibGfx/test-inputs/webp/extended-lossless.webp diff --git a/Tests/LibGfx/test-inputs/extended-lossy-uncompressed-alpha.webp b/Tests/LibGfx/test-inputs/webp/extended-lossy-uncompressed-alpha.webp similarity index 100% rename from Tests/LibGfx/test-inputs/extended-lossy-uncompressed-alpha.webp rename to Tests/LibGfx/test-inputs/webp/extended-lossy-uncompressed-alpha.webp diff --git a/Tests/LibGfx/test-inputs/extended-lossy.webp b/Tests/LibGfx/test-inputs/webp/extended-lossy.webp similarity index 100% rename from Tests/LibGfx/test-inputs/extended-lossy.webp rename to Tests/LibGfx/test-inputs/webp/extended-lossy.webp diff --git a/Tests/LibGfx/test-inputs/simple-vp8.webp b/Tests/LibGfx/test-inputs/webp/simple-vp8.webp similarity index 100% rename from Tests/LibGfx/test-inputs/simple-vp8.webp rename to Tests/LibGfx/test-inputs/webp/simple-vp8.webp diff --git a/Tests/LibGfx/test-inputs/simple-vp8l-alpha-used-false.webp b/Tests/LibGfx/test-inputs/webp/simple-vp8l-alpha-used-false.webp similarity index 100% rename from Tests/LibGfx/test-inputs/simple-vp8l-alpha-used-false.webp rename to Tests/LibGfx/test-inputs/webp/simple-vp8l-alpha-used-false.webp diff --git a/Tests/LibGfx/test-inputs/simple-vp8l.webp b/Tests/LibGfx/test-inputs/webp/simple-vp8l.webp similarity index 100% rename from Tests/LibGfx/test-inputs/simple-vp8l.webp rename to Tests/LibGfx/test-inputs/webp/simple-vp8l.webp diff --git a/Tests/LibGfx/test-inputs/smolkling-gradient-alpha.webp b/Tests/LibGfx/test-inputs/webp/smolkling-gradient-alpha.webp similarity index 100% rename from Tests/LibGfx/test-inputs/smolkling-gradient-alpha.webp rename to Tests/LibGfx/test-inputs/webp/smolkling-gradient-alpha.webp diff --git a/Tests/LibGfx/test-inputs/smolkling-horizontal-alpha.webp b/Tests/LibGfx/test-inputs/webp/smolkling-horizontal-alpha.webp similarity index 100% rename from Tests/LibGfx/test-inputs/smolkling-horizontal-alpha.webp rename to Tests/LibGfx/test-inputs/webp/smolkling-horizontal-alpha.webp diff --git a/Tests/LibGfx/test-inputs/smolkling-vertical-alpha.webp b/Tests/LibGfx/test-inputs/webp/smolkling-vertical-alpha.webp similarity index 100% rename from Tests/LibGfx/test-inputs/smolkling-vertical-alpha.webp rename to Tests/LibGfx/test-inputs/webp/smolkling-vertical-alpha.webp diff --git a/Tests/LibGfx/test-inputs/smolkling.webp b/Tests/LibGfx/test-inputs/webp/smolkling.webp similarity index 100% rename from Tests/LibGfx/test-inputs/smolkling.webp rename to Tests/LibGfx/test-inputs/webp/smolkling.webp diff --git a/Tests/LibGfx/test-inputs/width11-height11-colors15.webp b/Tests/LibGfx/test-inputs/webp/width11-height11-colors15.webp similarity index 100% rename from Tests/LibGfx/test-inputs/width11-height11-colors15.webp rename to Tests/LibGfx/test-inputs/webp/width11-height11-colors15.webp diff --git a/Tests/LibGfx/test-inputs/width11-height11-colors2.webp b/Tests/LibGfx/test-inputs/webp/width11-height11-colors2.webp similarity index 100% rename from Tests/LibGfx/test-inputs/width11-height11-colors2.webp rename to Tests/LibGfx/test-inputs/webp/width11-height11-colors2.webp diff --git a/Tests/LibGfx/test-inputs/width11-height11-colors3.webp b/Tests/LibGfx/test-inputs/webp/width11-height11-colors3.webp similarity index 100% rename from Tests/LibGfx/test-inputs/width11-height11-colors3.webp rename to Tests/LibGfx/test-inputs/webp/width11-height11-colors3.webp