From c04e0494dff3e50f2c2e84e78b6a4a8eb72d4465 Mon Sep 17 00:00:00 2001 From: MacDue Date: Sun, 2 Jul 2023 23:09:27 +0100 Subject: [PATCH] Tests: Add simple .tvg decoding test yak.tvg is the Twemoji bison we all know and love. --- Tests/LibGfx/TestImageDecoder.cpp | 11 +++++++++++ Tests/LibGfx/test-inputs/tvg/yak.tvg | Bin 0 -> 584 bytes 2 files changed, 11 insertions(+) create mode 100644 Tests/LibGfx/test-inputs/tvg/yak.tvg diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index 385846be49..e25259b5d4 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -559,3 +560,13 @@ TEST_CASE(test_webp_extended_lossless_animated) EXPECT_EQ(frame.image->get_pixel(500, 0), (frame_index == 2 || frame_index == 6) ? Gfx::Color::Black : Gfx::Color(255, 255, 255, 0)); } } + +TEST_CASE(test_tvg) +{ + auto file = MUST(Core::MappedFile::map(TEST_INPUT("tvg/yak.tvg"sv))); + EXPECT(Gfx::TinyVGImageDecoderPlugin::sniff(file->bytes())); + auto plugin_decoder = MUST(Gfx::TinyVGImageDecoderPlugin::create(file->bytes())); + MUST(plugin_decoder->initialize()); + + expect_single_frame_of_size(*plugin_decoder, { 1024, 1024 }); +} diff --git a/Tests/LibGfx/test-inputs/tvg/yak.tvg b/Tests/LibGfx/test-inputs/tvg/yak.tvg new file mode 100644 index 0000000000000000000000000000000000000000..5e0d80d792768e78e65cd58d27c74fe8425bab40 GIT binary patch literal 584 zcmXR4V`N}pVPIiBnCbsNO+om-rk?TtoAa9f&s??jKQjY^$Wi8*jLb)vYZ#|7$1#R7 zTQV|>GK(-iWt_`k#CVT^`8&gB1{Ow3#xD$(jLg>=EE$(E=rg7>m@+b}G1xGQFr+ey zFsx=|7Ge0nsKU_4IfJb{sc zWi=xM3-d8X2A0o^&CLH8Etwe@nFW}cS((F_#hDpcESVWtn8TPESf(4%%7RAFf%YeVP;@v{>;q4%)s)Q ziGk$_6UgsO%nU4N8DBH6WCZz@jhTUwQ;tE8i5Wz^_@Be5$e_c>9L4aO;SYljBM38t zi0=&78MGLWF)+t4ZedVin#RDzEY8ThibHNnn3)?H zGni!=gPFme{>t!+QH^m2<70+)MrH$sTt<*xAk4HoXRu~u?qhIe+``br2-3sG F006nUfnWdt literal 0 HcmV?d00001