From 9c7d088f8b654af137958801de7129b3dc2a82b8 Mon Sep 17 00:00:00 2001 From: evgeny Date: Sat, 17 Oct 2026 01:30:05 +0200 Subject: [PATCH] Compare retained image pixels without assuming SIMD color rounding --- tools/chatgui/tests/test_video_frame_image.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/chatgui/tests/test_video_frame_image.cpp b/tools/chatgui/tests/test_video_frame_image.cpp index abcbad5b..9c3feae5 100644 --- a/tools/chatgui/tests/test_video_frame_image.cpp +++ b/tools/chatgui/tests/test_video_frame_image.cpp @@ -45,10 +45,11 @@ private slots: output[0] = image.bits(); QCOMPARE(sws_scale(converter, source->data, source->linesize, 0, height, output, strides), height); for (int y = 0; y < height; y++) QCOMPARE(memcmp(image.constScanLine(y), guarded.data() + y * strides[0], width * 3), 0); + QColor corner = image.pixelColor(width - 1, height - 1), first = image.pixelColor(0, 0); QImage shared = image; image = {}; - QCOMPARE(shared.pixelColor(width - 1, height - 1), QColor(19, 19, 19)); + QCOMPARE(shared.pixelColor(width - 1, height - 1), corner); QImage detached = shared; detached.fill(Qt::red); - QCOMPARE(shared.pixelColor(0, 0), QColor(19, 19, 19)); QCOMPARE(detached.pixelColor(0, 0), QColor(Qt::red)); + QCOMPARE(shared.pixelColor(0, 0), first); QCOMPARE(detached.pixelColor(0, 0), QColor(Qt::red)); } };