Improve video test coverage and debugging output.

Added a few debug operators for some useful enums, and
added tests for them.  One or two other features not really
tested.

Change-Id: Idffec6ade1d4e05dbf72f3dc47dfc0d01ddddf8b
Reviewed-on: http://codereview.qt-project.org/6201
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
Michael Goddard
2011-10-07 12:03:35 +10:00
committed by Qt by Nokia
parent 03f22bcdaf
commit adca03adfd
10 changed files with 464 additions and 149 deletions

View File

@@ -100,33 +100,41 @@ void tst_QAbstractVideoBuffer::cleanup()
{
}
#define ADD_HANDLE_TEST(x) \
QTest::newRow(#x) \
<< QAbstractVideoBuffer::x \
<< QString(QLatin1String(#x));
void tst_QAbstractVideoBuffer::handleType_data()
{
QTest::addColumn<QAbstractVideoBuffer::HandleType>("type");
QTest::addColumn<QString>("stringized");
ADD_HANDLE_TEST(NoHandle);
ADD_HANDLE_TEST(GLTextureHandle);
ADD_HANDLE_TEST(XvShmImageHandle);
ADD_HANDLE_TEST(QPixmapHandle);
ADD_HANDLE_TEST(CoreImageHandle);
// User handles are different
QTest::newRow("none")
<< QAbstractVideoBuffer::NoHandle;
QTest::newRow("opengl")
<< QAbstractVideoBuffer::GLTextureHandle;
QTest::newRow("XvShmImageHandle")
<< QAbstractVideoBuffer::XvShmImageHandle;
QTest::newRow("CoreImageHandle")
<< QAbstractVideoBuffer::CoreImageHandle;
QTest::newRow("QPixmapHandle")
<< QAbstractVideoBuffer::QPixmapHandle;
QTest::newRow("user1")
<< QAbstractVideoBuffer::UserHandle;
<< QAbstractVideoBuffer::UserHandle << QString::fromAscii("UserHandle(1000)");
QTest::newRow("user2")
<< QAbstractVideoBuffer::HandleType(QAbstractVideoBuffer::UserHandle + 1);
<< QAbstractVideoBuffer::HandleType(QAbstractVideoBuffer::UserHandle + 1) << QString::fromAscii("UserHandle(1001)");
}
void tst_QAbstractVideoBuffer::handleType()
{
QFETCH(QAbstractVideoBuffer::HandleType, type);
QFETCH(QString, stringized);
QtTestVideoBuffer buffer(type);
QCOMPARE(buffer.handleType(), type);
QTest::ignoreMessage(QtDebugMsg, stringized.toLatin1().constData());
qDebug() << type;
}
void tst_QAbstractVideoBuffer::handle()