Cleanup multimedia unit tests.
Use QTEST_MAIN or QTEST_GUILESS_MAIN instead of equivalent custom main() functions. Also collapse each test into a single source file, in line with most other autotests. Change-Id: I38c7b6a9eb0ff1c9b8ac44de7d5f40d6ac6c46ea Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
4c834365c6
commit
3171081d43
@@ -4,7 +4,7 @@
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Toolkit.
|
||||
** This file is part of the test suite of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
@@ -41,10 +41,50 @@
|
||||
|
||||
//TESTED_COMPONENT=src/multimedia
|
||||
|
||||
#include "tst_qradiotuner.h"
|
||||
#include <QtTest/QtTest>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
|
||||
#include <qmediaobject.h>
|
||||
#include <qmediacontrol.h>
|
||||
#include <qmediaservice.h>
|
||||
#include <qradiotunercontrol.h>
|
||||
#include <qradiotuner.h>
|
||||
|
||||
#include "mockmediaserviceprovider.h"
|
||||
#include "mockmediaservice.h"
|
||||
#include "mockradiotunercontrol.h"
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class tst_QRadioTuner: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
private slots:
|
||||
void testNullService();
|
||||
void testNullControl();
|
||||
void testBand();
|
||||
void testFrequency();
|
||||
void testMute();
|
||||
void testSearch();
|
||||
void testVolume();
|
||||
void testSignal();
|
||||
void testStereo();
|
||||
void testSearchAllStations();
|
||||
void errorSignal();
|
||||
|
||||
private:
|
||||
MockRadioTunerControl *mock;
|
||||
MockMediaService *service;
|
||||
MockMediaServiceProvider *provider;
|
||||
QRadioTuner *radio;
|
||||
};
|
||||
|
||||
void tst_QRadioTuner::initTestCase()
|
||||
{
|
||||
qRegisterMetaType<QRadioTuner::State>("QRadioTuner::State");
|
||||
@@ -334,3 +374,6 @@ void tst_QRadioTuner::errorSignal()
|
||||
spy.clear();
|
||||
radio.stop();
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(tst_QRadioTuner)
|
||||
#include "tst_qradiotuner.moc"
|
||||
|
||||
Reference in New Issue
Block a user