1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:28:13 +00:00

Tests/LibGfx: Fix test_not_ico test case

We should expect the sniffing method and the initialize method to fail
because this test case is testing that the ICO image decoder should not
decode random data within it.
This commit is contained in:
Liav A 2023-01-20 18:40:28 +02:00 committed by Linus Groh
parent 87f0e835eb
commit da525ccc43

View file

@ -58,11 +58,11 @@ TEST_CASE(test_gif)
TEST_CASE(test_not_ico)
{
auto file = Core::MappedFile::map("/res/graphics/buggie.png"sv).release_value();
EXPECT_EQ(MUST(Gfx::ICOImageDecoderPlugin::sniff({ (u8 const*)file->data(), file->size() })), true);
EXPECT_EQ(MUST(Gfx::ICOImageDecoderPlugin::sniff({ (u8 const*)file->data(), file->size() })), false);
auto plugin_decoder_or_error = Gfx::ICOImageDecoderPlugin::create({ (u8 const*)file->data(), file->size() });
EXPECT(!plugin_decoder_or_error.is_error());
auto plugin_decoder = plugin_decoder_or_error.release_value();
EXPECT_EQ(plugin_decoder->initialize(), true);
EXPECT_EQ(plugin_decoder->initialize(), false);
EXPECT(plugin_decoder->frame_count());
EXPECT(!plugin_decoder->is_animated());