diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-07 13:05:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-07 23:02:47 +0200 |
commit | 564b59d903683b14c75b72a3e93367717f201def (patch) | |
tree | 03ffe749d83dce84429a7db484bf92795047036f /tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp | |
parent | b5fc1e4e2643e73d3b44c483d159529f8deb8af1 (diff) |
Another round of replacing 0 with nullptr
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.
Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp')
-rw-r--r-- | tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp index ba973910a7..63e2f25d1d 100644 --- a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp +++ b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp @@ -98,7 +98,7 @@ void tst_QPointer::assignment_operators() QCOMPARE(p1, QPointer<QObject>(p2)); // Test assignment with a null pointer - p1 = 0; + p1 = nullptr; p2 = p1; QCOMPARE(p1, QPointer<QObject>(0)); QCOMPARE(p2, QPointer<QObject>(0)); @@ -131,9 +131,9 @@ void tst_QPointer::equality_operators() QVERIFY(p1 == p2); - QObject *object = 0; + QObject *object = nullptr; #ifndef QT_NO_WIDGETS - QWidget *widget = 0; + QWidget *widget = nullptr; #endif p1 = object; @@ -149,11 +149,15 @@ void tst_QPointer::equality_operators() QVERIFY(p1 == p2); // compare to zero - p1 = 0; + p1 = nullptr; QVERIFY(p1 == 0); QVERIFY(0 == p1); QVERIFY(p2 != 0); QVERIFY(0 != p2); + QVERIFY(p1 == nullptr); + QVERIFY(nullptr == p1); + QVERIFY(p2 != nullptr); + QVERIFY(nullptr != p2); QVERIFY(p1 == object); QVERIFY(object == p1); QVERIFY(p2 != object); @@ -188,7 +192,7 @@ void tst_QPointer::isNull() QVERIFY(p1.isNull()); p1 = this; QVERIFY(!p1.isNull()); - p1 = 0; + p1 = nullptr; QVERIFY(p1.isNull()); } |