From 7d00a457e455e159a3dde30ad798be744cf38bb1 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 21 Sep 2016 10:59:20 +0300 Subject: 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 Reviewed-by: Christian Stromme --- tests/auto/integration/qaudiooutput/BLACKLIST | 5 ----- tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp | 7 ++----- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 tests/auto/integration/qaudiooutput/BLACKLIST (limited to 'tests') 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(stateSignal.last().at(0)), QAudio::IdleState); QVERIFY2((audioOutput.state() == QAudio::IdleState), "didn't transitions to IdleState when at EOF"); stateSignal.clear(); -- cgit v1.2.3