diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-08-16 10:08:40 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-16 14:48:04 +0000 |
commit | 2f2701d83453017127277bd86d5b52a2fc5f56df (patch) | |
tree | fdc50d08ef375fe1437c384c1f0c53df276c3e24 /tests | |
parent | faf7d69bd3be451e8603dd0193cab05e5d0e7705 (diff) |
Fix the QVideoFrame autotest
Fix autotest failures introduced by the pixel format refactoring.
Amends 6e479464a37ddc6abbc46fbd5a3a1065091da480.
Change-Id: Ifcf7ebd28625d3b6ea438f14b78157e7d73e5b1c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 107f063d57be421fb1eee8d8acc2d5a166231ae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp b/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp index c10400bf7..bcb2843c4 100644 --- a/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp +++ b/tests/auto/unit/multimedia/qvideoframe/tst_qvideoframe.cpp @@ -709,6 +709,12 @@ void tst_QVideoFrame::formatConversion_data() QTest::newRow("QImage::Format_ARGB32_Premultiplied | QVideoFrameFormat::Format_BGRA8888_Premultiplied") << QImage::Format_ARGB32_Premultiplied << QVideoFrameFormat::Format_BGRA8888_Premultiplied; + QTest::newRow("QVideoFrameFormat::Format_ARGB8888") + << QImage::Format_Invalid + << QVideoFrameFormat::Format_ARGB8888; + QTest::newRow("QVideoFrameFormat::Format_ARGB8888_Premultiplied") + << QImage::Format_Invalid + << QVideoFrameFormat::Format_ARGB8888_Premultiplied; #else QTest::newRow("QImage::Format_RGB32 | QVideoFrameFormat::Format_XRGB8888") << QImage::Format_RGB32 @@ -719,6 +725,12 @@ void tst_QVideoFrame::formatConversion_data() QTest::newRow("QImage::Format_ARGB32_Premultiplied | QVideoFrameFormat::Format_ARGB8888_Premultiplied") << QImage::Format_ARGB32_Premultiplied << QVideoFrameFormat::Format_ARGB8888_Premultiplied; + QTest::newRow("QVideoFrameFormat::Format_BGRA8888") + << QImage::Format_Invalid + << QVideoFrameFormat::Format_BGRA8888; + QTest::newRow("QVideoFrameFormat::Format_BGRA8888_Premultiplied") + << QImage::Format_Invalid + << QVideoFrameFormat::Format_BGRA8888_Premultiplied; #endif QTest::newRow("QImage::Format_MonoLSB") @@ -743,12 +755,6 @@ void tst_QVideoFrame::formatConversion_data() << QImage::Format_ARGB4444_Premultiplied << QVideoFrameFormat::Format_Invalid; - QTest::newRow("QVideoFrameFormat::Format_BGRA32") - << QImage::Format_Invalid - << QVideoFrameFormat::Format_BGRA8888; - QTest::newRow("QVideoFrameFormat::Format_BGRA32_Premultiplied") - << QImage::Format_Invalid - << QVideoFrameFormat::Format_BGRA8888_Premultiplied; QTest::newRow("QVideoFrameFormat::Format_BGR32") << QImage::Format_Invalid << QVideoFrameFormat::Format_XBGR8888; @@ -804,11 +810,11 @@ void tst_QVideoFrame::formatConversion() QFETCH(QImage::Format, imageFormat); QFETCH(QVideoFrameFormat::PixelFormat, pixelFormat); - QCOMPARE(QVideoFrameFormat::pixelFormatFromImageFormat(imageFormat) == pixelFormat, - imageFormat != QImage::Format_Invalid); + if (imageFormat != QImage::Format_Invalid) + QCOMPARE(QVideoFrameFormat::pixelFormatFromImageFormat(imageFormat), pixelFormat); - QCOMPARE(QVideoFrameFormat::imageFormatFromPixelFormat(pixelFormat) == imageFormat, - pixelFormat != QVideoFrameFormat::Format_Invalid); + if (pixelFormat != QVideoFrameFormat::Format_Invalid) + QCOMPARE(QVideoFrameFormat::imageFormatFromPixelFormat(pixelFormat), imageFormat); } #define TEST_MAPPED(frame, mode) \ @@ -914,7 +920,7 @@ void tst_QVideoFrame::image_data() QTest::newRow("64x64 ARGB32") << QSize(64, 64) << QVideoFrameFormat::Format_ARGB8888 - << QImage::Format_ARGB32; + << QImage::Format_ARGB32_Premultiplied; QTest::newRow("64x64 ARGB32_Premultiplied") << QSize(64, 64) |