Set the volume for our automatic integration tests.
These aren't manual test, so we don't care if you can't hear it. QSound does not have a volume property (yet). Change-Id: I6ef90262decf4630de84478215bfe8d259db4751 Reviewed-by: Ling Hu <ling.hu@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
7e76391c59
commit
c40d79106c
@@ -398,6 +398,8 @@ void tst_QAudioOutput::disableNotifyInterval()
|
|||||||
if (audioFiles.size() > 0) {
|
if (audioFiles.size() > 0) {
|
||||||
QAudioOutput audioOutputCheck(testFormats.at(0), this);
|
QAudioOutput audioOutputCheck(testFormats.at(0), this);
|
||||||
audioOutputCheck.setNotifyInterval(0);
|
audioOutputCheck.setNotifyInterval(0);
|
||||||
|
audioOutputCheck.setVolume(0.1f);
|
||||||
|
|
||||||
QSignalSpy notifySignal(&audioOutputCheck, SIGNAL(notify()));
|
QSignalSpy notifySignal(&audioOutputCheck, SIGNAL(notify()));
|
||||||
QFile *audioFile = audioFiles.at(0).data();
|
QFile *audioFile = audioFiles.at(0).data();
|
||||||
audioFile->open(QIODevice::ReadOnly);
|
audioFile->open(QIODevice::ReadOnly);
|
||||||
@@ -476,6 +478,7 @@ void tst_QAudioOutput::pull()
|
|||||||
QAudioOutput audioOutput(testFormats.at(i), this);
|
QAudioOutput audioOutput(testFormats.at(i), this);
|
||||||
|
|
||||||
audioOutput.setNotifyInterval(100);
|
audioOutput.setNotifyInterval(100);
|
||||||
|
audioOutput.setVolume(0.1f);
|
||||||
|
|
||||||
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
||||||
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
||||||
@@ -538,6 +541,7 @@ void tst_QAudioOutput::pullSuspendResume()
|
|||||||
QAudioOutput audioOutput(testFormats.at(i), this);
|
QAudioOutput audioOutput(testFormats.at(i), this);
|
||||||
|
|
||||||
audioOutput.setNotifyInterval(100);
|
audioOutput.setNotifyInterval(100);
|
||||||
|
audioOutput.setVolume(0.1f);
|
||||||
|
|
||||||
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
||||||
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
||||||
@@ -627,6 +631,7 @@ void tst_QAudioOutput::push()
|
|||||||
QAudioOutput audioOutput(testFormats.at(i), this);
|
QAudioOutput audioOutput(testFormats.at(i), this);
|
||||||
|
|
||||||
audioOutput.setNotifyInterval(100);
|
audioOutput.setNotifyInterval(100);
|
||||||
|
audioOutput.setVolume(0.1f);
|
||||||
|
|
||||||
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
||||||
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
||||||
@@ -714,6 +719,7 @@ void tst_QAudioOutput::pushSuspendResume()
|
|||||||
QAudioOutput audioOutput(testFormats.at(i), this);
|
QAudioOutput audioOutput(testFormats.at(i), this);
|
||||||
|
|
||||||
audioOutput.setNotifyInterval(100);
|
audioOutput.setNotifyInterval(100);
|
||||||
|
audioOutput.setVolume(0.1f);
|
||||||
|
|
||||||
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
||||||
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
||||||
@@ -841,6 +847,7 @@ void tst_QAudioOutput::pushUnderrun()
|
|||||||
QAudioOutput audioOutput(testFormats.at(i), this);
|
QAudioOutput audioOutput(testFormats.at(i), this);
|
||||||
|
|
||||||
audioOutput.setNotifyInterval(100);
|
audioOutput.setNotifyInterval(100);
|
||||||
|
audioOutput.setVolume(0.1f);
|
||||||
|
|
||||||
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
QSignalSpy notifySignal(&audioOutput, SIGNAL(notify()));
|
||||||
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
QSignalSpy stateSignal(&audioOutput, SIGNAL(stateChanged(QAudio::State)));
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ void tst_QSoundEffect::testSource()
|
|||||||
QSignalSpy readSignal(sound, SIGNAL(sourceChanged()));
|
QSignalSpy readSignal(sound, SIGNAL(sourceChanged()));
|
||||||
|
|
||||||
sound->setSource(url);
|
sound->setSource(url);
|
||||||
|
sound->setVolume(0.1f);
|
||||||
|
|
||||||
QCOMPARE(sound->source(),url);
|
QCOMPARE(sound->source(),url);
|
||||||
QCOMPARE(readSignal.count(),1);
|
QCOMPARE(readSignal.count(),1);
|
||||||
@@ -110,6 +111,7 @@ void tst_QSoundEffect::testLooping()
|
|||||||
QSignalSpy readSignal_Remaining(sound, SIGNAL(loopsRemainingChanged()));
|
QSignalSpy readSignal_Remaining(sound, SIGNAL(loopsRemainingChanged()));
|
||||||
|
|
||||||
sound->setLoopCount(5);
|
sound->setLoopCount(5);
|
||||||
|
sound->setVolume(0.1f);
|
||||||
QCOMPARE(sound->loopCount(),5);
|
QCOMPARE(sound->loopCount(),5);
|
||||||
QCOMPARE(readSignal_Count.count(),1);
|
QCOMPARE(readSignal_Count.count(),1);
|
||||||
|
|
||||||
@@ -147,6 +149,7 @@ void tst_QSoundEffect::testMuting()
|
|||||||
void tst_QSoundEffect::testPlaying()
|
void tst_QSoundEffect::testPlaying()
|
||||||
{
|
{
|
||||||
sound->setLoopCount(QSoundEffect::Infinite);
|
sound->setLoopCount(QSoundEffect::Infinite);
|
||||||
|
sound->setVolume(0.1f);
|
||||||
//valid source
|
//valid source
|
||||||
sound->setSource(url);
|
sound->setSource(url);
|
||||||
QTestEventLoop::instance().enterLoop(1);
|
QTestEventLoop::instance().enterLoop(1);
|
||||||
@@ -200,6 +203,7 @@ void tst_QSoundEffect::testDestroyWhilePlaying()
|
|||||||
{
|
{
|
||||||
QSoundEffect *instance = new QSoundEffect();
|
QSoundEffect *instance = new QSoundEffect();
|
||||||
instance->setSource(url);
|
instance->setSource(url);
|
||||||
|
instance->setVolume(0.1f);
|
||||||
QTestEventLoop::instance().enterLoop(1);
|
QTestEventLoop::instance().enterLoop(1);
|
||||||
instance->play();
|
instance->play();
|
||||||
QTest::qWait(500);
|
QTest::qWait(500);
|
||||||
@@ -211,6 +215,7 @@ void tst_QSoundEffect::testDestroyWhileRestartPlaying()
|
|||||||
{
|
{
|
||||||
QSoundEffect *instance = new QSoundEffect();
|
QSoundEffect *instance = new QSoundEffect();
|
||||||
instance->setSource(url);
|
instance->setSource(url);
|
||||||
|
instance->setVolume(0.1f);
|
||||||
QTestEventLoop::instance().enterLoop(1);
|
QTestEventLoop::instance().enterLoop(1);
|
||||||
instance->play();
|
instance->play();
|
||||||
QTest::qWait(1000);
|
QTest::qWait(1000);
|
||||||
|
|||||||
Reference in New Issue
Block a user