mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
Tests/LibGfx: Add tests for compressed TGA images
This commit is contained in:
parent
2f2d808869
commit
71f275b5ad
Notes:
sideshowbarker
2024-07-17 06:35:16 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/71f275b5ad Pull-request: https://github.com/SerenityOS/serenity/pull/16574 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/gmta ✅
Binary file not shown.
Binary file not shown.
|
@ -176,3 +176,35 @@ TEST_CASE(test_targa_top_left)
|
|||
auto frame = frame_or_error.release_value();
|
||||
EXPECT(frame.duration == 0);
|
||||
}
|
||||
|
||||
TEST_CASE(test_targa_bottom_left_compressed)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/targasuite_files/buggie-bottom-left-compressed.tga"sv).release_value();
|
||||
auto tga = Gfx::TGAImageDecoderPlugin(reinterpret_cast<u8 const*>(file->data()), file->size());
|
||||
EXPECT_EQ(tga.frame_count(), 1u);
|
||||
|
||||
EXPECT(tga.sniff());
|
||||
EXPECT(!tga.is_animated());
|
||||
EXPECT(!tga.loop_count());
|
||||
|
||||
auto frame_or_error = tga.frame(0);
|
||||
EXPECT(!frame_or_error.is_error());
|
||||
auto frame = frame_or_error.release_value();
|
||||
EXPECT(frame.duration == 0);
|
||||
}
|
||||
|
||||
TEST_CASE(test_targa_top_left_compressed)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/targasuite_files/buggie-top-left-compressed.tga"sv).release_value();
|
||||
auto tga = Gfx::TGAImageDecoderPlugin(reinterpret_cast<u8 const*>(file->data()), file->size());
|
||||
EXPECT_EQ(tga.frame_count(), 1u);
|
||||
|
||||
EXPECT(tga.sniff());
|
||||
EXPECT(!tga.is_animated());
|
||||
EXPECT(!tga.loop_count());
|
||||
|
||||
auto frame_or_error = tga.frame(0);
|
||||
EXPECT(!frame_or_error.is_error());
|
||||
auto frame = frame_or_error.release_value();
|
||||
EXPECT(frame.duration == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue