瀏覽代碼

Tests/LibGfx: Test we can decode everything in TinyVG

This tests that we can successfully parse the "everything" TVG files,
which make use of every feature in TinyVG.

Test files taken from https://github.com/TinyVG/examples (MIT).
MacDue 2 年之前
父節點
當前提交
d2766bd5fe
共有 3 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      Tests/LibGfx/TestImageDecoder.cpp
  2. 二進制
      Tests/LibGfx/test-inputs/tvg/everything-32.tvg
  3. 二進制
      Tests/LibGfx/test-inputs/tvg/everything.tvg

+ 17 - 0
Tests/LibGfx/TestImageDecoder.cpp

@@ -590,3 +590,20 @@ TEST_CASE(test_tvg)
 
     expect_single_frame_of_size(*plugin_decoder, { 1024, 1024 });
 }
+
+TEST_CASE(test_everything_tvg)
+{
+    Array file_names {
+        TEST_INPUT("tvg/everything.tvg"sv),
+        TEST_INPUT("tvg/everything-32.tvg"sv)
+    };
+
+    for (auto file_name : file_names) {
+        auto file = MUST(Core::MappedFile::map(file_name));
+        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, { 400, 768 });
+    }
+}

二進制
Tests/LibGfx/test-inputs/tvg/everything-32.tvg


二進制
Tests/LibGfx/test-inputs/tvg/everything.tvg