diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-20 14:29:33 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-21 20:22:48 +0100 |
commit | 5a79c69b0216f070b07d8238e4c2c7e3420faeec (patch) | |
tree | a88ee6dff60c34b27f383d36a4dfd3ba4b11c482 /Tests/LibGfx/TestImageDecoder.cpp | |
parent | ae7656072a403f69607109d941aa0c4b6274f60c (diff) | |
download | serenity-5a79c69b0216f070b07d8238e4c2c7e3420faeec.zip |
LibGfx: Make ImageDecoderPlugin::frame() return ErrorOr<>
This is a first step towards better error propagation from image codecs.
Diffstat (limited to 'Tests/LibGfx/TestImageDecoder.cpp')
-rw-r--r-- | Tests/LibGfx/TestImageDecoder.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index 7f2a439786..459bf6a4b5 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -31,7 +31,7 @@ TEST_CASE(test_bmp) EXPECT(!bmp.is_animated()); EXPECT(!bmp.loop_count()); - auto frame = bmp.frame(1); + auto frame = bmp.frame(0).release_value_but_fixme_should_propagate_errors(); EXPECT(frame.duration == 0); } @@ -45,7 +45,7 @@ TEST_CASE(test_gif) EXPECT(gif.is_animated()); EXPECT(!gif.loop_count()); - auto frame = gif.frame(1); + auto frame = gif.frame(1).release_value_but_fixme_should_propagate_errors(); EXPECT(frame.duration == 400); } @@ -60,8 +60,7 @@ TEST_CASE(test_ico) EXPECT(!ico.is_animated()); EXPECT(!ico.loop_count()); - auto frame = ico.frame(1); - EXPECT(frame.duration == 0); + EXPECT(ico.frame(0).is_error()); } TEST_CASE(test_jpg) @@ -74,7 +73,7 @@ TEST_CASE(test_jpg) EXPECT(!jpg.is_animated()); EXPECT(!jpg.loop_count()); - auto frame = jpg.frame(1); + auto frame = jpg.frame(0).release_value_but_fixme_should_propagate_errors(); EXPECT(frame.duration == 0); } @@ -88,7 +87,7 @@ TEST_CASE(test_pbm) EXPECT(!pbm.is_animated()); EXPECT(!pbm.loop_count()); - auto frame = pbm.frame(1); + auto frame = pbm.frame(0).release_value_but_fixme_should_propagate_errors(); EXPECT(frame.duration == 0); } @@ -102,7 +101,7 @@ TEST_CASE(test_pgm) EXPECT(!pgm.is_animated()); EXPECT(!pgm.loop_count()); - auto frame = pgm.frame(1); + auto frame = pgm.frame(0).release_value_but_fixme_should_propagate_errors(); EXPECT(frame.duration == 0); } @@ -116,7 +115,7 @@ TEST_CASE(test_png) EXPECT(!png.is_animated()); EXPECT(!png.loop_count()); - auto frame = png.frame(1); + auto frame = png.frame(0).release_value_but_fixme_should_propagate_errors(); EXPECT(frame.duration == 0); } @@ -130,6 +129,6 @@ TEST_CASE(test_ppm) EXPECT(!ppm.is_animated()); EXPECT(!ppm.loop_count()); - auto frame = ppm.frame(1); + auto frame = ppm.frame(0).release_value_but_fixme_should_propagate_errors(); EXPECT(frame.duration == 0); } |