summaryrefslogtreecommitdiffstats
path: root/tests/auto/unit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/unit')
-rw-r--r--tests/auto/unit/qmediapluginloader/tst_qmediapluginloader.cpp4
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h21
-rw-r--r--tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp22
3 files changed, 27 insertions, 20 deletions
diff --git a/tests/auto/unit/qmediapluginloader/tst_qmediapluginloader.cpp b/tests/auto/unit/qmediapluginloader/tst_qmediapluginloader.cpp
index 3a7b661df..ce1b2b9d0 100644
--- a/tests/auto/unit/qmediapluginloader/tst_qmediapluginloader.cpp
+++ b/tests/auto/unit/qmediapluginloader/tst_qmediapluginloader.cpp
@@ -72,7 +72,7 @@ void tst_QMediaPluginLoader::testInstance()
if (keys.isEmpty()) // Test is invalidated, skip.
QSKIP("No plug-ins available");
- foreach (const QString &key, keys)
+ for (const QString &key : keys)
QVERIFY(loader->instance(key) != 0);
}
@@ -83,7 +83,7 @@ void tst_QMediaPluginLoader::testInstances()
if (keys.isEmpty()) // Test is invalidated, skip.
QSKIP("No plug-ins available");
- foreach (const QString &key, keys)
+ for (const QString &key : keys)
QVERIFY(loader->instances(key).size() > 0);
}
diff --git a/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h b/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h
index 017615aa9..1b2372cf5 100644
--- a/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h
+++ b/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h
@@ -51,13 +51,22 @@ public:
m_shutterRanges << 0.001 << 0.01 << 0.1 << 1.0;
m_exposureRanges << -2.0 << 2.0;
- QList<QCameraExposure::ExposureMode> exposureModes;
- exposureModes << QCameraExposure::ExposureAuto << QCameraExposure::ExposureManual << QCameraExposure::ExposureBacklight
- << QCameraExposure::ExposureNight << QCameraExposure::ExposureSpotlight << QCameraExposure::ExposureSports
- << QCameraExposure::ExposureSnow << QCameraExposure:: ExposureLargeAperture << QCameraExposure::ExposureSmallAperture
- << QCameraExposure::ExposurePortrait << QCameraExposure::ExposureModeVendor << QCameraExposure::ExposureBeach;
+ const QCameraExposure::ExposureMode exposureModes[] = {
+ QCameraExposure::ExposureAuto,
+ QCameraExposure::ExposureManual,
+ QCameraExposure::ExposureBacklight,
+ QCameraExposure::ExposureNight,
+ QCameraExposure::ExposureSpotlight,
+ QCameraExposure::ExposureSports,
+ QCameraExposure::ExposureSnow,
+ QCameraExposure:: ExposureLargeAperture,
+ QCameraExposure::ExposureSmallAperture,
+ QCameraExposure::ExposurePortrait,
+ QCameraExposure::ExposureModeVendor,
+ QCameraExposure::ExposureBeach,
+ };
- foreach (QCameraExposure::ExposureMode mode, exposureModes)
+ for (QCameraExposure::ExposureMode mode : exposureModes)
m_exposureModes << QVariant::fromValue<QCameraExposure::ExposureMode>(mode);
m_meteringModes << QVariant::fromValue<QCameraExposure::MeteringMode>(QCameraExposure::MeteringMatrix)
diff --git a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp
index 43dc52022..7ba631e58 100644
--- a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp
+++ b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp
@@ -730,16 +730,14 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data()
QTest::addColumn<bool>("supportedPixelFormat");
QTest::addColumn<bool>("supportedFormat");
- QList<QPair<QPainterVideoSurface::ShaderType, QByteArray> > types;
-
-
+ const QPair<QPainterVideoSurface::ShaderType, QByteArray> types[] = {
#if !defined(QT_OPENGL_ES)
- types << qMakePair(QPainterVideoSurface::FragmentProgramShader, QByteArray("ARBfp: "));
+ qMakePair(QPainterVideoSurface::FragmentProgramShader, QByteArray("ARBfp: ")),
#endif
- types << qMakePair(QPainterVideoSurface::GlslShader, QByteArray("GLSL: "));
+ qMakePair(QPainterVideoSurface::GlslShader, QByteArray("GLSL: ")),
+ };
- QPair<QPainterVideoSurface::ShaderType, QByteArray> type;
- foreach (type, types) {
+ for (const auto &type : types) {
QTest::newRow((type.second + "rgb32 640x480").constData())
<< type.first
<< QAbstractVideoBuffer::NoHandle
@@ -952,14 +950,14 @@ void tst_QPainterVideoSurface::shaderPresent_data()
QTest::addColumn<int>("bytesB");
QTest::addColumn<int>("bytesPerLineB");
- QList<QPair<QPainterVideoSurface::ShaderType, QByteArray> > types;
+ const QPair<QPainterVideoSurface::ShaderType, QByteArray> types[] = {
#if !defined(QT_OPENGL_ES)
- types << qMakePair(QPainterVideoSurface::FragmentProgramShader, QByteArray("ARBfp: "));
+ qMakePair(QPainterVideoSurface::FragmentProgramShader, QByteArray("ARBfp: ")),
#endif
- types << qMakePair(QPainterVideoSurface::GlslShader, QByteArray("GLSL: "));
+ qMakePair(QPainterVideoSurface::GlslShader, QByteArray("GLSL: ")),
+ };
- QPair<QPainterVideoSurface::ShaderType, QByteArray> type;
- foreach (type, types) {
+ for (const auto &type : types) {
QTest::newRow((type.second + "rgb32 -> argb32").constData())
<< type.first
<< QVideoFrame::Format_RGB32