Updated QAudioOutput and QAudioInput system tests
- Updated tests with volume checking. - Updated reset function in QAudioInput test. (Checking bytesReady() in pull mode is not valid) (Checking state after writing one byte doesn't guarantee going to active state) - Improved stability in CI system Change-Id: I8018bfbc163971bcb3d5f7b7a1ece6306e75ed07 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
9d429a4416
commit
301ed096f8
@@ -100,6 +100,8 @@ private slots:
|
||||
void pushSuspendResume();
|
||||
void pushUnderrun();
|
||||
|
||||
void volume();
|
||||
|
||||
private:
|
||||
typedef QSharedPointer<QFile> FilePtr;
|
||||
|
||||
@@ -981,6 +983,29 @@ void tst_QAudioOutput::pushUnderrun()
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QAudioOutput::volume()
|
||||
{
|
||||
QAudioOutput audioOutput(audioDevice.preferredFormat(), this);
|
||||
|
||||
audioOutput.setVolume(0.3f);
|
||||
QTRY_VERIFY(qRound(audioOutput.volume()*10.0f) == 3);
|
||||
// Wait a while to see if this changes
|
||||
QTest::qWait(500);
|
||||
QTRY_VERIFY(qRound(audioOutput.volume()*10.0f) == 3);
|
||||
|
||||
audioOutput.setVolume(0.6f);
|
||||
QTRY_VERIFY(qRound(audioOutput.volume()*10.0f) == 6);
|
||||
// Wait a while to see if this changes
|
||||
QTest::qWait(500);
|
||||
QTRY_VERIFY(qRound(audioOutput.volume()*10.0f) == 6);
|
||||
|
||||
audioOutput.setVolume(0.9f);
|
||||
QTRY_VERIFY(qRound(audioOutput.volume()*10.0f) == 9);
|
||||
// Wait a while to see if this changes
|
||||
QTest::qWait(500);
|
||||
QTRY_VERIFY(qRound(audioOutput.volume()*10.0f) == 9);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QAudioOutput)
|
||||
|
||||
#include "tst_qaudiooutput.moc"
|
||||
|
||||
Reference in New Issue
Block a user