Commit 51b361fa authored by VaL Doroshchuk's avatar VaL Doroshchuk
Browse files

Adjust timeouts for QSounds auto tests


These tests contains fixed timeouts which sometimes is not enough,
causing the test to fail under heavy load.
Since isFinished() doesn't actually tell if a device has started,
the timeout might come too early, e.g., when the device is still waiting
for data, or even before it has started.

Change-Id: I8f2f8341b9fcf656d86d161203c7eb63e66acca5
Reviewed-by: default avatarChristian Stromme <christian.stromme@qt.io>
Showing with 3 additions and 7 deletions
......@@ -88,9 +88,7 @@ void tst_QSound::testLooping()
QVERIFY(!sound->isFinished());
// test.wav is about 200ms, wait until it has finished playing 5 times
QTest::qWait(3000);
QVERIFY(sound->isFinished());
QTRY_VERIFY(sound->isFinished());
QCOMPARE(sound->loopsRemaining(),0);
}
......@@ -99,8 +97,7 @@ void tst_QSound::testPlay()
sound->setLoops(1);
sound->play();
QVERIFY(!sound->isFinished());
QTest::qWait(1000);
QVERIFY(sound->isFinished());
QTRY_VERIFY(sound->isFinished());
}
void tst_QSound::testStop()
......@@ -110,8 +107,7 @@ void tst_QSound::testStop()
QVERIFY(!sound->isFinished());
QTest::qWait(1000);
sound->stop();
QTest::qWait(1000);
QVERIFY(sound->isFinished());
QTRY_VERIFY(sound->isFinished());
}
void tst_QSound::testStaticPlay()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment