MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / TEST

Function TEST

pj_scene2D/tests/image_codecs_test.cpp:46–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// --- JPEG tests ---
45
46TEST(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
59TEST(ImageCodecTest, DecodeEmptyInputFails) {
60 JpegCodec decoder;

Callers

nothing calls this directly

Calls 5

createTestJpegFunction · 0.85
compressedFrameFunction · 0.85
makeRgbPngFunction · 0.85
decodeMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected