diff options
author | Yoann Lopes <yoann.lopes@qt.io> | 2016-09-21 10:59:20 +0300 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@qt.io> | 2016-09-21 13:13:41 +0000 |
commit | 7d00a457e455e159a3dde30ad798be744cf38bb1 (patch) | |
tree | 19f2763eb90831f086ec3ce199636dfd163dffc8 | |
parent | 6b94b3ca91df6ee047e99c63061dc33b1fb1c0f7 (diff) |
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>
-rw-r--r-- | tests/auto/integration/qaudiooutput/BLACKLIST | 5 | ||||
-rw-r--r-- | tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp | 7 |
2 files changed, 2 insertions, 10 deletions
diff --git a/tests/auto/integration/qaudiooutput/BLACKLIST b/tests/auto/integration/qaudiooutput/BLACKLIST deleted file mode 100644 index 4d45efe06..000000000 --- a/tests/auto/integration/qaudiooutput/BLACKLIST +++ /dev/null @@ -1,5 +0,0 @@ -[pullSuspendResume] -redhatenterpriselinuxworkstation-6.6 -rhel-7.1 -ubuntu-14.04 -opensuse-13.1 64bit diff --git a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp index b887d3f9a..dfe9d3e54 100644 --- a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp @@ -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(); |