summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-11-11 13:47:29 +0100
committerLars Knoll <lars.knoll@qt.io>2020-11-17 11:47:13 +0100
commitfaea8e266114abcc9ebd517a552bf7d0e6770575 (patch)
tree7e6034d6c27afc8d7e2fbdc1c09b77f98180853a /tests/auto/corelib/tools
parent39ca7d4bd189645c1b812c1ab3dbfc80a2bdfc33 (diff)
Remove unused code
Change-Id: I22f377c10a556fbb011ec98094d5a61ee3f63867 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp71
1 files changed, 0 insertions, 71 deletions
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<ThrowingType>::isRelocatable);
- using Prims = QtPrivate::QArrayExceptionSafetyPrimitives<ThrowingType>;
- using Mover = typename Prims::Mover;
-
- const auto testMoveLeft = [] (size_t posB, size_t posE) {
- auto data = createDataPointer<ThrowingType>(20, 10);
- auto reference = createDataPointer<ThrowingType>(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<ThrowingType *>(data.end()) - e, data.size);
- while (e != b)
- (--e)->~ThrowingType();
- }
- QCOMPARE(data.size + length, originalSize);
- qsizetype i = 0;
- for (; i < std::distance(static_cast<ThrowingType *>(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<ThrowingType>(20, 10);
- auto reference = createDataPointer<ThrowingType>(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<ThrowingType *>(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<ThrowingType *>(data.begin() + i)) ThrowingType(42);
- ++data.size;
- }
- }
-
- qsizetype i = length;
- for (; i < std::distance(static_cast<ThrowingType *>(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<ThrowingType>::isRelocatable);