summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-07-22 12:42:34 +1000
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 13:06:35 +0300
commit9914df6e8f032f543c153fa219a5da0911f8b952 (patch)
treeda942d03754b34f594496b317041bc41e69d2cd7 /tests
parent29521380faf95d75009613cc8a3c7c1e8f7f93a3 (diff)
Fixed QVideoSurfaceFormat::isValid()
Trivial fix, valid formats have pixel format != Invalid, not ==. Task-number: QTBUG-12337 Reviewed-by: Andrew den Exter (cherry picked from commit 51cf737151c1c446a9ce77832774202b6bdb4ba2)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
index f68ce8b588..5ac58b4005 100644
--- a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
+++ b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
@@ -127,16 +127,37 @@ void tst_QVideoSurfaceFormat::construct_data()
QTest::addColumn<QSize>("frameSize");
QTest::addColumn<QVideoFrame::PixelFormat>("pixelFormat");
QTest::addColumn<QAbstractVideoBuffer::HandleType>("handleType");
+ QTest::addColumn<bool>("valid");
QTest::newRow("32x32 rgb32 no handle")
<< QSize(32, 32)
<< QVideoFrame::Format_RGB32
- << QAbstractVideoBuffer::NoHandle;
+ << QAbstractVideoBuffer::NoHandle
+ << true;
QTest::newRow("1024x768 YUV444 GL texture")
<< QSize(32, 32)
<< QVideoFrame::Format_YUV444
- << QAbstractVideoBuffer::GLTextureHandle;
+ << QAbstractVideoBuffer::GLTextureHandle
+ << true;
+
+ QTest::newRow("32x32 invalid no handle")
+ << QSize(32, 32)
+ << QVideoFrame::Format_Invalid
+ << QAbstractVideoBuffer::NoHandle
+ << false;
+
+ QTest::newRow("invalid size, rgb32 no handle")
+ << QSize()
+ << QVideoFrame::Format_RGB32
+ << QAbstractVideoBuffer::NoHandle
+ << false;
+
+ QTest::newRow("0x0 rgb32 no handle")
+ << QSize(0,0)
+ << QVideoFrame::Format_RGB32
+ << QAbstractVideoBuffer::NoHandle
+ << true;
}
void tst_QVideoSurfaceFormat::construct()
@@ -144,6 +165,7 @@ void tst_QVideoSurfaceFormat::construct()
QFETCH(QSize, frameSize);
QFETCH(QVideoFrame::PixelFormat, pixelFormat);
QFETCH(QAbstractVideoBuffer::HandleType, handleType);
+ QFETCH(bool, valid);
QRect viewport(QPoint(0, 0), frameSize);
@@ -154,6 +176,7 @@ void tst_QVideoSurfaceFormat::construct()
QCOMPARE(format.frameSize(), frameSize);
QCOMPARE(format.frameWidth(), frameSize.width());
QCOMPARE(format.frameHeight(), frameSize.height());
+ QCOMPARE(format.isValid(), valid);
QCOMPARE(format.viewport(), viewport);
QCOMPARE(format.scanLineDirection(), QVideoSurfaceFormat::TopToBottom);
QCOMPARE(format.frameRate(), 0.0);