diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-19 17:40:56 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-19 19:01:31 +0100 |
commit | cef009b1e4d3a3f8108a9f17e8c01e7140a587b4 (patch) | |
tree | c51a2317735dc126fb14f334f7b9453c2ccd5c9b /tests/auto/corelib/tools | |
parent | f5fd9c40cd2db59e2f4eb0f588407658d8a161e6 (diff) |
Change QTaggedPointer API to be more similar to other smart pointers in Qt
* Rename pointer() to data()
Change-Id: I8ef3e552d45c9990fee4b7efa98e2d878ed2cf98
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qtaggedpointer/tst_qtaggedpointer.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/corelib/tools/qtaggedpointer/tst_qtaggedpointer.cpp b/tests/auto/corelib/tools/qtaggedpointer/tst_qtaggedpointer.cpp index d98a53098f..6a7a7c7ec8 100644 --- a/tests/auto/corelib/tools/qtaggedpointer/tst_qtaggedpointer.cpp +++ b/tests/auto/corelib/tools/qtaggedpointer/tst_qtaggedpointer.cpp @@ -50,24 +50,24 @@ void tst_QTaggedPointer::construction() { { QTaggedPointer<int> p; - QCOMPARE(p.pointer(), nullptr); + QCOMPARE(p.data(), nullptr); QVERIFY(!p.tag()); } { QTaggedPointer<int> p(nullptr, 0x1); - QCOMPARE(p.pointer(), nullptr); + QCOMPARE(p.data(), nullptr); QCOMPARE(p.tag(), quintptr(0x1)); } { QScopedPointer<int> rawPointer(new int(5)); QTaggedPointer<int> p(rawPointer.data()); - QCOMPARE(p.pointer(), rawPointer.data()); + QCOMPARE(p.data(), rawPointer.data()); QVERIFY(!p.tag()); } { QScopedPointer<int> rawPointer(new int(5)); QTaggedPointer<int> p(rawPointer.data(), 0x1); - QCOMPARE(p.pointer(), rawPointer.data()); + QCOMPARE(p.data(), rawPointer.data()); QCOMPARE(p.tag(), quintptr(0x1)); } } @@ -328,7 +328,7 @@ void tst_QTaggedPointer::tag() { QScopedPointer<int> rawPointer(new int(3)); QTaggedPointer<int> p(rawPointer.data()); - QCOMPARE(*p.pointer(), 3); + QCOMPARE(*p.data(), 3); QVERIFY(!p.tag()); p.setTag(0x1); @@ -356,11 +356,11 @@ void tst_QTaggedPointer::objectMember() f.p = QTaggedPointer<int>(rawPointer.data(), 0x1); Foo f2(f); - QCOMPARE(f2.p.pointer(), f.p.pointer()); + QCOMPARE(f2.p.data(), f.p.data()); QCOMPARE(f2.p.tag(), f.p.tag()); Foo f3 = f; - QCOMPARE(f3.p.pointer(), f.p.pointer()); + QCOMPARE(f3.p.data(), f.p.data()); QCOMPARE(f3.p.tag(), f.p.tag()); } @@ -411,7 +411,7 @@ struct LinkedListItem ~LinkedListItem() { - delete next.pointer(); + delete next.data(); } }; |