diff options
Diffstat (limited to 'tests/auto/unit')
14 files changed, 0 insertions, 323 deletions
diff --git a/tests/auto/unit/mockbackend/CMakeLists.txt b/tests/auto/unit/mockbackend/CMakeLists.txt index b63e1f635..5b43b75a9 100644 --- a/tests/auto/unit/mockbackend/CMakeLists.txt +++ b/tests/auto/unit/mockbackend/CMakeLists.txt @@ -25,7 +25,6 @@ target_sources(QtMultimediaMockBackend INTERFACE mockmediarecordercontrol.h mockmediarecorderservice.h mockmediaservice.h - mockmediasource.h mockmediastreamscontrol.h mockvideosurface.h qmockdevicemanager.cpp diff --git a/tests/auto/unit/mockbackend/common.pri b/tests/auto/unit/mockbackend/common.pri index cba7b96c7..fd64fe21b 100644 --- a/tests/auto/unit/mockbackend/common.pri +++ b/tests/auto/unit/mockbackend/common.pri @@ -1,5 +1,4 @@ INCLUDEPATH += $$PWD HEADERS += \ $$PWD/mockmediaservice.h \ - $$PWD/mockmediasource.h \ $$PWD/mockvideosurface.h diff --git a/tests/auto/unit/mockbackend/mockmediasource.h b/tests/auto/unit/mockbackend/mockmediasource.h deleted file mode 100644 index 5417027a6..000000000 --- a/tests/auto/unit/mockbackend/mockmediasource.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MOCKMEDIASOURCE_H -#define MOCKMEDIASOURCE_H - -#include "qmediasource.h" - -class MockMediaSource : public QMediaSource -{ - Q_OBJECT -public: - MockMediaSource(QObject *parent, QMediaService *service): - QMediaSource(parent, service) - { - } -}; - -#endif // MOCKMEDIASOURCE_H diff --git a/tests/auto/unit/multimedia/CMakeLists.txt b/tests/auto/unit/multimedia/CMakeLists.txt index dadc0108a..d41004d59 100644 --- a/tests/auto/unit/multimedia/CMakeLists.txt +++ b/tests/auto/unit/multimedia/CMakeLists.txt @@ -8,8 +8,6 @@ add_subdirectory(qaudionamespace) add_subdirectory(qcamera) add_subdirectory(qcamerainfo) add_subdirectory(qcameraimagecapture) -add_subdirectory(qmediasink) -add_subdirectory(qmediasource) add_subdirectory(qmediaplayer) add_subdirectory(qmediaplaylist) add_subdirectory(qmediapluginloader) diff --git a/tests/auto/unit/multimedia/multimedia.pro b/tests/auto/unit/multimedia/multimedia.pro index 9c24c6a7d..6c7906202 100644 --- a/tests/auto/unit/multimedia/multimedia.pro +++ b/tests/auto/unit/multimedia/multimedia.pro @@ -9,8 +9,6 @@ SUBDIRS += \ qcamera \ qcamerainfo \ qcameraimagecapture \ - qmediasink \ - qmediasource \ qmediaplayer \ qmediaplaylist \ qmediapluginloader \ diff --git a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp index 59593c277..9d8a25982 100644 --- a/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp +++ b/tests/auto/unit/multimedia/qaudiorecorder/tst_qaudiorecorder.cpp @@ -35,7 +35,6 @@ #include <qmediarecordercontrol.h> #include <qaudiodeviceinfo.h> #include <qaudioinput.h> -#include <qmediasource.h> //TESTED_COMPONENT=src/multimedia diff --git a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp index 48b14bd4a..f9066d037 100644 --- a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp +++ b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp @@ -31,8 +31,6 @@ #include <QtTest/QtTest> #include <QDebug> #include <QtMultimedia/qmediametadata.h> -#include <qmediasource.h> -#include <qmediaservice.h> #include <qmediaservice.h> #include <qmediarecordercontrol.h> #include <qmediarecorder.h> @@ -41,7 +39,6 @@ #include "mockmediarecorderservice.h" #include "mockmediarecordercontrol.h" -#include "mockmediasource.h" QT_USE_NAMESPACE diff --git a/tests/auto/unit/multimedia/qmediasink/CMakeLists.txt b/tests/auto/unit/multimedia/qmediasink/CMakeLists.txt deleted file mode 100644 index 5ed35ac3c..000000000 --- a/tests/auto/unit/multimedia/qmediasink/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Generated from qmediasink.pro. - -##################################################################### -## tst_qmediasink Test: -##################################################################### - -qt_add_test(tst_qmediasink - SOURCES - tst_qmediasink.cpp - INCLUDE_DIRECTORIES - ../../mockbackend - PUBLIC_LIBRARIES - # Remove: L${CMAKE_CURRENT_SOURCE_DIR} - Qt::Gui - Qt::MultimediaPrivate - QtMultimediaMockBackend -) diff --git a/tests/auto/unit/multimedia/qmediasink/qmediasink.pro b/tests/auto/unit/multimedia/qmediasink/qmediasink.pro deleted file mode 100644 index 51743bdbe..000000000 --- a/tests/auto/unit/multimedia/qmediasink/qmediasink.pro +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG += testcase -TARGET = tst_qmediasink - -QT += multimedia-private testlib - -SOURCES += \ - tst_qmediasink.cpp - -include (../../mockbackend/mockbackend.pri) diff --git a/tests/auto/unit/multimedia/qmediasink/tst_qmediasink.cpp b/tests/auto/unit/multimedia/qmediasink/tst_qmediasink.cpp deleted file mode 100644 index 612200841..000000000 --- a/tests/auto/unit/multimedia/qmediasink/tst_qmediasink.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//TESTED_COMPONENT=src/multimedia - -#include <QtTest/QtTest> -#include <qmediasource.h> -#include <qmediaservice.h> -#include <qmediaservice.h> -#include <qmediarecordercontrol.h> -#include <qmediarecorder.h> -#include <qaudioformat.h> -#include <qcamera.h> - -#include "mockmediarecordercontrol.h" -#include "mockmediasource.h" - -QT_USE_NAMESPACE - -class TestBindableService : public QMediaService -{ - Q_OBJECT -public: - TestBindableService(QObject *parent, QObject *control): - QMediaService(parent), - mockControl(control), - hasControls(true) - { - } - - QObject *requestControl(const char *name) override - { - if (hasControls && qstrcmp(name,QMediaRecorderControl_iid) == 0) - return mockControl; - - return nullptr; - } - - void releaseControl(QObject *) override {} - //Initialising the objects for the media - QObject *mockControl; - bool hasControls; -}; - -class tst_QMediaSink:public QObject -{ - Q_OBJECT -private slots: - void init() - { - - } - - void cleanup() - { - - } - - void testMediaSource() //Verifying the mediasource api - { - MockMediaRecorderControl recorderControl(nullptr); - TestBindableService service(nullptr, &recorderControl); - QCamera object; - QMediaRecorder recorder(&object); - QCamera *obj = recorder.camera(); - QVERIFY(obj != nullptr); - QVERIFY(obj->isAvailable()); - } - - void testDestructor() //Invoking the destructor - { - MockMediaRecorderControl recorderControl(nullptr); - TestBindableService service(nullptr, &recorderControl); - QCamera object; - QMediaRecorder *recorder = new QMediaRecorder(&object); - QVERIFY(recorder->isAvailable()); - delete recorder; - recorder = nullptr; - } -}; - -QTEST_MAIN(tst_QMediaSink) -#include "tst_qmediasink.moc" diff --git a/tests/auto/unit/multimedia/qmediasource/CMakeLists.txt b/tests/auto/unit/multimedia/qmediasource/CMakeLists.txt deleted file mode 100644 index a281449e0..000000000 --- a/tests/auto/unit/multimedia/qmediasource/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Generated from qmediasource.pro. - -##################################################################### -## tst_qmediasource Test: -##################################################################### - -qt_add_test(tst_qmediasource - SOURCES - tst_qmediasource.cpp - INCLUDE_DIRECTORIES - ../../mockbackend - PUBLIC_LIBRARIES - # Remove: L${CMAKE_CURRENT_SOURCE_DIR} - Qt::Gui - Qt::MultimediaPrivate - QtMultimediaMockBackend -) diff --git a/tests/auto/unit/multimedia/qmediasource/qmediasource.pro b/tests/auto/unit/multimedia/qmediasource/qmediasource.pro deleted file mode 100644 index 5bc4a884f..000000000 --- a/tests/auto/unit/multimedia/qmediasource/qmediasource.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG += testcase -TARGET = tst_qmediasource -QT += multimedia-private testlib - -include (../../mockbackend/mockbackend.pri) - -SOURCES += tst_qmediasource.cpp diff --git a/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp b/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp deleted file mode 100644 index 08452b8fd..000000000 --- a/tests/auto/unit/multimedia/qmediasource/tst_qmediasource.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//TESTED_COMPONENT=src/multimedia - -#include <QtTest/QtTest> - -#include <QtMultimedia/qmediametadata.h> -#include <qmediasource.h> -#include <qmediaservice.h> - -#include "mockmediarecorderservice.h" - -class QtTestMediaObjectService : public QMediaService -{ - Q_OBJECT -public: - QtTestMediaObjectService(QObject *parent = nullptr) - : QMediaService(parent) - { - } - - QObject *requestControl(const char *) override - { - return nullptr; - } - - void releaseControl(QObject *) override - { - } -}; - -QT_USE_NAMESPACE - -class tst_QMediaSource : public QObject -{ - Q_OBJECT - -private slots: - void availability(); - void service(); -}; -class QtTestMediaObject : public QMediaSource -{ - Q_OBJECT - -public: - QtTestMediaObject(QMediaService *service = nullptr): QMediaSource(nullptr, service) {} -}; - -void tst_QMediaSource::availability() -{ - { - QtTestMediaObject nullObject(nullptr); - QCOMPARE(nullObject.isAvailable(), false); - QCOMPARE(nullObject.availability(), QMultimedia::ServiceMissing); - } - - { - QtTestMediaObjectService service; - QtTestMediaObject object(&service); - QCOMPARE(object.isAvailable(), true); - QCOMPARE(object.availability(), QMultimedia::Available); - } -} - - void tst_QMediaSource::service() - { - // Create the mediaobject with service. - QtTestMediaObjectService service; - QtTestMediaObject mediaObject1(&service); - - // Get service and Compare if it equal to the service passed as an argument in mediaObject1. - QMediaService *service1 = mediaObject1.service(); - QVERIFY(service1 != nullptr); - QCOMPARE(service1,&service); - - // Create the mediaobject with empty service and verify that service() returns NULL. - QtTestMediaObject mediaObject2; - QMediaService *service2 = mediaObject2.service(); - QVERIFY(service2 == nullptr); -} - -QTEST_GUILESS_MAIN(tst_QMediaSource) -#include "tst_qmediasource.moc" diff --git a/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp b/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp index 126d24763..f2a8dddc4 100644 --- a/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp +++ b/tests/auto/unit/multimediawidgets/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp @@ -31,7 +31,6 @@ #include <qtmultimediaglobal.h> #include "qgraphicsvideoitem.h" #include <QtTest/QtTest> -#include "qmediasource.h" #include "qmediaservice.h" #include <private/qpaintervideosurface_p.h> #include "qvideorenderercontrol.h" |