| 44 | // --- JPEG tests --- |
| 45 | |
| 46 | TEST(ImageCodecTest, DecodeValidJpeg) { |
| 47 | ImageDecodeCascade decoder; |
| 48 | auto jpeg = createTestJpeg(64, 48); |
| 49 | auto result = decoder.decode(compressedFrame(jpeg)); |
| 50 | ASSERT_TRUE(result.has_value()) << result.error(); |
| 51 | EXPECT_EQ(result->width, 64); |
| 52 | EXPECT_EQ(result->height, 48); |
| 53 | EXPECT_EQ(result->format, PixelFormat::kRGB888); |
| 54 | EXPECT_FALSE(result->isNull()); |
| 55 | EXPECT_GT((*result->pixels)[0], 200); |
| 56 | EXPECT_LT((*result->pixels)[1], 50); |
| 57 | } |
| 58 | |
| 59 | TEST(ImageCodecTest, DecodeEmptyInputFails) { |
| 60 | JpegCodec decoder; |
nothing calls this directly
no test coverage detected