tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    75 };
    75 };
    76 
    76 
    77 void tst_QAudioDeviceInfo::initTestCase()
    77 void tst_QAudioDeviceInfo::initTestCase()
    78 {
    78 {
    79     // Only perform tests if audio output device exists!
    79     // Only perform tests if audio output device exists!
    80     QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
    80     QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
    81     if(devices.size() > 0)
    81     if(devices.size() > 0)
    82         available = true;
    82         available = true;
    83     else {
    83     else {
    84         qWarning()<<"NOTE: no audio output device found, no test will be performed";
    84         qWarning()<<"NOTE: no audio output device found, no test will be performed";
    85         available = false;
    85         available = false;
    88 
    88 
    89 void tst_QAudioDeviceInfo::checkAvailableDefaultInput()
    89 void tst_QAudioDeviceInfo::checkAvailableDefaultInput()
    90 {
    90 {
    91     // Only perform tests if audio input device exists!
    91     // Only perform tests if audio input device exists!
    92     bool storeAvailable = available;
    92     bool storeAvailable = available;
    93     QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput);
    93     QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput);
    94     if(devices.size() > 0)
    94     if(devices.size() > 0)
    95         available = true;
    95         available = true;
    96     else {
    96     else {
    97         qWarning()<<"NOTE: no audio input device found, no test will be performed";
    97         qWarning()<<"NOTE: no audio input device found, no test will be performed";
    98         available = false;
    98         available = false;
   109 }
   109 }
   110 
   110 
   111 void tst_QAudioDeviceInfo::outputList()
   111 void tst_QAudioDeviceInfo::outputList()
   112 {
   112 {
   113     if(available) {
   113     if(available) {
   114         QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
   114         QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
   115         QVERIFY(devices.size() > 0);
   115         QVERIFY(devices.size() > 0);
   116         device = new QAudioDeviceInfo(devices.at(0));
   116         device = new QAudioDeviceInfo(devices.at(0));
   117     }
   117     }
   118 }
   118 }
   119 
   119