diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-11-12 12:56:11 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-11-17 11:47:32 +0100 |
commit | c0e1a38f69cb3bc43649c7a45896b1fcf807279a (patch) | |
tree | d2736a7a7c5599418ba013585da227bdbfc0187e /tests/auto/corelib/tools | |
parent | 30597cfc0ef299356a2d200a5628612d4d0b222c (diff) |
Remove the special code for emplaceFront/Back again
emplace() itself now handles those cases fast enough, so there
should not be a need to add special code paths for those methods.
Change-Id: I3277eb77dd54194e46f96f24de44d7785a6f860a
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.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 3bad143af5..94ed26710f 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -2205,7 +2205,7 @@ void tst_QArrayData::selfEmplaceBackwards() const auto testSelfEmplace = [&](auto dummy, int spaceAtEnd, auto initValues) { auto adp = createDataPointer(100, spaceAtEnd, dummy); for (auto v : initValues) { - adp->emplaceBack(v); + adp->emplace(adp.size, v); } QVERIFY(!adp.freeSpaceAtEnd()); QVERIFY(adp.freeSpaceAtBegin()); @@ -2244,11 +2244,12 @@ void tst_QArrayData::selfEmplaceForward() }; const auto testSelfEmplace = [&](auto dummy, int spaceAtBegin, auto initValues) { - auto adp = createDataPointer(100, spaceAtBegin, dummy); + // need a -1 below as the first emplace will go towards the end (as the array is still empty) + auto adp = createDataPointer(100, spaceAtBegin - 1, dummy); auto reversedInitValues = initValues; std::reverse(reversedInitValues.begin(), reversedInitValues.end()); for (auto v : reversedInitValues) { - adp->emplaceFront(v); + adp->emplace(0, v); } QVERIFY(!adp.freeSpaceAtBegin()); QVERIFY(adp.freeSpaceAtEnd()); |