1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

Meta+Tests: Add a fuzzer and a test for the ILBM decoder

This commit is contained in:
Nicolas Ramz 2023-08-03 10:52:44 +02:00 committed by Sam Atkins
parent fda5590313
commit 0986533c11
5 changed files with 31 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include <LibGfx/ImageFormats/BMPLoader.h>
#include <LibGfx/ImageFormats/GIFLoader.h>
#include <LibGfx/ImageFormats/ICOLoader.h>
#include <LibGfx/ImageFormats/ILBMLoader.h>
#include <LibGfx/ImageFormats/ImageDecoder.h>
#include <LibGfx/ImageFormats/JPEGLoader.h>
#include <LibGfx/ImageFormats/JPEGXLLoader.h>
@ -88,6 +89,15 @@ TEST_CASE(test_bmp_embedded_in_ico)
expect_single_frame(*plugin_decoder);
}
TEST_CASE(test_ilbm)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("ilbm/gradient.iff"sv)));
EXPECT(Gfx::ILBMImageDecoderPlugin::sniff(file->bytes()));
auto plugin_decoder = MUST(Gfx::ILBMImageDecoderPlugin::create(file->bytes()));
expect_single_frame_of_size(*plugin_decoder, { 320, 200 });
}
TEST_CASE(test_jpeg_sof0_one_scan)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("jpg/rgb24.jpg"sv)));