diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-10-02 04:45:05 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-10-02 04:45:05 (GMT) |
commit | 5d94ce44f19316ce1c30c23635bf9575d80aa4e2 (patch) | |
tree | 96e1daf11022115c84ab8e51906ec78882f0a19b /tests | |
parent | a94e9c5022076a97e796a984527ed1935c0803d0 (diff) | |
download | Qt-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')
-rw-r--r-- | tests/auto/qaudioinput/tst_qaudioinput.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qaudiooutput/tst_qaudiooutput.cpp | 3 |
2 files changed, 6 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); 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); |