mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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: 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 ✅
3 changed files with 32 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue