aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickpath
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/quick/qquickpath
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/quick/qquickpath')
-rw-r--r--tests/auto/quick/qquickpath/tst_qquickpath.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/quick/qquickpath/tst_qquickpath.cpp b/tests/auto/quick/qquickpath/tst_qquickpath.cpp
index 106d7afd85..12a8c673b0 100644
--- a/tests/auto/quick/qquickpath/tst_qquickpath.cpp
+++ b/tests/auto/quick/qquickpath/tst_qquickpath.cpp
@@ -53,7 +53,7 @@ void tst_QuickPath::arc()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("arc.qml"));
QQuickPath *obj = qobject_cast<QQuickPath*>(c.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->startX(), 0.);
QCOMPARE(obj->startY(), 0.);
@@ -62,7 +62,7 @@ void tst_QuickPath::arc()
QCOMPARE(list.count(), 1);
QQuickPathArc* arc = qobject_cast<QQuickPathArc*>(list.at(0));
- QVERIFY(arc != 0);
+ QVERIFY(arc != nullptr);
QCOMPARE(arc->x(), 100.);
QCOMPARE(arc->y(), 100.);
QCOMPARE(arc->radiusX(), 100.);
@@ -88,13 +88,13 @@ void tst_QuickPath::angleArc()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("anglearc.qml"));
QQuickPath *obj = qobject_cast<QQuickPath*>(c.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QQmlListReference list(obj, "pathElements");
QCOMPARE(list.count(), 1);
QQuickPathAngleArc* arc = qobject_cast<QQuickPathAngleArc*>(list.at(0));
- QVERIFY(arc != 0);
+ QVERIFY(arc != nullptr);
QCOMPARE(arc->centerX(), 100.);
QCOMPARE(arc->centerY(), 100.);
QCOMPARE(arc->radiusX(), 50.);
@@ -127,7 +127,7 @@ void tst_QuickPath::catmullromCurve()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("curve.qml"));
QQuickPath *obj = qobject_cast<QQuickPath*>(c.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->startX(), 0.);
QCOMPARE(obj->startY(), 0.);
@@ -136,12 +136,12 @@ void tst_QuickPath::catmullromCurve()
QCOMPARE(list.count(), 3);
QQuickPathCatmullRomCurve* curve = qobject_cast<QQuickPathCatmullRomCurve*>(list.at(0));
- QVERIFY(curve != 0);
+ QVERIFY(curve != nullptr);
QCOMPARE(curve->x(), 100.);
QCOMPARE(curve->y(), 50.);
curve = qobject_cast<QQuickPathCatmullRomCurve*>(list.at(2));
- QVERIFY(curve != 0);
+ QVERIFY(curve != nullptr);
QCOMPARE(curve->x(), 100.);
QCOMPARE(curve->y(), 150.);
@@ -163,7 +163,7 @@ void tst_QuickPath::closedCatmullromCurve()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("closedcurve.qml"));
QQuickPath *obj = qobject_cast<QQuickPath*>(c.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->startX(), 50.);
QCOMPARE(obj->startY(), 50.);
@@ -172,7 +172,7 @@ void tst_QuickPath::closedCatmullromCurve()
QCOMPARE(list.count(), 3);
QQuickPathCatmullRomCurve* curve = qobject_cast<QQuickPathCatmullRomCurve*>(list.at(2));
- QVERIFY(curve != 0);
+ QVERIFY(curve != nullptr);
QCOMPARE(curve->x(), 50.);
QCOMPARE(curve->y(), 50.);
@@ -196,7 +196,7 @@ void tst_QuickPath::svg()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("svg.qml"));
QQuickPath *obj = qobject_cast<QQuickPath*>(c.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->startX(), 0.);
QCOMPARE(obj->startY(), 0.);
@@ -205,7 +205,7 @@ void tst_QuickPath::svg()
QCOMPARE(list.count(), 1);
QQuickPathSvg* svg = qobject_cast<QQuickPathSvg*>(list.at(0));
- QVERIFY(svg != 0);
+ QVERIFY(svg != nullptr);
QCOMPARE(svg->path(), QLatin1String("M200,300 Q400,50 600,300 T1000,300"));
QPainterPath path = obj->path();