aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquickworkerscript
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /tests/auto/qml/qquickworkerscript
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff)
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qquickworkerscript')
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index 49135ca920..e8a4be6faf 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -79,7 +79,7 @@ void tst_QQuickWorkerScript::source()
{
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
const QMetaObject *mo = worker->metaObject();
QVariant value(100);
@@ -104,7 +104,7 @@ void tst_QQuickWorkerScript::messaging()
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
waitForEchoMessage(worker);
@@ -144,7 +144,7 @@ void tst_QQuickWorkerScript::messaging_sendQObjectList()
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QVariantList objects;
for (int i=0; i<3; i++)
@@ -165,7 +165,7 @@ void tst_QQuickWorkerScript::messaging_sendJsObject()
{
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
// Properties are in alphabetical order to enable string-based comparison after
// QVariant roundtrip, since the properties will be stored in a QVariantMap.
@@ -204,7 +204,7 @@ void tst_QQuickWorkerScript::script_with_pragma()
QQmlComponent component(&m_engine, testFileUrl("worker_pragma.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
waitForEchoMessage(worker);
@@ -220,7 +220,7 @@ void tst_QQuickWorkerScript::script_included()
{
QQmlComponent component(&m_engine, testFileUrl("worker_include.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -247,7 +247,7 @@ void tst_QQuickWorkerScript::scriptError_onLoad()
QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QTRY_COMPARE(qquickworkerscript_lastWarning,
testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3:10: SyntaxError: Expected token `,'"));
@@ -261,7 +261,7 @@ void tst_QQuickWorkerScript::scriptError_onCall()
{
QQmlComponent component(&m_engine, testFileUrl("worker_error_onCall.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
QVariant value;
@@ -279,7 +279,7 @@ void tst_QQuickWorkerScript::script_function()
{
QQmlComponent component(&m_engine, testFileUrl("worker_function.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -297,7 +297,7 @@ void tst_QQuickWorkerScript::script_var()
{
QQmlComponent component(&m_engine, testFileUrl("worker_var.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -316,7 +316,7 @@ void tst_QQuickWorkerScript::script_global()
{
QQmlComponent component(&m_engine, testFileUrl("worker_global.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -340,7 +340,7 @@ void tst_QQuickWorkerScript::script_global()
QQmlComponent component(&m_engine, testFileUrl("worker_global2.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QTRY_COMPARE(qquickworkerscript_lastWarning,
testFileUrl("script_global2.js").toString() + QLatin1String(":1: Invalid write to global property \"world\""));