Fixed qaudioinput and qaudiooutput tests running on loaded system
- Changed tests to handle running on loaded or very slow systems - notify signal checks that signals are emitted but not number of as these are time related and number of emitted signals could vary greatly on slow or loaded systems. - Added skip for CI system pushSuspendResume with pulseaudio backend. Change-Id: I0abf242934507454cc992fe8daec46d6acaa2836 Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
5f06930b16
commit
59bfb014c8
@@ -55,7 +55,7 @@
|
||||
//TESTED_COMPONENT=src/multimedia
|
||||
|
||||
#define AUDIO_BUFFER 192000
|
||||
#define RANGE_ERR 0.2
|
||||
#define RANGE_ERR 0.5
|
||||
|
||||
template<typename T> inline bool qTolerantCompare(T value, T expected)
|
||||
{
|
||||
@@ -577,8 +577,7 @@ void tst_QAudioInput::pullSuspendResume()
|
||||
QString("processedUSecs() doesn't fall in acceptable range, should be 3040000 (%1)").arg(processedUs).toLocal8Bit().constData());
|
||||
QVERIFY2((audioInput.error() == QAudio::NoError), "error() is not QAudio::NoError after stop()");
|
||||
QVERIFY2((audioInput.elapsedUSecs() == (qint64)0), "elapsedUSecs() not equal to zero in StoppedState");
|
||||
QVERIFY2((notifySignal.count() > 10 && notifySignal.count() < 50),
|
||||
QString("notify() signals emitted (%1) should be 30").arg(notifySignal.count()).toLocal8Bit().constData());
|
||||
QVERIFY2(notifySignal.count() > 0, "not emitting notify() signal");
|
||||
|
||||
WavHeader::writeDataLength(*audioFiles.at(i),audioFiles.at(i)->pos()-WavHeader::headerLength());
|
||||
audioFile->close();
|
||||
@@ -660,8 +659,7 @@ void tst_QAudioInput::push()
|
||||
QString("processedUSecs() doesn't fall in acceptable range, should be 2040000 (%1)").arg(processedUs).toLocal8Bit().constData());
|
||||
QVERIFY2((audioInput.error() == QAudio::NoError), "error() is not QAudio::NoError after stop()");
|
||||
QVERIFY2((audioInput.elapsedUSecs() == (qint64)0), "elapsedUSecs() not equal to zero in StoppedState");
|
||||
QVERIFY2((notifySignal.count() > 20 && notifySignal.count() < 40),
|
||||
QString("notify() signals emitted (%1) should be 30").arg(notifySignal.count()).toLocal8Bit().constData());
|
||||
QVERIFY2(notifySignal.count() > 0, "not emitting notify() signal");
|
||||
|
||||
WavHeader::writeDataLength(*audioFiles.at(i),audioFiles.at(i)->pos()-WavHeader::headerLength());
|
||||
audioFiles.at(i)->close();
|
||||
|
||||
@@ -533,8 +533,7 @@ void tst_QAudioOutput::pull()
|
||||
QString("processedUSecs() doesn't equal file duration in us (%1)").arg(processedUs).toLocal8Bit().constData());
|
||||
QVERIFY2((audioOutput.error() == QAudio::NoError), "error() is not QAudio::NoError after stop()");
|
||||
QVERIFY2((audioOutput.elapsedUSecs() == (qint64)0), "elapsedUSecs() not equal to zero in StoppedState");
|
||||
QVERIFY2((notifySignal.count() > 15 && notifySignal.count() < 25),
|
||||
QString("too many notify() signals emitted (%1)").arg(notifySignal.count()).toLocal8Bit().constData());
|
||||
QVERIFY2(notifySignal.count() > 0, "not emitting notify() signal");
|
||||
|
||||
audioFile->close();
|
||||
|
||||
@@ -719,8 +718,7 @@ void tst_QAudioOutput::push()
|
||||
QString("processedUSecs() doesn't equal file duration in us (%1)").arg(processedUs).toLocal8Bit().constData());
|
||||
QVERIFY2((audioOutput.error() == QAudio::NoError), "error() is not QAudio::NoError after stop()");
|
||||
QVERIFY2((audioOutput.elapsedUSecs() == (qint64)0), "elapsedUSecs() not equal to zero in StoppedState");
|
||||
QVERIFY2((notifySignal.count() > 15 && notifySignal.count() < 25),
|
||||
QString("too many notify() signals emitted (%1)").arg(notifySignal.count()).toLocal8Bit().constData());
|
||||
QVERIFY2(notifySignal.count() > 0, "not emitting notify signal");
|
||||
|
||||
audioFile->close();
|
||||
|
||||
@@ -732,6 +730,10 @@ void tst_QAudioOutput::push()
|
||||
|
||||
void tst_QAudioOutput::pushSuspendResume()
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
if (m_inCISystem)
|
||||
QSKIP("QTBUG-26504 Fails 20% of time with pulseaudio backend");
|
||||
#endif
|
||||
for(int i=0; i<audioFiles.count(); i++) {
|
||||
QAudioOutput audioOutput(testFormats.at(i), this);
|
||||
|
||||
@@ -812,7 +814,7 @@ void tst_QAudioOutput::pushSuspendResume()
|
||||
|
||||
audioOutput.resume();
|
||||
|
||||
// Give backends running in separate threads a chance to suspend.
|
||||
// Give backends running in separate threads a chance to resume.
|
||||
QTest::qWait(100);
|
||||
|
||||
// Check that QAudioOutput immediately transitions to ActiveState
|
||||
|
||||
Reference in New Issue
Block a user