From faea8e266114abcc9ebd517a552bf7d0e6770575 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 11 Nov 2020 13:47:29 +0100 Subject: Remove unused code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I22f377c10a556fbb011ec98094d5a61ee3f63867 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Andrei Golubev Reviewed-by: Thiago Macieira --- .../corelib/tools/qarraydata/tst_qarraydata.cpp | 71 ---------------------- 1 file changed, 71 deletions(-) (limited to 'tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp') diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index d9a964ee96..a5d2967c4a 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -86,7 +86,6 @@ private slots: void selfEmplaceForward(); #ifndef QT_NO_EXCEPTIONS void exceptionSafetyPrimitives_constructor(); - void exceptionSafetyPrimitives_mover(); void exceptionSafetyPrimitives_displacer(); #endif }; @@ -2506,76 +2505,6 @@ void tst_QArrayData::exceptionSafetyPrimitives_constructor() } } -void tst_QArrayData::exceptionSafetyPrimitives_mover() -{ - QVERIFY(QTypeInfo::isRelocatable); - using Prims = QtPrivate::QArrayExceptionSafetyPrimitives; - using Mover = typename Prims::Mover; - - const auto testMoveLeft = [] (size_t posB, size_t posE) { - auto data = createDataPointer(20, 10); - auto reference = createDataPointer(20, 10); - - ThrowingType *b = data.begin() + posB; - ThrowingType *e = data.begin() + posE; - const auto originalSize = data.size; - const auto length = std::distance(b, e); - { - Mover mover(e, static_cast(data.end()) - e, data.size); - while (e != b) - (--e)->~ThrowingType(); - } - QCOMPARE(data.size + length, originalSize); - qsizetype i = 0; - for (; i < std::distance(static_cast(data.begin()), b); ++i) - QCOMPARE(data.data()[i], reference.data()[i]); - for (; i < data.size; ++i) - QCOMPARE(data.data()[i], reference.data()[i + length]); - }; - - const auto testMoveRight = [] (size_t posB, size_t posE) { - auto data = createDataPointer(20, 10); - auto reference = createDataPointer(20, 10); - - ThrowingType *begin = data.begin(); - ThrowingType *b = data.begin() + posB; - ThrowingType *e = data.begin() + posE; - const auto originalSize = data.size; - const auto length = std::distance(b, e); - { - Mover mover(begin, b - static_cast(data.begin()), data.size); - while (b != e) { - ++begin; - (b++)->~ThrowingType(); - } - } - QCOMPARE(data.size + length, originalSize); - - // restore original data size - { - for (qsizetype i = 0; i < length; ++i) { - new (static_cast(data.begin() + i)) ThrowingType(42); - ++data.size; - } - } - - qsizetype i = length; - for (; i < std::distance(static_cast(data.begin()), e); ++i) - QCOMPARE(data.data()[i], reference.data()[i - length]); - for (; i < data.size; ++i) - QCOMPARE(data.data()[i], reference.data()[i]); - }; - - // normal move left - RUN_TEST_FUNC(testMoveLeft, 2, 4); - // no move left - RUN_TEST_FUNC(testMoveLeft, 2, 2); - // normal move right - RUN_TEST_FUNC(testMoveRight, 3, 5); - // no move right - RUN_TEST_FUNC(testMoveRight, 4, 4); -} - void tst_QArrayData::exceptionSafetyPrimitives_displacer() { QVERIFY(QTypeInfo::isRelocatable); -- cgit v1.2.3