Fix tst_QAudioOutput::pushSuspendResume().
Documentation states that state in push mode after suspend and resume should be QAudio::IdleState. Task-number: QTBUG-50390 Change-Id: I214f1808948ce862b62afd0fb9d245d0c7e4ad26 Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
This commit is contained in:
committed by
Yoann Lopes
parent
e126dbb6fb
commit
42dc973881
@@ -825,10 +825,10 @@ void tst_QAudioOutput::pushSuspendResume()
|
||||
// but not too much or the rest of the file may be processed
|
||||
QTest::qWait(20);
|
||||
|
||||
// Check that QAudioOutput immediately transitions to ActiveState
|
||||
// Check that QAudioOutput immediately transitions to IdleState
|
||||
QVERIFY2((stateSignal.count() == 1),
|
||||
QString("didn't emit signal after resume(), got %1 signals instead").arg(stateSignal.count()).toLocal8Bit().constData());
|
||||
QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after resume()");
|
||||
QVERIFY2((audioOutput.state() == QAudio::IdleState), "didn't transition to IdleState after resume()");
|
||||
QVERIFY2((audioOutput.error() == QAudio::NoError), "error state is not equal to QAudio::NoError after resume()");
|
||||
stateSignal.clear();
|
||||
|
||||
@@ -837,6 +837,7 @@ void tst_QAudioOutput::pushSuspendResume()
|
||||
if (audioOutput.bytesFree() >= audioOutput.periodSize()) {
|
||||
qint64 len = audioFile->read(buffer.data(),audioOutput.periodSize());
|
||||
written += feed->write(buffer.constData(), len);
|
||||
QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after writing audio data");
|
||||
} else
|
||||
QTest::qWait(20);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user