From d273076b4474bb473d90e996960c4c773745761a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 10 May 2019 10:51:14 +0200 Subject: Get rid of unsharable containers The support for unsharable containers has been deprecated since Qt 5.3.0, so let's finally remove support for them. Change-Id: I9be31f55208ae4750e8020b10b6e4ad7e8fb3e0e Reviewed-by: Simon Hausmann --- tests/auto/corelib/tools/qmap/tst_qmap.cpp | 63 ------------------------------ 1 file changed, 63 deletions(-) (limited to 'tests/auto/corelib/tools/qmap') diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index d66fd28779..c644555235 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -68,7 +68,6 @@ private slots: void const_shared_null(); void equal_range(); - void setSharable(); void insert(); void checkMostLeftNode(); @@ -1065,13 +1064,6 @@ void tst_QMap::qmultimap_specific() void tst_QMap::const_shared_null() { QMap map2; -#if !defined(QT_NO_UNSHARABLE_CONTAINERS) - QMap map1; - map1.setSharable(false); - QVERIFY(map1.isDetached()); - - map2.setSharable(true); -#endif QVERIFY(!map2.isDetached()); } @@ -1160,61 +1152,6 @@ const T &const_(const T &t) return t; } -void tst_QMap::setSharable() -{ -#if !defined(QT_NO_UNSHARABLE_CONTAINERS) - QMap map; - - map.insert(1, "um"); - map.insert(2, "dois"); - map.insert(4, "quatro"); - map.insert(5, "cinco"); - - map.setSharable(true); - QCOMPARE(map.size(), 4); - QCOMPARE(const_(map)[4], QString("quatro")); - - { - QMap copy(map); - - QVERIFY(!map.isDetached()); - QVERIFY(copy.isSharedWith(map)); - sanityCheckTree(copy, __LINE__); - } - - map.setSharable(false); - sanityCheckTree(map, __LINE__); - QVERIFY(map.isDetached()); - QCOMPARE(map.size(), 4); - QCOMPARE(const_(map)[4], QString("quatro")); - - { - QMap copy(map); - - QVERIFY(map.isDetached()); - QVERIFY(copy.isDetached()); - - QCOMPARE(copy.size(), 4); - QCOMPARE(const_(copy)[4], QString("quatro")); - - QCOMPARE(map, copy); - sanityCheckTree(map, __LINE__); - sanityCheckTree(copy, __LINE__); - } - - map.setSharable(true); - QCOMPARE(map.size(), 4); - QCOMPARE(const_(map)[4], QString("quatro")); - - { - QMap copy(map); - - QVERIFY(!map.isDetached()); - QVERIFY(copy.isSharedWith(map)); - } -#endif -} - void tst_QMap::insert() { QMap map; -- cgit v1.2.3