summaryrefslogtreecommitdiffstats
path: root/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2009-10-02 04:45:05 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2009-10-02 04:45:05 (GMT)
commit5d94ce44f19316ce1c30c23635bf9575d80aa4e2 (patch)
tree96e1daf11022115c84ab8e51906ec78882f0a19b /tests/auto/qaudiooutput/tst_qaudiooutput.cpp
parenta94e9c5022076a97e796a984527ed1935c0803d0 (diff)
downloadQt-5d94ce44f19316ce1c30c23635bf9575d80aa4e2.zip
Qt-5d94ce44f19316ce1c30c23635bf9575d80aa4e2.tar.gz
Qt-5d94ce44f19316ce1c30c23635bf9575d80aa4e2.tar.bz2
Fixed logic in clock() function of audio class's.
- clock() should return valid value except in stop state, return 0. - Added clock() function testing to unit tests. Reviewed-by:Justin McPherson
Diffstat (limited to 'tests/auto/qaudiooutput/tst_qaudiooutput.cpp')
-rw-r--r--tests/auto/qaudiooutput/tst_qaudiooutput.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
index f1c75dc..b90873e 100644
--- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
+++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
@@ -142,6 +142,7 @@ void tst_QAudioOutput::pullFile()
// Always have default states, before start
QVERIFY(audio->state() == QAudio::StopState);
QVERIFY(audio->error() == QAudio::NoError);
+ QVERIFY(audio->clock() == 0);
audio->start(&file);
QTest::qWait(20); // wait 20ms
@@ -149,6 +150,7 @@ void tst_QAudioOutput::pullFile()
QVERIFY(audio->state() == QAudio::ActiveState);
QVERIFY(audio->error() == QAudio::NoError);
QVERIFY(audio->periodSize() > 0);
+ QVERIFY(audio->clock() > 0);
QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState
// Wait until finished...
@@ -160,6 +162,7 @@ void tst_QAudioOutput::pullFile()
audio->stop();
QTest::qWait(20); // wait 20ms
QVERIFY(audio->state() == QAudio::StopState);
+ QVERIFY(audio->clock() == 0);
// Can only check to make sure we got at least 1 more signal, but can be more.
QVERIFY(stateSignal.count() > 1);