summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qbenchmarkperfevents_p.h20
-rw-r--r--src/testlib/qcsvbenchmarklogger_p.h14
-rw-r--r--src/testlib/qsignalspy.h4
-rw-r--r--src/testlib/qtest.h2
-rw-r--r--src/testlib/qtest_gui.h28
-rw-r--r--src/testlib/qtestaccessible.h8
-rw-r--r--src/testlib/qtestcase.cpp8
-rw-r--r--src/testlib/qtestcase.h14
-rw-r--r--src/testlib/qtesteventloop.h6
-rw-r--r--src/testlib/qtesttable.cpp6
-rw-r--r--src/testlib/qtesttouch.h16
-rw-r--r--src/testlib/qxctestlogger_p.h16
12 files changed, 71 insertions, 71 deletions
diff --git a/src/testlib/qbenchmarkperfevents_p.h b/src/testlib/qbenchmarkperfevents_p.h
index 085dc620d7..86ba556549 100644
--- a/src/testlib/qbenchmarkperfevents_p.h
+++ b/src/testlib/qbenchmarkperfevents_p.h
@@ -60,16 +60,16 @@ class QBenchmarkPerfEventsMeasurer : public QBenchmarkMeasurerBase
public:
QBenchmarkPerfEventsMeasurer();
~QBenchmarkPerfEventsMeasurer();
- virtual void init() Q_DECL_OVERRIDE;
- virtual void start() Q_DECL_OVERRIDE;
- virtual qint64 checkpoint() Q_DECL_OVERRIDE;
- virtual qint64 stop() Q_DECL_OVERRIDE;
- virtual bool isMeasurementAccepted(qint64 measurement) Q_DECL_OVERRIDE;
- virtual int adjustIterationCount(int suggestion) Q_DECL_OVERRIDE;
- virtual int adjustMedianCount(int suggestion) Q_DECL_OVERRIDE;
- virtual bool repeatCount() Q_DECL_OVERRIDE { return 1; }
- virtual bool needsWarmupIteration() Q_DECL_OVERRIDE { return true; }
- virtual QTest::QBenchmarkMetric metricType() Q_DECL_OVERRIDE;
+ virtual void init() override;
+ virtual void start() override;
+ virtual qint64 checkpoint() override;
+ virtual qint64 stop() override;
+ virtual bool isMeasurementAccepted(qint64 measurement) override;
+ virtual int adjustIterationCount(int suggestion) override;
+ virtual int adjustMedianCount(int suggestion) override;
+ virtual bool repeatCount() override { return 1; }
+ virtual bool needsWarmupIteration() override { return true; }
+ virtual QTest::QBenchmarkMetric metricType() override;
static bool isAvailable();
static QTest::QBenchmarkMetric metricForEvent(quint32 type, quint64 event_id);
diff --git a/src/testlib/qcsvbenchmarklogger_p.h b/src/testlib/qcsvbenchmarklogger_p.h
index f321494e8a..5840aee0f5 100644
--- a/src/testlib/qcsvbenchmarklogger_p.h
+++ b/src/testlib/qcsvbenchmarklogger_p.h
@@ -61,18 +61,18 @@ public:
QCsvBenchmarkLogger(const char *filename);
~QCsvBenchmarkLogger();
- void startLogging() Q_DECL_OVERRIDE;
- void stopLogging() Q_DECL_OVERRIDE;
+ void startLogging() override;
+ void stopLogging() override;
- void enterTestFunction(const char *function) Q_DECL_OVERRIDE;
- void leaveTestFunction() Q_DECL_OVERRIDE;
+ void enterTestFunction(const char *function) override;
+ void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
- void addBenchmarkResult(const QBenchmarkResult &result) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
+ void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
};
QT_END_NAMESPACE
diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h
index 6b1b7e6922..d9a0f4496b 100644
--- a/src/testlib/qsignalspy.h
+++ b/src/testlib/qsignalspy.h
@@ -88,7 +88,7 @@ public:
}
if (!QMetaObject::connect(obj, sigIndex, this, memberOffset,
- Qt::DirectConnection, Q_NULLPTR)) {
+ Qt::DirectConnection, nullptr)) {
qWarning("QSignalSpy: QMetaObject::connect returned false. Unable to connect.");
return;
}
@@ -151,7 +151,7 @@ public:
return count() > origCount;
}
- int qt_metacall(QMetaObject::Call call, int methodId, void **a) Q_DECL_OVERRIDE
+ int qt_metacall(QMetaObject::Call call, int methodId, void **a) override
{
methodId = QObject::qt_metacall(call, methodId, a);
if (methodId < 0)
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index ca045120d5..a5df27e3b9 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -263,7 +263,7 @@ inline bool qCompare(QList<T> const &t1, QList<T> const &t2, const char *actual,
delete [] val2;
}
}
- return compare_helper(isOk, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(isOk, msg, nullptr, nullptr, actual, expected, file, line);
}
template <>
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h
index d848f08d55..f56aa60949 100644
--- a/src/testlib/qtest_gui.h
+++ b/src/testlib/qtest_gui.h
@@ -122,25 +122,25 @@ template<> inline char *toString(const QRegion &region)
#ifndef QT_NO_VECTOR2D
template<> inline char *toString(const QVector2D &v)
{
- QByteArray result = "QVector2D(" + QByteArray::number(v.x()) + ", "
- + QByteArray::number(v.y()) + ')';
+ QByteArray result = "QVector2D(" + QByteArray::number(double(v.x())) + ", "
+ + QByteArray::number(double(v.y())) + ')';
return qstrdup(result.constData());
}
#endif // !QT_NO_VECTOR2D
#ifndef QT_NO_VECTOR3D
template<> inline char *toString(const QVector3D &v)
{
- QByteArray result = "QVector3D(" + QByteArray::number(v.x()) + ", "
- + QByteArray::number(v.y()) + ", " + QByteArray::number(v.z()) + ')';
+ QByteArray result = "QVector3D(" + QByteArray::number(double(v.x())) + ", "
+ + QByteArray::number(double(v.y())) + ", " + QByteArray::number(double(v.z())) + ')';
return qstrdup(result.constData());
}
#endif // !QT_NO_VECTOR3D
#ifndef QT_NO_VECTOR4D
template<> inline char *toString(const QVector4D &v)
{
- QByteArray result = "QVector4D(" + QByteArray::number(v.x()) + ", "
- + QByteArray::number(v.y()) + ", " + QByteArray::number(v.z())
- + ", " + QByteArray::number(v.w()) + ')';
+ QByteArray result = "QVector4D(" + QByteArray::number(double(v.x())) + ", "
+ + QByteArray::number(double(v.y())) + ", " + QByteArray::number(double(v.z()))
+ + ", " + QByteArray::number(double(v.w())) + ')';
return qstrdup(result.constData());
}
#endif // !QT_NO_VECTOR4D
@@ -164,24 +164,24 @@ inline bool qCompare(QImage const &t1, QImage const &t2,
qsnprintf(msg, 1024, "Compared QImages differ.\n"
" Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QImages differ in size.\n"
" Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
if (t1.format() != t2.format()) {
qsnprintf(msg, 1024, "Compared QImages differ in format.\n"
" Actual (%s): %d\n"
" Expected (%s): %d",
actual, t1.format(), expected, t2.format());
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
return compare_helper(t1 == t2, "Compared values are not the same",
toString(t1), toString(t2), actual, expected, file, line);
@@ -198,17 +198,17 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c
qsnprintf(msg, 1024, "Compared QPixmaps differ.\n"
" Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n"
" Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
return qCompare(t1.toImage(), t2.toImage(), actual, expected, file, line);
}
diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h
index 464f87fb5c..0470d15ed7 100644
--- a/src/testlib/qtestaccessible.h
+++ b/src/testlib/qtestaccessible.h
@@ -132,7 +132,7 @@ public:
static void cleanup()
{
delete instance();
- instance() = Q_NULLPTR;
+ instance() = nullptr;
}
static void clearEvents() { eventList().clear(); }
static EventList events() { return eventList(); }
@@ -167,8 +167,8 @@ private:
~QTestAccessibility()
{
- QAccessible::installUpdateHandler(Q_NULLPTR);
- QAccessible::installRootObjectHandler(Q_NULLPTR);
+ QAccessible::installUpdateHandler(nullptr);
+ QAccessible::installRootObjectHandler(nullptr);
}
static void rootObjectHandler(QObject *object)
@@ -273,7 +273,7 @@ private:
static QTestAccessibility *&instance()
{
- static QTestAccessibility *ta = Q_NULLPTR;
+ static QTestAccessibility *ta = nullptr;
return ta;
}
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 3b5acb6b95..eeaa30e9a0 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1385,7 +1385,7 @@ void TestMethods::invokeTests(QObject *testObject) const
if (!QTestResult::skipCurrentTest() && !previousFailed) {
for (int i = 0, count = int(m_methods.size()); i < count; ++i) {
- const char *data = Q_NULLPTR;
+ const char *data = nullptr;
if (i < QTest::testTags.size() && !QTest::testTags.at(i).isEmpty())
data = qstrdup(QTest::testTags.at(i).toLatin1().constData());
const bool ok = invokeTest(i, data, watchDog.data());
@@ -1530,7 +1530,7 @@ class DebugSymbolResolver
Q_DISABLE_COPY(DebugSymbolResolver)
public:
struct Symbol {
- Symbol() : name(Q_NULLPTR), address(0) {}
+ Symbol() : name(nullptr), address(0) {}
const char *name; // Must be freed by caller.
DWORD64 address;
@@ -1578,11 +1578,11 @@ void DebugSymbolResolver::cleanup()
if (m_dbgHelpLib)
FreeLibrary(m_dbgHelpLib);
m_dbgHelpLib = 0;
- m_symFromAddr = Q_NULLPTR;
+ m_symFromAddr = nullptr;
}
DebugSymbolResolver::DebugSymbolResolver(HANDLE process)
- : m_process(process), m_dbgHelpLib(0), m_symFromAddr(Q_NULLPTR)
+ : m_process(process), m_dbgHelpLib(0), m_symFromAddr(nullptr)
{
bool success = false;
m_dbgHelpLib = LoadLibraryW(L"dbghelp.dll");
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 2605325a94..f38f7ed4df 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -250,7 +250,7 @@ namespace QTest
template <typename T> // Fallback
inline typename std::enable_if<!QtPrivate::IsQEnumHelper<T>::Value, char*>::type toString(const T &)
{
- return Q_NULLPTR;
+ return nullptr;
}
} // namespace Internal
@@ -273,14 +273,14 @@ namespace QTest
Q_TESTLIB_EXPORT char *toString(const char *);
Q_TESTLIB_EXPORT char *toString(const void *);
- Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = Q_NULLPTR);
+ Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = nullptr);
Q_TESTLIB_EXPORT int qRun();
Q_TESTLIB_EXPORT void qCleanup();
- Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc = 0, char **argv = Q_NULLPTR);
+ Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc = 0, char **argv = nullptr);
Q_TESTLIB_EXPORT int qExec(QObject *testObject, const QStringList &arguments);
- Q_TESTLIB_EXPORT void setMainSourcePath(const char *file, const char *builddir = Q_NULLPTR);
+ Q_TESTLIB_EXPORT void setMainSourcePath(const char *file, const char *builddir = nullptr);
Q_TESTLIB_EXPORT bool qVerify(bool statement, const char *statementStr, const char *description,
const char *file, int line);
@@ -288,7 +288,7 @@ namespace QTest
Q_TESTLIB_EXPORT void qSkip(const char *message, const char *file, int line);
Q_TESTLIB_EXPORT bool qExpectFail(const char *dataIndex, const char *comment, TestFailMode mode,
const char *file, int line);
- Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = Q_NULLPTR, int line = 0);
+ Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = nullptr, int line = 0);
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message);
#ifndef QT_NO_REGULAREXPRESSION
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
@@ -297,8 +297,8 @@ namespace QTest
#if QT_CONFIG(temporaryfile)
Q_TESTLIB_EXPORT QSharedPointer<QTemporaryDir> qExtractTestData(const QString &dirName);
#endif
- Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
- Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
+ Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr);
+ Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr);
Q_TESTLIB_EXPORT void *qData(const char *tagName, int typeId);
Q_TESTLIB_EXPORT void *qGlobalData(const char *tagName, int typeId);
diff --git a/src/testlib/qtesteventloop.h b/src/testlib/qtesteventloop.h
index bcf4a4be2d..81c0b9126c 100644
--- a/src/testlib/qtesteventloop.h
+++ b/src/testlib/qtesteventloop.h
@@ -56,8 +56,8 @@ class Q_TESTLIB_EXPORT QTestEventLoop : public QObject
Q_OBJECT
public:
- inline QTestEventLoop(QObject *aParent = Q_NULLPTR)
- : QObject(aParent), inLoop(false), _timeout(false), timerId(-1), loop(Q_NULLPTR) {}
+ inline QTestEventLoop(QObject *aParent = nullptr)
+ : QObject(aParent), inLoop(false), _timeout(false), timerId(-1), loop(nullptr) {}
inline void enterLoopMSecs(int ms);
inline void enterLoop(int secs) { enterLoopMSecs(secs * 1000); }
@@ -103,7 +103,7 @@ inline void QTestEventLoop::enterLoopMSecs(int ms)
loop = &l;
l.exec();
- loop = Q_NULLPTR;
+ loop = nullptr;
}
inline void QTestEventLoop::exitLoop()
diff --git a/src/testlib/qtesttable.cpp b/src/testlib/qtesttable.cpp
index 1afe2f7af5..953495a18a 100644
--- a/src/testlib/qtesttable.cpp
+++ b/src/testlib/qtesttable.cpp
@@ -58,7 +58,7 @@ public:
}
struct Element {
- Element() : name(Q_NULLPTR), type(0) {}
+ Element() : name(nullptr), type(0) {}
Element(const char *n, int t) : name(n), type(t) {}
const char *name;
@@ -130,12 +130,12 @@ int QTestTable::elementTypeId(int index) const
const char *QTestTable::dataTag(int index) const
{
- return size_t(index) < d->elementList.size() ? d->elementList[index].name : Q_NULLPTR;
+ return size_t(index) < d->elementList.size() ? d->elementList[index].name : nullptr;
}
QTestData *QTestTable::testData(int index) const
{
- return size_t(index) < d->dataList.size() ? d->dataList[index] : Q_NULLPTR;
+ return size_t(index) < d->dataList.size() ? d->dataList[index] : nullptr;
}
class NamePredicate : public std::unary_function<QTestTablePrivate::Element, bool>
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index bda185bfee..bdb6d5b629 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -75,21 +75,21 @@ namespace QTest
if (commitWhenDestroyed)
commit();
}
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointPressed);
return *this;
}
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointMoved);
return *this;
}
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
@@ -104,21 +104,21 @@ namespace QTest
}
#ifdef QT_WIDGETS_LIB
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
p.setState(Qt::TouchPointPressed);
return *this;
}
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
p.setState(Qt::TouchPointMoved);
return *this;
}
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
@@ -151,14 +151,14 @@ namespace QTest
private:
#ifdef QT_WIDGETS_LIB
QTouchEventSequence(QWidget *widget, QTouchDevice *aDevice, bool autoCommit)
- : targetWidget(widget), targetWindow(Q_NULLPTR), device(aDevice), commitWhenDestroyed(autoCommit)
+ : targetWidget(widget), targetWindow(nullptr), device(aDevice), commitWhenDestroyed(autoCommit)
{
}
#endif
QTouchEventSequence(QWindow *window, QTouchDevice *aDevice, bool autoCommit)
:
#ifdef QT_WIDGETS_LIB
- targetWidget(Q_NULLPTR),
+ targetWidget(nullptr),
#endif
targetWindow(window), device(aDevice), commitWhenDestroyed(autoCommit)
{
diff --git a/src/testlib/qxctestlogger_p.h b/src/testlib/qxctestlogger_p.h
index 2bbd5ad296..1b641f18af 100644
--- a/src/testlib/qxctestlogger_p.h
+++ b/src/testlib/qxctestlogger_p.h
@@ -65,21 +65,21 @@ class QXcodeTestLogger : public QAbstractTestLogger
{
public:
QXcodeTestLogger();
- ~QXcodeTestLogger() Q_DECL_OVERRIDE;
+ ~QXcodeTestLogger() override;
- void startLogging() Q_DECL_OVERRIDE;
- void stopLogging() Q_DECL_OVERRIDE;
+ void startLogging() override;
+ void stopLogging() override;
- void enterTestFunction(const char *function) Q_DECL_OVERRIDE;
- void leaveTestFunction() Q_DECL_OVERRIDE;
+ void enterTestFunction(const char *function) override;
+ void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
- void addBenchmarkResult(const QBenchmarkResult &result) Q_DECL_OVERRIDE;
+ void addBenchmarkResult(const QBenchmarkResult &result) override;
static bool canLogTestProgress();
static int parseCommandLineArgument(const char *argument);