diff options
Diffstat (limited to 'tests/auto/corelib/kernel')
13 files changed, 10 insertions, 296 deletions
diff --git a/tests/auto/corelib/kernel/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/kernel/qabstractitemmodel/tst_qabstractitemmodel.cpp index 6a7a16eae8..62c07dc518 100644 --- a/tests/auto/corelib/kernel/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/corelib/kernel/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <QtCore/QtCore> @@ -53,21 +52,15 @@ Q_DECLARE_METATYPE(QModelIndex) /*! - Note that this doesn't test models, but any functionality that QAbstractItemModel shoudl provide + Note that this doesn't test models, but any functionality that QAbstractItemModel should provide */ class tst_QAbstractItemModel : public QObject { Q_OBJECT -public: - tst_QAbstractItemModel(); - virtual ~tst_QAbstractItemModel(); - public slots: void initTestCase(); - void cleanupTestCase(); void init(); - void cleanup(); private slots: void index(); @@ -116,17 +109,15 @@ private slots: void testReset(); - private: DynamicTreeModel *m_model; - }; /*! Test model that impliments the pure vitual functions and anything else that is needed. - It is a table implimented as a vector of vectors of strings. + It is a table implemented as a vector of vectors of strings. */ class QtTestModel: public QAbstractItemModel { @@ -153,8 +144,8 @@ public: }; QtTestModel::QtTestModel(int rows, int columns, QObject *parent) - : QAbstractItemModel(parent), cCount(columns), rCount(rows), wrongIndex(false) { - + : QAbstractItemModel(parent), cCount(columns), rCount(rows), wrongIndex(false) +{ table.resize(rows); for (int r = 0; r < rows; ++r) { table[r].resize(columns); @@ -164,14 +155,17 @@ QtTestModel::QtTestModel(int rows, int columns, QObject *parent) } QtTestModel::QtTestModel(const QVector<QVector<QString> > tbl, QObject *parent) - : QAbstractItemModel(parent), wrongIndex(false) { + : QAbstractItemModel(parent), wrongIndex(false) +{ table = tbl; rCount = tbl.count(); cCount = tbl.at(0).count(); } QModelIndex QtTestModel::index(int row, int column, const QModelIndex &parent) const - { return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex(); } +{ + return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex(); +} QModelIndex QtTestModel::parent(const QModelIndex &) const { return QModelIndex(); } int QtTestModel::rowCount(const QModelIndex &parent) const { return parent.isValid() ? 0 : rCount; } @@ -251,14 +245,6 @@ void QtTestModel::reset() QAbstractItemModel::reset(); } -tst_QAbstractItemModel::tst_QAbstractItemModel() -{ -} - -tst_QAbstractItemModel::~tst_QAbstractItemModel() -{ -} - /** * The source Model *must* be initialized before the _data function, since the _data function uses QModelIndexes to reference the items in the tables. * Therefore, we must initialize it globally. @@ -269,11 +255,6 @@ void tst_QAbstractItemModel::initTestCase() qRegisterMetaType<QModelIndex>("QModelIndex"); } -void tst_QAbstractItemModel::cleanupTestCase() -{ - -} - void tst_QAbstractItemModel::init() { m_model = new DynamicTreeModel(this); @@ -292,11 +273,6 @@ void tst_QAbstractItemModel::init() insertCommand->doCommand(); } -void tst_QAbstractItemModel::cleanup() -{ - -} - /* tests */ diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 7446e17f76..9f9e1a01ca 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -39,10 +39,8 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> - #include <qabstracteventdispatcher.h> #include <qcoreapplication.h> #include <qcoreevent.h> @@ -183,12 +181,6 @@ public slots: class tst_QEventLoop : public QObject { Q_OBJECT -public: - tst_QEventLoop(); - ~tst_QEventLoop(); -public slots: - void init(); - void cleanup(); private slots: // This test *must* run first. See the definition for why. void processEvents(); @@ -211,18 +203,6 @@ protected: void customEvent(QEvent *e); }; -tst_QEventLoop::tst_QEventLoop() -{ } - -tst_QEventLoop::~tst_QEventLoop() -{ } - -void tst_QEventLoop::init() -{ } - -void tst_QEventLoop::cleanup() -{ } - void tst_QEventLoop::processEvents() { QSignalSpy spy1(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock())); diff --git a/tests/auto/corelib/kernel/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/kernel/qitemmodel/tst_qitemmodel.cpp index 7daa984633..a4b85bb61d 100644 --- a/tests/auto/corelib/kernel/qitemmodel/tst_qitemmodel.cpp +++ b/tests/auto/corelib/kernel/qitemmodel/tst_qitemmodel.cpp @@ -65,10 +65,6 @@ class tst_QItemModel : public QObject { Q_OBJECT -public: - tst_QItemModel() {}; - virtual ~tst_QItemModel() {}; - public slots: void init(); void cleanup(); diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp index 29b2af44ed..4bf597a9c0 100644 --- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <qobject.h> @@ -119,9 +118,6 @@ class tst_QMetaObject : public QObject public: enum EnumType { EnumType1 }; - tst_QMetaObject(); - ~tst_QMetaObject(); - void setValue(EnumType) {} EnumType getValue() const { return EnumType1; } @@ -151,11 +147,6 @@ public: QList<QVariant> value4; QVariantList value5; -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); private slots: void connectSlotsByName(); void invokeMetaMember(); @@ -188,32 +179,6 @@ signals: void value7Changed(const QString &); }; -tst_QMetaObject::tst_QMetaObject() -{ - -} - -tst_QMetaObject::~tst_QMetaObject() -{ - -} - -void tst_QMetaObject::initTestCase() -{ -} - -void tst_QMetaObject::cleanupTestCase() -{ -} - -void tst_QMetaObject::init() -{ -} - -void tst_QMetaObject::cleanup() -{ -} - void tst_QMetaObject::stdSet() { const QMetaObject *mo = metaObject(); diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index d7ca8e6f1e..719b20e766 100644 --- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -46,10 +46,6 @@ class tst_QMetaObjectBuilder : public QObject { Q_OBJECT -public: - tst_QMetaObjectBuilder() {} - ~tst_QMetaObjectBuilder() {} - private slots: void mocVersionCheck(); void create(); diff --git a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp index 6876862603..6e8e9940ab 100644 --- a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp +++ b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <QMimeData> @@ -47,11 +46,6 @@ class tst_QMimeData : public QObject { Q_OBJECT -public: - tst_QMimeData() - { - } - private slots: void clear() const; void colorData() const; @@ -338,6 +332,5 @@ void tst_QMimeData::setUrls() const QVERIFY(mimeData.hasUrls() == false); } - QTEST_MAIN(tst_QMimeData) #include "tst_qmimedata.moc" diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 56d63f2e09..7bab96a188 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -39,17 +39,14 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <qcoreapplication.h> - #include <qpointer.h> #include <qtimer.h> #include <qregexp.h> #include <qmetaobject.h> #include <qvariant.h> - #include <QTcpServer> #include <QTcpSocket> #include <QThread> @@ -62,7 +59,6 @@ #include <private/qobject_p.h> #endif - #include <math.h> //TESTED_CLASS= @@ -71,17 +67,6 @@ class tst_QObject : public QObject { Q_OBJECT - -public: - tst_QObject(); - virtual ~tst_QObject(); - - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); private slots: void disconnect(); void connectByName(); @@ -136,35 +121,8 @@ private slots: void disconnectNotSignalMetaMethod(); void autoConnectionBehavior(); void baseDestroyed(); -protected: }; -tst_QObject::tst_QObject() -{ - -} - -tst_QObject::~tst_QObject() -{ - -} - -void tst_QObject::initTestCase() -{ -} - -void tst_QObject::cleanupTestCase() -{ -} - -void tst_QObject::init() -{ -} - -void tst_QObject::cleanup() -{ -} - class SenderObject : public QObject { Q_OBJECT diff --git a/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp b/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp index a4dc123778..ae82d341e5 100644 --- a/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp +++ b/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp @@ -39,69 +39,28 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> - #include <qsignalmapper.h> #include <qspinbox.h> - - - - //TESTED_CLASS= //TESTED_FILES= class tst_QSignalMapper : public QObject { Q_OBJECT - -public: - tst_QSignalMapper(); - virtual ~tst_QSignalMapper(); - - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); private slots: void mapped(); }; -tst_QSignalMapper::tst_QSignalMapper() -{ -} - -tst_QSignalMapper::~tst_QSignalMapper() -{ -} - -void tst_QSignalMapper::initTestCase() -{ -} - -void tst_QSignalMapper::cleanupTestCase() -{ -} - -void tst_QSignalMapper::init() -{ -} - -void tst_QSignalMapper::cleanup() -{ -} - class QtTestObject : public QObject { Q_OBJECT public slots: void myslot(int id); void myslot(const QString &str); - + public: int id; QString str; diff --git a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp index af20de681f..643524ed61 100644 --- a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp +++ b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include <QtTest/QTest> #include <QtTest/QSignalSpy> #include <QtTest/QTestEventLoop> @@ -65,10 +64,6 @@ class tst_QSocketNotifier : public QObject { Q_OBJECT -public: - tst_QSocketNotifier(); - ~tst_QSocketNotifier(); - private slots: void unexpectedDisconnection(); void mixingWithTimers(); @@ -77,13 +72,6 @@ private slots: #endif }; -tst_QSocketNotifier::tst_QSocketNotifier() -{ } - -tst_QSocketNotifier::~tst_QSocketNotifier() -{ -} - class UnexpectedDisconnectTester : public QObject { Q_OBJECT diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index 4af2a492d7..c29ad8e44f 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -39,10 +39,8 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> - #include <qtimer.h> #include <qthread.h> @@ -56,17 +54,6 @@ class tst_QTimer : public QObject { Q_OBJECT - -public: - tst_QTimer(); - virtual ~tst_QTimer(); - - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); private slots: void zeroTimer(); void singleShotTimeout(); @@ -110,30 +97,6 @@ void TimerHelper::timeout() ++count; } -tst_QTimer::tst_QTimer() -{ -} - -tst_QTimer::~tst_QTimer() -{ -} - -void tst_QTimer::initTestCase() -{ -} - -void tst_QTimer::cleanupTestCase() -{ -} - -void tst_QTimer::init() -{ -} - -void tst_QTimer::cleanup() -{ -} - void tst_QTimer::zeroTimer() { TimerHelper helper; diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp index 8e2ed157a4..5908c335c2 100644 --- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <QWidget> #include <qtranslator.h> @@ -54,15 +53,8 @@ class tst_QTranslator : public QWidget public: tst_QTranslator(); - virtual ~tst_QTranslator(); - -public slots: - void init(); - void cleanup(); - protected: bool event(QEvent *event); - private slots: void load(); void load2(); @@ -77,7 +69,6 @@ private: int languageChangeEventCounter; }; - tst_QTranslator::tst_QTranslator() : languageChangeEventCounter(0) { @@ -85,18 +76,6 @@ tst_QTranslator::tst_QTranslator() hide(); } -tst_QTranslator::~tst_QTranslator() -{ -} - -void tst_QTranslator::init() -{ -} - -void tst_QTranslator::cleanup() -{ -} - bool tst_QTranslator::event(QEvent *event) { if (event->type() == QEvent::LanguageChange) diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index b3e4777e1b..c4fed9088f 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <qvariant.h> @@ -90,9 +89,6 @@ class tst_QVariant : public QObject { Q_OBJECT -public: - tst_QVariant(); - private slots: void constructor(); void copy_constructor(); @@ -275,10 +271,6 @@ Q_DECLARE_METATYPE(QVariant) const qlonglong intMax1 = (qlonglong)INT_MAX + 1; const qulonglong uintMax1 = (qulonglong)UINT_MAX + 1; -tst_QVariant::tst_QVariant() -{ -} - void tst_QVariant::constructor() { QVariant variant; diff --git a/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp index c351167ce8..7412baf421 100644 --- a/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp +++ b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #include <QtTest/QtTest> #include <private/qwineventnotifier_p.h> #include <qtimer.h> @@ -51,20 +50,10 @@ class tst_QWinEventNotifier : public QObject { Q_OBJECT -public: - tst_QWinEventNotifier(); - ~tst_QWinEventNotifier(); - - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - protected slots: void simple_activated(); void simple_timerSet(); private slots: - void simple(); private: @@ -72,26 +61,6 @@ private: bool simpleActivated; }; -tst_QWinEventNotifier::tst_QWinEventNotifier() -{} - -tst_QWinEventNotifier::~tst_QWinEventNotifier() -{ } - -void tst_QWinEventNotifier::initTestCase() -{ } - -void tst_QWinEventNotifier::cleanupTestCase() -{ } - -void tst_QWinEventNotifier::init() -{ } - -void tst_QWinEventNotifier::cleanup() -{ -} - - void tst_QWinEventNotifier::simple_activated() { simpleActivated = true; |