Removed debug operator autotests.
For QVideoFrame, QAudioFormat and QVideoSurfaceFormat. There's no point in testing the formatting of the debug operator. These tests can break every time there's a change in QDebug's output policy. Change-Id: I2349b4722a428bc4c56ca58b13889790e86df4c1 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
cd7882b760
commit
c5c3ce6f9b
@@ -69,9 +69,6 @@ private slots:
|
||||
|
||||
void checkSizes();
|
||||
void checkSizes_data();
|
||||
|
||||
void debugOperator();
|
||||
void debugOperator_data();
|
||||
};
|
||||
|
||||
void tst_QAudioFormat::checkNull()
|
||||
@@ -316,42 +313,6 @@ void tst_QAudioFormat::checkSizes_data()
|
||||
QTest::newRow("2ch_16b_8k_signed_8000_duration4") << f << 4 << 8000 << qrtr << 2000 << 8000 << qrtr + 126 << 8004 << 2001;
|
||||
}
|
||||
|
||||
void tst_QAudioFormat::debugOperator_data()
|
||||
{
|
||||
QTest::addColumn<QAudioFormat>("format");
|
||||
QTest::addColumn<QString>("stringized");
|
||||
|
||||
// A small sampling
|
||||
QAudioFormat f;
|
||||
QTest::newRow("plain") << f << QString::fromLatin1("QAudioFormat(-1Hz, -1bit, channelCount=-1, sampleType=Unknown, byteOrder=LittleEndian, codec=\"\")");
|
||||
|
||||
f.setSampleRate(22050);
|
||||
f.setByteOrder(QAudioFormat::LittleEndian);
|
||||
f.setChannelCount(4);
|
||||
f.setCodec("audio/pcm");
|
||||
f.setSampleType(QAudioFormat::Float);
|
||||
|
||||
QTest::newRow("float") << f << QString::fromLatin1("QAudioFormat(22050Hz, -1bit, channelCount=4, sampleType=Float, byteOrder=LittleEndian, codec=\"audio/pcm\")");
|
||||
|
||||
f.setSampleType(QAudioFormat::UnSignedInt);
|
||||
QTest::newRow("unsigned") << f << QString::fromLatin1("QAudioFormat(22050Hz, -1bit, channelCount=4, sampleType=UnSignedInt, byteOrder=LittleEndian, codec=\"audio/pcm\")");
|
||||
|
||||
f.setSampleRate(44100);
|
||||
QTest::newRow("44.1 unsigned") << f << QString::fromLatin1("QAudioFormat(44100Hz, -1bit, channelCount=4, sampleType=UnSignedInt, byteOrder=LittleEndian, codec=\"audio/pcm\")");
|
||||
|
||||
f.setByteOrder(QAudioFormat::BigEndian);
|
||||
QTest::newRow("44.1 big unsigned") << f << QString::fromLatin1("QAudioFormat(44100Hz, -1bit, channelCount=4, sampleType=UnSignedInt, byteOrder=BigEndian, codec=\"audio/pcm\")");
|
||||
}
|
||||
|
||||
void tst_QAudioFormat::debugOperator()
|
||||
{
|
||||
QFETCH(QAudioFormat, format);
|
||||
QFETCH(QString, stringized);
|
||||
|
||||
QTest::ignoreMessage(QtDebugMsg, stringized.toLatin1().constData());
|
||||
qDebug() << format;
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QAudioFormat)
|
||||
|
||||
#include "tst_qaudioformat.moc"
|
||||
|
||||
@@ -93,15 +93,6 @@ private slots:
|
||||
|
||||
void metadata();
|
||||
|
||||
void debugType_data();
|
||||
void debugType();
|
||||
|
||||
void debug_data();
|
||||
void debug();
|
||||
|
||||
void debugFormat_data();
|
||||
void debugFormat();
|
||||
|
||||
void isMapped();
|
||||
void isReadable();
|
||||
void isWritable();
|
||||
@@ -1028,154 +1019,6 @@ void tst_QVideoFrame::isWritable()
|
||||
frame.unmap();
|
||||
}
|
||||
|
||||
void tst_QVideoFrame::debugType_data()
|
||||
{
|
||||
QTest::addColumn<QVideoFrame::FieldType>("fieldType");
|
||||
QTest::addColumn<QString>("stringized");
|
||||
|
||||
ADD_ENUM_TEST(ProgressiveFrame);
|
||||
ADD_ENUM_TEST(InterlacedFrame);
|
||||
ADD_ENUM_TEST(TopField);
|
||||
ADD_ENUM_TEST(BottomField);
|
||||
}
|
||||
|
||||
void tst_QVideoFrame::debugType()
|
||||
{
|
||||
QFETCH(QVideoFrame::FieldType, fieldType);
|
||||
QFETCH(QString, stringized);
|
||||
|
||||
QTest::ignoreMessage(QtDebugMsg, stringized.toLatin1().constData());
|
||||
qDebug() << fieldType;
|
||||
}
|
||||
|
||||
void tst_QVideoFrame::debug_data()
|
||||
{
|
||||
QTest::addColumn<QVideoFrame>("frame");
|
||||
QTest::addColumn<QString>("stringized");
|
||||
|
||||
QVideoFrame f;
|
||||
QTest::newRow("default") << f << QString::fromLatin1("QVideoFrame(QSize(-1, -1) , Format_Invalid, NoHandle, NotMapped, [no timestamp])");
|
||||
|
||||
QVideoFrame f2;
|
||||
f2.setStartTime(12345);
|
||||
f2.setEndTime(8000000000LL);
|
||||
QTest::newRow("times") << f2 << QString::fromLatin1("QVideoFrame(QSize(-1, -1) , Format_Invalid, NoHandle, NotMapped, 0:00:00.12345 - 2:13:20.00)");
|
||||
|
||||
QVideoFrame f3;
|
||||
f3.setFieldType(QVideoFrame::ProgressiveFrame);
|
||||
QTest::newRow("times prog") << f3 << QString::fromLatin1("QVideoFrame(QSize(-1, -1) , Format_Invalid, NoHandle, NotMapped, [no timestamp])");
|
||||
|
||||
QVideoFrame f4;
|
||||
f4.setFieldType(QVideoFrame::TopField);
|
||||
QTest::newRow("times top") << f4 << QString::fromLatin1("QVideoFrame(QSize(-1, -1) , Format_Invalid, NoHandle, NotMapped, [no timestamp])");
|
||||
|
||||
QVideoFrame f5;
|
||||
f5.setFieldType(QVideoFrame::TopField);
|
||||
f5.setEndTime(90000000000LL);
|
||||
QTest::newRow("end but no start") << f5 << QString::fromLatin1("QVideoFrame(QSize(-1, -1) , Format_Invalid, NoHandle, NotMapped, [no timestamp])");
|
||||
|
||||
QVideoFrame f6;
|
||||
f6.setStartTime(12345000000LL);
|
||||
f6.setEndTime(80000000000LL);
|
||||
QTest::newRow("times big") << f6 << QString::fromLatin1("QVideoFrame(QSize(-1, -1) , Format_Invalid, NoHandle, NotMapped, 3:25:45.00 - 22:13:20.00)");
|
||||
|
||||
QVideoFrame g(0, QSize(320,240), 640, QVideoFrame::Format_ARGB32);
|
||||
QTest::newRow("more valid") << g << QString::fromLatin1("QVideoFrame(QSize(320, 240) , Format_ARGB32, NoHandle, NotMapped, [no timestamp])");
|
||||
|
||||
QVideoFrame g2(0, QSize(320,240), 640, QVideoFrame::Format_ARGB32);
|
||||
g2.setStartTime(9000000000LL);
|
||||
g2.setEndTime(9000000000LL);
|
||||
QTest::newRow("more valid") << g2 << QString::fromLatin1("QVideoFrame(QSize(320, 240) , Format_ARGB32, NoHandle, NotMapped, @2:30:00.00)");
|
||||
|
||||
QVideoFrame g3(0, QSize(320,240), 640, QVideoFrame::Format_ARGB32);
|
||||
g3.setStartTime(900000LL);
|
||||
g3.setEndTime(900000LL);
|
||||
QTest::newRow("more valid single timestamp") << g3 << QString::fromLatin1("QVideoFrame(QSize(320, 240) , Format_ARGB32, NoHandle, NotMapped, @00:00.900000)");
|
||||
|
||||
QVideoFrame g4(0, QSize(320,240), 640, QVideoFrame::Format_ARGB32);
|
||||
g4.setStartTime(200000000LL);
|
||||
g4.setEndTime(300000000LL);
|
||||
QTest::newRow("more valid") << g4 << QString::fromLatin1("QVideoFrame(QSize(320, 240) , Format_ARGB32, NoHandle, NotMapped, 03:20.00 - 05:00.00)");
|
||||
|
||||
QVideoFrame g5(0, QSize(320,240), 640, QVideoFrame::Format_ARGB32);
|
||||
g5.setStartTime(200000000LL);
|
||||
QTest::newRow("more valid until forever") << g5 << QString::fromLatin1("QVideoFrame(QSize(320, 240) , Format_ARGB32, NoHandle, NotMapped, 03:20.00 - forever)");
|
||||
|
||||
QVideoFrame g6(0, QSize(320,240), 640, QVideoFrame::Format_ARGB32);
|
||||
g6.setStartTime(9000000000LL);
|
||||
QTest::newRow("more valid for long forever") << g6 << QString::fromLatin1("QVideoFrame(QSize(320, 240) , Format_ARGB32, NoHandle, NotMapped, 2:30:00.00 - forever)");
|
||||
|
||||
QVideoFrame g7(0, QSize(320,240), 640, QVideoFrame::Format_ARGB32);
|
||||
g7.setStartTime(9000000000LL);
|
||||
g7.setMetaData("bar", 42);
|
||||
QTest::newRow("more valid for long forever + metadata") << g7 << QString::fromLatin1("QVideoFrame(QSize(320, 240) , Format_ARGB32, NoHandle, NotMapped, 2:30:00.00 - forever, metaData: QMap((\"bar\", QVariant(int, 42) ) ) )");
|
||||
}
|
||||
|
||||
void tst_QVideoFrame::debug()
|
||||
{
|
||||
QFETCH(QVideoFrame, frame);
|
||||
QFETCH(QString, stringized);
|
||||
|
||||
QTest::ignoreMessage(QtDebugMsg, stringized.toLatin1().constData());
|
||||
qDebug() << frame;
|
||||
}
|
||||
|
||||
void tst_QVideoFrame::debugFormat_data()
|
||||
{
|
||||
QTest::addColumn<QVideoFrame::PixelFormat>("format");
|
||||
QTest::addColumn<QString>("stringized");
|
||||
|
||||
ADD_ENUM_TEST(Format_Invalid);
|
||||
ADD_ENUM_TEST(Format_ARGB32);
|
||||
ADD_ENUM_TEST(Format_ARGB32_Premultiplied);
|
||||
ADD_ENUM_TEST(Format_RGB32);
|
||||
ADD_ENUM_TEST(Format_RGB24);
|
||||
ADD_ENUM_TEST(Format_RGB565);
|
||||
ADD_ENUM_TEST(Format_RGB555);
|
||||
ADD_ENUM_TEST(Format_ARGB8565_Premultiplied);
|
||||
ADD_ENUM_TEST(Format_BGRA32);
|
||||
ADD_ENUM_TEST(Format_BGRA32_Premultiplied);
|
||||
ADD_ENUM_TEST(Format_BGR32);
|
||||
ADD_ENUM_TEST(Format_BGR24);
|
||||
ADD_ENUM_TEST(Format_BGR565);
|
||||
ADD_ENUM_TEST(Format_BGR555);
|
||||
ADD_ENUM_TEST(Format_BGRA5658_Premultiplied);
|
||||
|
||||
ADD_ENUM_TEST(Format_AYUV444);
|
||||
ADD_ENUM_TEST(Format_AYUV444_Premultiplied);
|
||||
ADD_ENUM_TEST(Format_YUV444);
|
||||
ADD_ENUM_TEST(Format_YUV420P);
|
||||
ADD_ENUM_TEST(Format_YV12);
|
||||
ADD_ENUM_TEST(Format_UYVY);
|
||||
ADD_ENUM_TEST(Format_YUYV);
|
||||
ADD_ENUM_TEST(Format_NV12);
|
||||
ADD_ENUM_TEST(Format_NV21);
|
||||
ADD_ENUM_TEST(Format_IMC1);
|
||||
ADD_ENUM_TEST(Format_IMC2);
|
||||
ADD_ENUM_TEST(Format_IMC3);
|
||||
ADD_ENUM_TEST(Format_IMC4);
|
||||
ADD_ENUM_TEST(Format_Y8);
|
||||
ADD_ENUM_TEST(Format_Y16);
|
||||
|
||||
ADD_ENUM_TEST(Format_Jpeg);
|
||||
|
||||
ADD_ENUM_TEST(Format_CameraRaw);
|
||||
ADD_ENUM_TEST(Format_AdobeDng);
|
||||
|
||||
// User enums are formatted differently
|
||||
QTest::newRow("user 1000") << QVideoFrame::Format_User << QString::fromLatin1("UserType(1000)");
|
||||
QTest::newRow("user 1005") << QVideoFrame::PixelFormat(QVideoFrame::Format_User + 5) << QString::fromLatin1("UserType(1005)");
|
||||
}
|
||||
|
||||
void tst_QVideoFrame::debugFormat()
|
||||
{
|
||||
QFETCH(QVideoFrame::PixelFormat, format);
|
||||
QFETCH(QString, stringized);
|
||||
|
||||
QTest::ignoreMessage(QtDebugMsg, stringized.toLatin1().constData());
|
||||
qDebug() << format;
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QVideoFrame)
|
||||
|
||||
#include "tst_qvideoframe.moc"
|
||||
|
||||
@@ -93,8 +93,6 @@ private slots:
|
||||
void assignAllParameters ();
|
||||
|
||||
void propertyEdgeCases();
|
||||
void debugOperator();
|
||||
void debugOperator_data();
|
||||
};
|
||||
|
||||
tst_QVideoSurfaceFormat::tst_QVideoSurfaceFormat()
|
||||
@@ -918,108 +916,6 @@ void tst_QVideoSurfaceFormat::propertyEdgeCases()
|
||||
QCOMPARE(original.pixelAspectRatio(), QSize(53, 45));
|
||||
}
|
||||
|
||||
#define ADDDEBUGTEST(format, w, h, r) \
|
||||
QTest::newRow(#format "-" #w "x" #h "@" #r) \
|
||||
<< QVideoFrame::Format_ ##format \
|
||||
<< "Format_" #format \
|
||||
<< QSize(w, h) \
|
||||
<< r;
|
||||
|
||||
void tst_QVideoSurfaceFormat::debugOperator_data()
|
||||
{
|
||||
// This is not too exhaustive
|
||||
QTest::addColumn<QVideoFrame::PixelFormat>("format");
|
||||
QTest::addColumn<QString>("formatString");
|
||||
QTest::addColumn<QSize>("frameSize");
|
||||
QTest::addColumn<int>("frameRate"); // could be double, but formatting is unstable
|
||||
|
||||
ADDDEBUGTEST(Invalid, 100, 200, 3);
|
||||
ADDDEBUGTEST(ARGB32,101, 201, 4);
|
||||
ADDDEBUGTEST(ARGB32_Premultiplied, 100, 202, 5);
|
||||
ADDDEBUGTEST(RGB32, 8, 16, 30);
|
||||
ADDDEBUGTEST(RGB24, 8, 16, 30);
|
||||
ADDDEBUGTEST(RGB565, 8, 16, 30);
|
||||
ADDDEBUGTEST(RGB555, 8, 16, 30);
|
||||
ADDDEBUGTEST(ARGB8565_Premultiplied, 8, 16, 30);
|
||||
ADDDEBUGTEST(BGRA32, 8, 16, 30);
|
||||
ADDDEBUGTEST(BGRA32_Premultiplied, 8, 16, 30);
|
||||
ADDDEBUGTEST(BGR32, 8, 16, 30);
|
||||
ADDDEBUGTEST(BGR24, 8, 16, 30);
|
||||
ADDDEBUGTEST(BGR565, 8, 16, 30);
|
||||
ADDDEBUGTEST(BGR555, 8, 16, 30);
|
||||
ADDDEBUGTEST(BGRA5658_Premultiplied, 8, 16, 30);
|
||||
|
||||
ADDDEBUGTEST(AYUV444, 8, 16, 30);
|
||||
ADDDEBUGTEST(AYUV444, 8, 16, 31);
|
||||
ADDDEBUGTEST(AYUV444_Premultiplied, 8, 16, 30);
|
||||
ADDDEBUGTEST(YUV444, 8, 16, 30);
|
||||
ADDDEBUGTEST(YUV420P, 8, 16, 30);
|
||||
ADDDEBUGTEST(YV12, 8, 16, 30);
|
||||
ADDDEBUGTEST(UYVY, 8, 16, 30);
|
||||
ADDDEBUGTEST(YUYV, 8, 16, 30);
|
||||
ADDDEBUGTEST(NV12, 8, 16, 30);
|
||||
ADDDEBUGTEST(NV12, 80, 16, 30);
|
||||
ADDDEBUGTEST(NV21, 8, 16, 30);
|
||||
ADDDEBUGTEST(IMC1, 8, 16, 30);
|
||||
ADDDEBUGTEST(IMC2, 8, 16, 30);
|
||||
ADDDEBUGTEST(IMC3, 8, 16, 30);
|
||||
ADDDEBUGTEST(IMC3, 8, 160, 30);
|
||||
ADDDEBUGTEST(IMC4, 8, 16, 30);
|
||||
ADDDEBUGTEST(Y8, 8, 16, 30);
|
||||
ADDDEBUGTEST(Y16, 8, 16, 30);
|
||||
|
||||
ADDDEBUGTEST(Jpeg, 8, 16, 30);
|
||||
|
||||
ADDDEBUGTEST(CameraRaw, 8, 16, 30);
|
||||
ADDDEBUGTEST(AdobeDng, 8, 16, 30);
|
||||
|
||||
// User is special
|
||||
QTest::newRow("User-0x0@0)")
|
||||
<< QVideoFrame::Format_User
|
||||
<< "UserType(1000)"
|
||||
<< QSize()
|
||||
<< 0;
|
||||
}
|
||||
|
||||
void tst_QVideoSurfaceFormat::debugOperator()
|
||||
{
|
||||
QFETCH(QVideoFrame::PixelFormat, format);
|
||||
QFETCH(QString, formatString);
|
||||
QFETCH(QSize, frameSize);
|
||||
QFETCH(int, frameRate);
|
||||
|
||||
QString templateOutput = QString("QVideoSurfaceFormat(%1, QSize(%2, %3) , viewport=QRect(0,1 800x600) , pixelAspectRatio=QSize(320, 200) "
|
||||
", handleType=GLTextureHandle, yCbCrColorSpace=YCbCr_BT709)\n"
|
||||
" handleType = QVariant(QAbstractVideoBuffer::HandleType, ) \n"
|
||||
" pixelFormat = QVariant(QVideoFrame::PixelFormat, ) \n"
|
||||
" frameSize = QVariant(QSize, QSize(%4, %5) ) \n"
|
||||
" frameWidth = QVariant(int, %6) \n"
|
||||
" viewport = QVariant(QRect, QRect(0,1 800x600) ) \n"
|
||||
" scanLineDirection = QVariant(QVideoSurfaceFormat::Direction, ) \n"
|
||||
" frameRate = QVariant(%7, %8) \n"
|
||||
" pixelAspectRatio = QVariant(QSize, QSize(320, 200) ) \n"
|
||||
" sizeHint = QVariant(QSize, QSize(1280, 600) ) \n"
|
||||
" yCbCrColorSpace = QVariant(QVideoSurfaceFormat::YCbCrColorSpace, ) ")
|
||||
.arg(formatString)
|
||||
.arg(frameSize.width())
|
||||
.arg(frameSize.height())
|
||||
.arg(frameSize.width())
|
||||
.arg(frameSize.height())
|
||||
.arg(frameSize.width())
|
||||
.arg(sizeof(qreal) == sizeof(double) ? "double" : "float")
|
||||
.arg(frameRate);
|
||||
|
||||
QVideoSurfaceFormat vsf(frameSize, format, QAbstractVideoBuffer::GLTextureHandle);
|
||||
vsf.setViewport(QRect(0,1, 800, 600));
|
||||
vsf.setPixelAspectRatio(QSize(320, 200));
|
||||
vsf.setYCbCrColorSpace(QVideoSurfaceFormat::YCbCr_BT709);
|
||||
vsf.setFrameRate(frameRate);
|
||||
|
||||
QTest::ignoreMessage(QtDebugMsg, templateOutput.toLatin1().constData());
|
||||
qDebug() << vsf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QTEST_MAIN(tst_QVideoSurfaceFormat)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user