diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-03-08 16:26:28 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-03-18 17:28:26 +0000 |
commit | 639ce9e55edce0999061bd323b21d4c39d7265e9 (patch) | |
tree | cbc4497c951ab8bd328a3e83d13d440069869f48 /tests | |
parent | a263655f9197e92101d33cb02de99c243531aecf (diff) |
Add nullptr comparison to Q{Explicitly,}SharedDataPointer
[ChangeLog][QtCore][QSharedDataPointer] Added operator== for nullptr.
[ChangeLog][QtCore][QExplicitlySharedDataPointer] Added operator== for
nullptr.
Task-number: QTBUG-66635
Task-number: QTBUG-66946
Change-Id: I72f5230ad59948f784eafffd151a18e34384d844
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp index f545ead1f1..e89e634841 100644 --- a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp +++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp @@ -159,6 +159,8 @@ void tst_QExplicitlySharedDataPointer::data() const { QExplicitlySharedDataPointer<const MyClass> pointer; QCOMPARE(pointer.data(), static_cast<const MyClass *>(0)); + QVERIFY(pointer == nullptr); + QVERIFY(nullptr == pointer); } /* On const pointer. Must not mutate the pointer. */ @@ -168,6 +170,9 @@ void tst_QExplicitlySharedDataPointer::data() const /* Check that this cast is possible. */ static_cast<const MyClass *>(pointer.data()); + + QVERIFY(! (pointer == nullptr)); + QVERIFY(! (nullptr == pointer)); } /* On mutatable pointer. Must not mutate the pointer. */ |