summaryrefslogtreecommitdiffstats
path: root/tests/auto/qaudioinput
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/qaudioinput
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/qaudioinput')
-rw-r--r--tests/auto/qaudioinput/tst_qaudioinput.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp
index 69b507d..3945364 100644
--- a/tests/auto/qaudioinput/tst_qaudioinput.cpp
+++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp
@@ -139,12 +139,14 @@ void tst_QAudioInput::pullFile()
// Always have default states, before start
QVERIFY(audio->state() == QAudio::StopState);
QVERIFY(audio->error() == QAudio::NoError);
+ QVERIFY(audio->clock() == 0);
audio->start(&filename);
QTest::qWait(20);
// Check state and periodSize() are valid non-zero values.
QVERIFY(audio->state() == QAudio::ActiveState);
QVERIFY(audio->error() == QAudio::NoError);
+ QVERIFY(audio->clock() > 0);
QVERIFY(audio->periodSize() > 0);
QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState
@@ -157,6 +159,7 @@ void tst_QAudioInput::pullFile()
audio->stop();
QTest::qWait(20);
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);