tests/auto/qaudiooutput/tst_qaudiooutput.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -79,7 +79,7 @@
     format.setSampleType(QAudioFormat::UnSignedInt);
 
     // Only perform tests if audio output device exists!
-    QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
+    QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
     if(devices.size() > 0)
         available = true;
     else {
@@ -140,9 +140,9 @@
         audio->setNotifyInterval(100);
 
         // Always have default states, before start
-        QVERIFY(audio->state() == QAudio::StopState);
+        QVERIFY(audio->state() == QAudio::StoppedState);
         QVERIFY(audio->error() == QAudio::NoError);
-        QVERIFY(audio->clock() == 0);
+        QVERIFY(audio->elapsedUSecs() == 0);
 
         audio->start(&file);
         QTest::qWait(20); // wait 20ms
@@ -150,12 +150,12 @@
         QVERIFY(audio->state() == QAudio::ActiveState);
         QVERIFY(audio->error() == QAudio::NoError);
         QVERIFY(audio->periodSize() > 0);
-        QVERIFY(audio->clock() > 10000 && audio->clock() < 800000);
+        QVERIFY(audio->elapsedUSecs() > 10000 && audio->elapsedUSecs() < 800000);
         QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState
 
         // Wait until finished...
         QTestEventLoop::instance().enterLoop(1);
-        QCOMPARE(audio->totalTime(), qint64(692250));
+        QCOMPARE(audio->processedUSecs(), qint64(692250));
 
 #ifdef Q_OS_WINCE
         // 4.wav is a little less than 700ms, so notify should fire 4 times on Wince!
@@ -166,8 +166,8 @@
 #endif
         audio->stop();
         QTest::qWait(20); // wait 20ms
-        QVERIFY(audio->state() == QAudio::StopState);
-        QVERIFY(audio->clock() == 0);
+        QVERIFY(audio->state() == QAudio::StoppedState);
+        QVERIFY(audio->elapsedUSecs() == 0);
         // Can only check to make sure we got at least 1 more signal, but can be more.
         QVERIFY(stateSignal.count() > 1);
 
@@ -184,7 +184,7 @@
 
         const qint64 fileSize = file.size();
 
-        QIODevice* feed = audio->start(0);
+        QIODevice* feed = audio->start();
 
         char* buffer = new char[fileSize];
         file.read(buffer, fileSize);
@@ -199,7 +199,7 @@
         QTestEventLoop::instance().enterLoop(1);
 
         QVERIFY(written == fileSize);
-        QVERIFY(audio->totalTime() == 692250);
+        QVERIFY(audio->processedUSecs() == 692250);
 
         audio->stop();
         file.close();