summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Goddard <michael.goddard@nokia.com>2012-02-08 11:54:11 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-08 04:38:16 +0100
commite241932c974f4b5e36052e4a37e718d9ec3c227b (patch)
tree741c280363e085a2477a4aae8ddd43f0897d2995
parent6de7c3104006c3aa919a697bc94ec99a3f0c4140 (diff)
Remove some more QTest::qWait(10) calls.
Since it seems to have changed slightly recently. Just use QTRY_COMPARE instead. Change-Id: I802c2e26acf5418bb5904fadd2a978a44fd9eb01 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
-rw-r--r--tests/auto/unit/qcamera/tst_qcamera.cpp15
-rw-r--r--tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp6
-rw-r--r--tests/auto/unit/qvideowidget/tst_qvideowidget.cpp5
3 files changed, 6 insertions, 20 deletions
diff --git a/tests/auto/unit/qcamera/tst_qcamera.cpp b/tests/auto/unit/qcamera/tst_qcamera.cpp
index 08bd953c..565a8c2c 100644
--- a/tests/auto/unit/qcamera/tst_qcamera.cpp
+++ b/tests/auto/unit/qcamera/tst_qcamera.cpp
@@ -475,10 +475,7 @@ void tst_QCamera::testCameraCapture()
imageCapture.capture(QString::fromLatin1("/dev/null"));
- for (int i=0; i<100 && capturedSignal.isEmpty(); i++)
- QTest::qWait(10);
-
- QCOMPARE(capturedSignal.size(), 1);
+ QTRY_COMPARE(capturedSignal.size(), 1);
QCOMPARE(errorSignal.size(), 0);
QCOMPARE(imageCapture.error(), QCameraImageCapture::NoError);
}
@@ -494,10 +491,7 @@ void tst_QCamera::testCameraCaptureMetadata()
camera.start();
int id = imageCapture.capture(QString::fromLatin1("/dev/null"));
- for (int i=0; i<100 && savedSignal.isEmpty(); i++)
- QTest::qWait(10);
-
- QCOMPARE(savedSignal.size(), 1);
+ QTRY_COMPARE(savedSignal.size(), 1);
QCOMPARE(metadataSignal.size(), 3);
@@ -885,10 +879,7 @@ void tst_QCamera::testCameraLock()
lockFailedSignal.clear();
lockStatusChangedSignal.clear();
- for (int i=0; i<200 && camera.lockStatus() == QCamera::Searching; i++)
- QTest::qWait(10);
-
- QCOMPARE(camera.lockStatus(), QCamera::Locked);
+ QTRY_COMPARE(camera.lockStatus(), QCamera::Locked);
QCOMPARE(lockedSignal.count(), 1);
QCOMPARE(lockFailedSignal.count(), 0);
QCOMPARE(lockStatusChangedSignal.count(), 1);
diff --git a/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp
index 71315953..220bb20c 100644
--- a/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp
+++ b/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp
@@ -718,8 +718,7 @@ void tst_QMediaRecorder::testSettingsApplied()
//the settings are applied in the next event loop
QMediaRecorder recorder(&object);
QCOMPARE(recorderControl.m_settingAppliedCount, 0);
- QTest::qWait(10);
- QCOMPARE(recorderControl.m_settingAppliedCount, 1);
+ QTRY_COMPARE(recorderControl.m_settingAppliedCount, 1);
QVideoEncoderSettings videoSettings;
videoSettings.setResolution(640,480);
@@ -732,8 +731,7 @@ void tst_QMediaRecorder::testSettingsApplied()
recorder.setContainerFormat("mkv");
QCOMPARE(recorderControl.m_settingAppliedCount, 1);
- QTest::qWait(10);
- QCOMPARE(recorderControl.m_settingAppliedCount, 2);
+ QTRY_COMPARE(recorderControl.m_settingAppliedCount, 2);
//encoder settings are applied before recording if changed
audioSettings.setQuality(QtMultimedia::VeryHighQuality);
diff --git a/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp b/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp
index 5d08a578..59816b4c 100644
--- a/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp
+++ b/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp
@@ -1554,10 +1554,7 @@ void tst_QVideoWidget::paintRendererControl()
QCOMPARE(surface->isActive(), true);
QCOMPARE(surface->isReady(), false);
- //wait up to 2 seconds for the frame to be presented
- for (int i=0; i<200 && !surface->isReady(); i++)
- QTest::qWait(10);
-
+ QTRY_COMPARE(surface->isReady(), true);
QCOMPARE(surface->isActive(), true);
QCOMPARE(surface->isReady(), true);
}