Skip to content

Commit

Permalink
Replace QtTest headers with QTest
Browse files Browse the repository at this point in the history
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.

Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
David Skoland authored and vohi committed Dec 22, 2020
1 parent bbebfa0 commit 27d96b4
Show file tree
Hide file tree
Showing 636 changed files with 1,102 additions and 704 deletions.
2 changes: 1 addition & 1 deletion examples/qtestlib/tutorial1/testqstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
****************************************************************************/

//! [0]
#include <QtTest/QtTest>
#include <QTest>

class TestQString: public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion examples/qtestlib/tutorial2/testqstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>

//! [0]
class TestQString: public QObject
Expand Down
2 changes: 1 addition & 1 deletion examples/qtestlib/tutorial3/testgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

//! [0]
#include <QtWidgets>
#include <QtTest/QtTest>
#include <QTest>

class TestGui: public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion examples/qtestlib/tutorial4/testgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
****************************************************************************/

#include <QtWidgets>
#include <QtTest/QtTest>
#include <QTest>

//! [0]
class TestGui: public QObject
Expand Down
3 changes: 2 additions & 1 deletion src/3rdparty/tinycbor/tests/encoder/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
**
****************************************************************************/

#include <QtTest>
#include <QTest>
#include <QFloat16>

static float myNaNf()
{
Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/tinycbor/tests/encoder/tst_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
**
****************************************************************************/

#include <QtTest>
#include <QTest>
#include "cbor.h"

#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/tinycbor/tests/parser/data.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <QtTest>
#include <QTest>
#include <limits>
#include <cbor.h>

Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/tinycbor/tests/parser/tst_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define _XOPEN_SOURCE 700
#define _DARWIN_C_SOURCE 1 /* need MAP_ANON */
#include <QtTest>
#include <QTest>
#include "cbor.h"
#include <stdio.h>
#include <stdarg.h>
Expand Down
2 changes: 1 addition & 1 deletion src/testlib/doc/snippets/code/doc_src_qtestevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>
#include <QLineEdit>

// dummy
Expand Down
2 changes: 1 addition & 1 deletion src/testlib/doc/snippets/code/doc_src_qtestlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
**
****************************************************************************/

#include <QtTest>
#include <QTest>
#include "src_qtestlib_qtestcase.cpp"
//! [0]
class MyFirstTest: public QObject
Expand Down
2 changes: 1 addition & 1 deletion src/testlib/doc/snippets/code/doc_src_qttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
****************************************************************************/

//! [0]
#include <QtTest>
#include <QTest>
//! [0]
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtTest>
#include <QTest>

// dummy class
class MyObject
Expand Down
3 changes: 2 additions & 1 deletion src/testlib/qabstractitemmodeltester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
#include <QtCore/QPointer>
#include <QtCore/QAbstractItemModel>
#include <QtCore/QStack>
#include <QtTest/QtTest>
#include <QTest>
#include <QLoggingCategory>

QT_BEGIN_NAMESPACE

Expand Down
2 changes: 1 addition & 1 deletion tests/auto/cmake/test_testlib_definitions/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
****************************************************************************/

#include <QObject>
#include <QtTest>
#include <QTest>

class TestObject : public QObject
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <qtconcurrentfilter.h>
#include <QCoreApplication>
#include <QList>
#include <QtTest/QtTest>
#include <QTest>

#include "../testhelper_functions.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <qtconcurrentmap.h>
#include <QCoreApplication>
#include <QList>
#include <QtTest/QtTest>
#include <QTest>

#include "../testhelper_functions.h"
#include "generation_helpers.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
****************************************************************************/
#include <qtconcurrentfilter.h>
#include <qtconcurrentmap.h>
#include <QtTest/QtTest>
#include <QTest>

#include "generation_helpers.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int distance(TestIterator &a, TestIterator &b)
}

#include <qtconcurrentiteratekernel.h>
#include <QtTest/QtTest>
#include <QTest>

using namespace QtConcurrent;

Expand Down
6 changes: 3 additions & 3 deletions tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
****************************************************************************/
#include <qtconcurrentmap.h>
#include <qexception.h>

#include <qdebug.h>

#include <QThread>
#include <QMutex>

#include <QtTest/QtTest>
#include <QTest>
#include <QRandomGenerator>

#include "../testhelper_functions.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
****************************************************************************/
#include <qtconcurrentmedian.h>

#include <QtTest/QtTest>
#include <QTest>

class tst_QtConcurrentMedian: public QObject
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
#include <QMutexLocker>
#include <QString>
#include <QWaitCondition>
#include <QtTest/QtTest>
#include <QTest>
#include <QTimer>
#include <QFutureSynchronizer>

using namespace QtConcurrent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@

#include <qtconcurrenttask.h>

#include <QtTest/QtTest>
#include <QTest>
#include <QSemaphore>

#include <random>

class tst_QtConcurrentTask : public QObject
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <qexception.h>
#include <QThread>
#include <QElapsedTimer>
#include <QtTest/QtTest>
#include <QTest>

using namespace QtConcurrent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <QtCore/qabstractanimation.h>
#include <QtCore/qanimationgroup.h>
#include <QtTest>
#include <QTest>

class tst_QAbstractAnimation : public QObject
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>
#include <QPauseAnimation>
#include <QVariantAnimation>
#include <QPropertyAnimation>
#include <QSignalSpy>

#include <QtCore/qanimationgroup.h>
#include <QtCore/qsequentialanimationgroup.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>
#include <QVariantAnimation>
#include <QPropertyAnimation>
#include <QSignalSpy>

#include <QtCore/qparallelanimationgroup.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>

#include <QtCore/qpauseanimation.h>
#include <QtCore/qpropertyanimation.h>
#include <QtCore/qsequentialanimationgroup.h>

#include <QParallelAnimationGroup>

#include <private/qabstractanimation_p.h>

#if defined(Q_OS_WIN) || defined(Q_OS_ANDROID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>
#include <QSignalSpy>
#include <QAnimationGroup>
#include <QSequentialAnimationGroup>
#include <QtCore/qpropertyanimation.h>
#include <QtCore/qvariantanimation.h>
#include <private/qabstractanimation_p.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>
#include <QVariantAnimation>
#include <QPropertyAnimation>
#include <QSignalSpy>
#include <QParallelAnimationGroup>

#include <QtCore/qanimationgroup.h>
#include <QtCore/qsequentialanimationgroup.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


#include <QtCore/qvariantanimation.h>
#include <QtTest>
#include <QTest>

class tst_QVariantAnimation : public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/global/q_func_info/tst_q_func_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


#include <QString>
#include <QtTest/QtTest>
#include <QTest>
#include <QtDebug>

class tst_q_func_info : public QObject
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/global/qflags/tst_qflags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtTest/QtTest>
#include <QTest>

QT_WARNING_DISABLE_DEPRECATED

Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>
#include <QFloat16>

#include <math.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
****************************************************************************/

#include <qdebug.h>
#include <QtTest/QtTest>
#include <QTest>

#include <qglobal.h>
#ifdef Q_OS_WIN
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/global/qglobal/tst_qglobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
****************************************************************************/


#include <QtTest/QtTest>
#include <QTest>

#include <QPair>
#include <QSysInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
****************************************************************************/

#include <QtCore/QThread>
#include <QtTest/QtTest>
#include <QTest>
#include <QReadWriteLock>

#if defined(Q_OS_UNIX)
#include <sys/resource.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/global/qhooks/tst_qhooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
****************************************************************************/


#include <QtTest/QtTest>
#include <QTest>
#include <QtCore/private/qhooks_p.h>

class tst_QHooks: public QObject
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
****************************************************************************/


#include <QtTest/QtTest>
#include <QTest>
#include <QtGlobal>
#include "private/qnumeric_p.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
**
****************************************************************************/

#include <QtTest/QtTest>
#include <QTest>
#include <qoperatingsystemversion.h>

class tst_QOperatingSystemVersion : public QObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
**
****************************************************************************/

#include <QtTest>
#include <QTest>
#include <qlist.h>
#include <qobject.h>
#include <qrandom.h>
Expand Down
Loading

0 comments on commit 27d96b4

Please sign in to comment.