diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-22 22:04:01 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-02-14 13:20:03 +0100 |
commit | 40e2bf3495a2f697848f889a4a547026908ec224 (patch) | |
tree | ca0713480213821c10e4e7fd61a2bb2e063672a2 /tests/auto/corelib/tools | |
parent | c37d0e84bc4e6bc9840190eaf73f5a39fbfa0b1d (diff) |
QFlatMap: temporarily disable some code
... which implements or assumes something about the
broken^Wnon-STL-compliant insertion behavior.
Once this has integrated into all module dependencies, we can
re-implement these APIs using STL-compatible semantics.
Task-number: QTBUG-100092
Change-Id: I54f4f5ce7addd9543866d2c399f48aff50983b88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp b/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp index 11448b33cb..8674734a11 100644 --- a/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp +++ b/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp @@ -44,9 +44,11 @@ class tst_QFlatMap : public QObject { Q_OBJECT private slots: +#ifdef QFLATMAP_TEMPORARILY_REMOVED void constructing(); void constAccess(); void insertion(); +#endif void insertRValuesAndLValues(); void removal(); void extraction(); @@ -63,6 +65,7 @@ private: void transparency_impl(); }; +#ifdef QFLATMAP_TEMPORARILY_REMOVED void tst_QFlatMap::constructing() { using Map = QFlatMap<int, QByteArray>; @@ -164,9 +167,11 @@ void tst_QFlatMap::insertion() QCOMPARE(m.value("narf").data(), "NARFFFFFF"); QCOMPARE(m.value("gnampf").data(), "GNAMPF"); } +#endif void tst_QFlatMap::insertRValuesAndLValues() { +#ifdef QFLATMAP_TEMPORARILY_REMOVED using Map = QFlatMap<QByteArray, QByteArray>; const QByteArray foo = QByteArrayLiteral("foo"); const QByteArray bar = QByteArrayLiteral("bar"); @@ -199,6 +204,7 @@ void tst_QFlatMap::insertRValuesAndLValues() } #undef lvalue +#endif } void tst_QFlatMap::extraction() @@ -206,7 +212,7 @@ void tst_QFlatMap::extraction() using Map = QFlatMap<int, QByteArray>; Map::key_container_type expectedKeys = { 1, 2, 3 }; Map::mapped_container_type expectedValues = { "een", "twee", "dree" }; - Map m(expectedKeys, expectedValues); + Map m(Qt::OrderedUniqueRange, expectedKeys, expectedValues); auto keys = m.keys(); auto values = m.values(); QCOMPARE(keys, expectedKeys); @@ -219,7 +225,7 @@ void tst_QFlatMap::extraction() void tst_QFlatMap::iterators() { using Map = QFlatMap<int, QByteArray>; - auto m = Map{ { 1, "foo" }, { 2, "bar" }, { 3, "baz" } }; + auto m = Map{ Qt::OrderedUniqueRange, { { 1, "foo" }, { 2, "bar" }, { 3, "baz" } } }; { // forward / backward Map::iterator a = m.begin(); @@ -365,6 +371,7 @@ void tst_QFlatMap::iterators() void tst_QFlatMap::removal() { +#ifdef QFLATMAP_TEMPORARILY_REMOVED using Map = QFlatMap<int, QByteArray>; Map m({ { 2, "bar" }, { 3, "baz" }, { 1, "foo" } }); QCOMPARE(m.value(2).data(), "bar"); @@ -387,10 +394,12 @@ void tst_QFlatMap::removal() it = m.erase(it); QCOMPARE(it.key(), 2); QVERIFY(!m.contains(1)); +#endif } void tst_QFlatMap::statefulComparator() { +#ifdef QFLATMAP_TEMPORARILY_REMOVED struct CountingCompare { mutable int count = 0; @@ -408,6 +417,7 @@ void tst_QFlatMap::statefulComparator() QCOMPARE(m2.key_comp().count, m1.key_comp().count); m2.insert(m1.begin(), m1.end()); QVERIFY(m2.key_comp().count > m1.key_comp().count); +#endif } void tst_QFlatMap::transparency_using() @@ -439,6 +449,7 @@ void tst_QFlatMap::transparency_struct() template <typename StringViewCompare> void tst_QFlatMap::transparency_impl() { +#ifdef QFLATMAP_TEMPORARILY_REMOVED using Map = QFlatMap<QString, QString, StringViewCompare>; auto m = Map{ { "one", "een" }, { "two", "twee" }, { "three", "dree" } }; @@ -462,6 +473,7 @@ void tst_QFlatMap::transparency_impl() QVERIFY(m.contains(QLatin1String("one"))); QVERIFY(m.remove(QAnyStringView(u8"one"))); QVERIFY(!m.contains(QLatin1String("one"))); +#endif } void tst_QFlatMap::try_emplace_and_insert_or_assign() @@ -608,6 +620,7 @@ void tst_QFlatMap::try_emplace_and_insert_or_assign() void tst_QFlatMap::viewIterators() { +#ifdef QFLATMAP_TEMPORARILY_REMOVED using Map = QFlatMap<QByteArray, QByteArray>; Map m({ { "yksi", "een"}, { "kaksi", "twee" }, { "kolme", "dree" } }); { @@ -652,13 +665,14 @@ void tst_QFlatMap::viewIterators() it--; QCOMPARE(*it, "dree"); } +#endif } void tst_QFlatMap::varLengthArray() { using Map = QVarLengthFlatMap<int, QByteArray, 1024>; - Map m{ { 2, "twee" } }; - m.insert(1, "een"); + Map m(Qt::OrderedUniqueRange, { { 2, "twee" } }); + m.insert_or_assign(1, "een"); m.remove(1); QVERIFY(!m.isEmpty()); m.remove(2); |