aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickanimations
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/qquickanimations
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/qquickanimations')
-rw-r--r--tests/auto/quick/qquickanimations/tst_qquickanimations.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
index d28d065d17..de86bb16db 100644
--- a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
+++ b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
@@ -760,7 +760,7 @@ void tst_qquickanimations::badTypes()
QQuickItemPrivate::get(rect)->setState("state1");
- QQuickRectangle *myRect = 0;
+ QQuickRectangle *myRect = nullptr;
QTRY_VERIFY(myRect = rect->findChild<QQuickRectangle*>("MyRect"));
QTRY_COMPARE(myRect->x(),qreal(200));
}
@@ -1153,7 +1153,7 @@ void tst_qquickanimations::easingProperties()
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickPropertyAnimation *animObject = qobject_cast<QQuickPropertyAnimation*>(animationComponent.create());
- QVERIFY(animObject != 0);
+ QVERIFY(animObject != nullptr);
QCOMPARE(animObject->easing().type(), QEasingCurve::InOutQuad);
}
@@ -1164,7 +1164,7 @@ void tst_qquickanimations::easingProperties()
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickPropertyAnimation *animObject = qobject_cast<QQuickPropertyAnimation*>(animationComponent.create());
- QVERIFY(animObject != 0);
+ QVERIFY(animObject != nullptr);
QCOMPARE(animObject->easing().type(), QEasingCurve::OutBounce);
QCOMPARE(animObject->easing().amplitude(), 5.0);
}
@@ -1176,7 +1176,7 @@ void tst_qquickanimations::easingProperties()
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickPropertyAnimation *animObject = qobject_cast<QQuickPropertyAnimation*>(animationComponent.create());
- QVERIFY(animObject != 0);
+ QVERIFY(animObject != nullptr);
QCOMPARE(animObject->easing().type(), QEasingCurve::OutElastic);
QCOMPARE(animObject->easing().amplitude(), 5.0);
QCOMPARE(animObject->easing().period(), 3.0);
@@ -1189,7 +1189,7 @@ void tst_qquickanimations::easingProperties()
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickPropertyAnimation *animObject = qobject_cast<QQuickPropertyAnimation*>(animationComponent.create());
- QVERIFY(animObject != 0);
+ QVERIFY(animObject != nullptr);
QCOMPARE(animObject->easing().type(), QEasingCurve::InOutBack);
QCOMPARE(animObject->easing().overshoot(), 2.0);
}
@@ -1201,7 +1201,7 @@ void tst_qquickanimations::easingProperties()
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickPropertyAnimation *animObject = qobject_cast<QQuickPropertyAnimation*>(animationComponent.create());
- QVERIFY(animObject != 0);
+ QVERIFY(animObject != nullptr);
QCOMPARE(animObject->easing().type(), QEasingCurve::BezierSpline);
QList<QPointF> points = animObject->easing().cubicBezierSpline();
QCOMPARE(points.count(), 3);
@@ -1324,7 +1324,7 @@ void tst_qquickanimations::nonTransitionBug()
QQmlComponent c(&engine, testFileUrl("nonTransitionBug.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect);
QQuickRectangle *mover = rect->findChild<QQuickRectangle*>("mover");
@@ -1350,7 +1350,7 @@ void tst_qquickanimations::registrationBug()
QQmlComponent c(&engine, testFileUrl("registrationBug.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QTRY_COMPARE(rect->property("value"), QVariant(int(100)));
}
@@ -1360,10 +1360,10 @@ void tst_qquickanimations::doubleRegistrationBug()
QQmlComponent c(&engine, testFileUrl("doubleRegistrationBug.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QQuickAbstractAnimation *anim = rect->findChild<QQuickAbstractAnimation*>("animation");
- QVERIFY(anim != 0);
+ QVERIFY(anim != nullptr);
QTRY_COMPARE(anim->qtAnimation()->state(), QAbstractAnimationJob::Stopped);
}
@@ -1401,7 +1401,7 @@ void tst_qquickanimations::transitionAssignmentBug()
QQmlComponent c(&engine, testFileUrl("transitionAssignmentBug.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QCOMPARE(rect->property("nullObject").toBool(), false);
}
@@ -1413,7 +1413,7 @@ void tst_qquickanimations::pauseBindingBug()
QQmlComponent c(&engine, testFileUrl("pauseBindingBug.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QQuickAbstractAnimation *anim = rect->findChild<QQuickAbstractAnimation*>("animation");
QCOMPARE(anim->qtAnimation()->state(), QAbstractAnimationJob::Paused);
@@ -1427,7 +1427,7 @@ void tst_qquickanimations::pauseBug()
QQmlComponent c(&engine, testFileUrl("pauseBug.qml"));
QQuickAbstractAnimation *anim = qobject_cast<QQuickAbstractAnimation*>(c.create());
- QVERIFY(anim != 0);
+ QVERIFY(anim != nullptr);
QCOMPARE(anim->qtAnimation()->state(), QAbstractAnimationJob::Paused);
QCOMPARE(anim->isPaused(), true);
QCOMPARE(anim->isRunning(), true);
@@ -1444,14 +1444,14 @@ void tst_qquickanimations::loopingBug()
QObject *obj = c.create();
QQuickAbstractAnimation *anim = obj->findChild<QQuickAbstractAnimation*>();
- QVERIFY(anim != 0);
+ QVERIFY(anim != nullptr);
QCOMPARE(anim->qtAnimation()->totalDuration(), 300);
QCOMPARE(anim->isRunning(), true);
QTRY_COMPARE(static_cast<QAnimationGroupJob*>(anim->qtAnimation())->firstChild()->currentLoop(), 2);
QTRY_COMPARE(anim->isRunning(), false);
QQuickRectangle *rect = obj->findChild<QQuickRectangle*>();
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QCOMPARE(rect->rotation(), qreal(90));
delete obj;