Stabilize tst_QAudioOutput::pullSuspendResume()

Don't wait after resume(); the test is meant to check the state of the
QAudioOutput right after the call, not later. The state and the error
status are supposed to change immediately, even if the backend runs in
another thread.
Ignore any state change that can happen because of underrun errors
(likely to happen on CI).
Removed the test from blacklist.

Change-Id: Idaef6a9e0dfcfc89424fb2383cf3830a3184f975
Reviewed-by: Milla Pohjanheimo <milla.pohjanheimo@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
This commit is contained in:
Yoann Lopes
2016-09-21 10:59:20 +03:00
parent 6b94b3ca91
commit 7d00a457e4
2 changed files with 2 additions and 10 deletions

View File

@@ -1,5 +0,0 @@
[pullSuspendResume]
redhatenterpriselinuxworkstation-6.6
rhel-7.1
ubuntu-14.04
opensuse-13.1 64bit

View File

@@ -612,9 +612,6 @@ void tst_QAudioOutput::pullSuspendResume()
audioOutput.resume();
// Give backends running in separate threads a chance to suspend.
QTest::qWait(100);
// Check that QAudioOutput immediately transitions to ActiveState
QVERIFY2((stateSignal.count() == 1),
QString("didn't emit signal after resume(), got %1 signals instead").arg(stateSignal.count()).toLocal8Bit().constData());
@@ -626,8 +623,8 @@ void tst_QAudioOutput::pullSuspendResume()
QTest::qWait(3000); // 3 seconds should be plenty
QVERIFY2(audioFile->atEnd(), "didn't play to EOF");
QVERIFY2((stateSignal.count() == 1),
QString("didn't emit IdleState signal when at EOF, got %1 signals instead").arg(stateSignal.count()).toLocal8Bit().constData());
QVERIFY(stateSignal.count() > 0);
QCOMPARE(qvariant_cast<QAudio::State>(stateSignal.last().at(0)), QAudio::IdleState);
QVERIFY2((audioOutput.state() == QAudio::IdleState), "didn't transitions to IdleState when at EOF");
stateSignal.clear();