mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-01 13:49:05 +00:00
TestImageWriter: Add a BMP roundtrip test
This commit is contained in:
parent
0a26831a10
commit
83bdc9c831
Notes:
sideshowbarker
2024-07-17 00:37:23 +09:00
Author: https://github.com/nico
Commit: 83bdc9c831
Pull-request: https://github.com/SerenityOS/serenity/pull/24245
Reviewed-by: https://github.com/LucasChollet ✅
1 changed files with 8 additions and 0 deletions
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <AK/MemoryStream.h>
|
#include <AK/MemoryStream.h>
|
||||||
#include <LibGfx/Bitmap.h>
|
#include <LibGfx/Bitmap.h>
|
||||||
|
#include <LibGfx/ImageFormats/BMPLoader.h>
|
||||||
|
#include <LibGfx/ImageFormats/BMPWriter.h>
|
||||||
#include <LibGfx/ImageFormats/PNGLoader.h>
|
#include <LibGfx/ImageFormats/PNGLoader.h>
|
||||||
#include <LibGfx/ImageFormats/PNGWriter.h>
|
#include <LibGfx/ImageFormats/PNGWriter.h>
|
||||||
#include <LibGfx/ImageFormats/WebPLoader.h>
|
#include <LibGfx/ImageFormats/WebPLoader.h>
|
||||||
|
@ -79,6 +81,12 @@ static ErrorOr<AK::NonnullRefPtr<Gfx::Bitmap>> create_test_rgba_bitmap()
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE(test_bmp)
|
||||||
|
{
|
||||||
|
TRY_OR_FAIL((test_roundtrip<Gfx::BMPWriter, Gfx::BMPImageDecoderPlugin>(TRY_OR_FAIL(create_test_rgb_bitmap()))));
|
||||||
|
TRY_OR_FAIL((test_roundtrip<Gfx::BMPWriter, Gfx::BMPImageDecoderPlugin>(TRY_OR_FAIL(create_test_rgba_bitmap()))));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE(test_png)
|
TEST_CASE(test_png)
|
||||||
{
|
{
|
||||||
TRY_OR_FAIL((test_roundtrip<Gfx::PNGWriter, Gfx::PNGImageDecoderPlugin>(TRY_OR_FAIL(create_test_rgb_bitmap()))));
|
TRY_OR_FAIL((test_roundtrip<Gfx::PNGWriter, Gfx::PNGImageDecoderPlugin>(TRY_OR_FAIL(create_test_rgb_bitmap()))));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue