diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2009-09-24 01:55:52 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2009-09-24 02:40:13 (GMT) |
commit | fb50411e4c0c132631f8237933fbb0972fa4c9aa (patch) | |
tree | 89aa19161710ccf0d2c0e11c0494ddef893eb19c /tests | |
parent | 609dd32580b1e07213a2b2efdd4d854c34e8f6d7 (diff) | |
download | Qt-fb50411e4c0c132631f8237933fbb0972fa4c9aa.zip Qt-fb50411e4c0c132631f8237933fbb0972fa4c9aa.tar.gz Qt-fb50411e4c0c132631f8237933fbb0972fa4c9aa.tar.bz2 |
AudioService API changes; QString->const QString&, remove QAudioDeviceId use QAudioDeviceInfo.
Reviewed-by: Bill King
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qaudiodeviceid/qaudiodeviceid.pro | 7 | ||||
-rw-r--r-- | tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp | 118 | ||||
-rw-r--r-- | tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp | 8 | ||||
-rw-r--r-- | tests/auto/qaudioinput/tst_qaudioinput.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qaudiooutput/tst_qaudiooutput.cpp | 2 |
5 files changed, 6 insertions, 131 deletions
diff --git a/tests/auto/qaudiodeviceid/qaudiodeviceid.pro b/tests/auto/qaudiodeviceid/qaudiodeviceid.pro deleted file mode 100644 index e0c7d4d..0000000 --- a/tests/auto/qaudiodeviceid/qaudiodeviceid.pro +++ /dev/null @@ -1,7 +0,0 @@ -load(qttest_p4) - -DEFINES += SRCDIR=\\\"$$PWD/\\\" - -SOURCES += tst_qaudiodeviceid.cpp - -QT = core multimedia diff --git a/tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp b/tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp deleted file mode 100644 index 02e475e..0000000 --- a/tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtTest/QtTest> -#include <QtCore/qlocale.h> -#include <qaudiodeviceid.h> -#include <qaudiodeviceinfo.h> - -#include <QStringList> -#include <QList> - - -class tst_QAudioDeviceId : public QObject -{ - Q_OBJECT - -public: - tst_QAudioDeviceId(QObject* parent=0) : QObject(parent) {} - -private slots: - void initTestCase(); - void checkNull(); - void checkEquality(); - -private: - bool available; -}; - -void tst_QAudioDeviceId::initTestCase() -{ - // Only perform tests if audio output device exists! - QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); - if(devices.size() > 0) - available = true; - else { - qWarning()<<"NOTE: no audio output device found, no test will be performed"; - available = false; - } -} - -void tst_QAudioDeviceId::checkNull() -{ - if(available) { - // Default constructed is null. - QAudioDeviceId deviceId0; - QVERIFY(deviceId0.isNull()); - - // Null is transferred - QAudioDeviceId deviceId1(deviceId0); - QVERIFY(deviceId1.isNull()); - } -} - -void tst_QAudioDeviceId::checkEquality() -{ - if(available) { - QAudioDeviceId deviceId0; - QAudioDeviceId deviceId1; - - // Null ids are equivalent - QVERIFY(deviceId0 == deviceId1); - QVERIFY(!(deviceId0 != deviceId1)); - - deviceId1 = QAudioDeviceInfo::defaultOutputDevice(); - - // Different - QVERIFY(deviceId0 != deviceId1); - QVERIFY(!(deviceId0 == deviceId1)); - - // Same - deviceId0 = deviceId1; - - QVERIFY(deviceId0 == deviceId1); - QVERIFY(!(deviceId0 != deviceId1)); - } -} - -QTEST_MAIN(tst_QAudioDeviceId) - -#include "tst_qaudiodeviceid.moc" diff --git a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp index 45912e2..7b9a422 100644 --- a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp +++ b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp @@ -77,7 +77,7 @@ private: void tst_QAudioDeviceInfo::initTestCase() { // Only perform tests if audio output device exists! - QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); + QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); if(devices.size() > 0) available = true; else { @@ -90,7 +90,7 @@ void tst_QAudioDeviceInfo::checkAvailableDefaultInput() { // Only perform tests if audio input device exists! bool storeAvailable = available; - QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput); + QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput); if(devices.size() > 0) available = true; else { @@ -111,9 +111,9 @@ void tst_QAudioDeviceInfo::checkAvailableDefaultOutput() void tst_QAudioDeviceInfo::outputList() { if(available) { - QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); + QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); QVERIFY(devices.size() > 0); - device = new QAudioDeviceInfo(devices.at(0), this); + device = new QAudioDeviceInfo(devices.at(0)); } } diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp index bf11961..7331072 100644 --- a/tests/auto/qaudioinput/tst_qaudioinput.cpp +++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp @@ -75,7 +75,7 @@ void tst_QAudioInput::initTestCase() format.setSampleType(QAudioFormat::UnSignedInt); // Only perform tests if audio input device exists! - QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput); + QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput); if(devices.size() > 0) available = true; else { diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp index db2444b..b45a57e 100644 --- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp @@ -78,7 +78,7 @@ void tst_QAudioOutput::initTestCase() format.setSampleType(QAudioFormat::UnSignedInt); // Only perform tests if audio output device exists! - QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); + QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput); if(devices.size() > 0) available = true; else { |