summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qarraydata/simplevector.h
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2020-07-07 18:51:27 +0300
committerAndrei Golubev <andrei.golubev@qt.io>2020-08-18 12:55:38 +0200
commit48911869cb06c96ba76874303b9a49743eb1c4f8 (patch)
tree934870104c86f8cd41281021bff6440a1548e3d9 /tests/auto/corelib/tools/qarraydata/simplevector.h
parentf4f45578358a193e3eed59a440550e3f87a73181 (diff)
Extend array operations tests with extra cases
Extended existing tests with QArrayData's allocation options Added extra tests on array operations covering append, insert, emplace, erase and truncate. "Raw" QArrayDataPointer is used instead of test-specific SimpleVector to check the behavior without some custom logic in-between The change targets future updates to array operations in the light of prepend optimization: as the array operations would become more complex, these tests should give a much better coverage (specifically due to likely non-trivial implementation details and optimizations) Task-number: QTBUG-84320 Change-Id: I6581e2cb48f81b82ee5052d1dcea3da2819df47a Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools/qarraydata/simplevector.h')
-rw-r--r--tests/auto/corelib/tools/qarraydata/simplevector.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/corelib/tools/qarraydata/simplevector.h b/tests/auto/corelib/tools/qarraydata/simplevector.h
index 6be785a628..13c859edd9 100644
--- a/tests/auto/corelib/tools/qarraydata/simplevector.h
+++ b/tests/auto/corelib/tools/qarraydata/simplevector.h
@@ -50,22 +50,22 @@ public:
{
}
- explicit SimpleVector(size_t n)
- : d(Data::allocate(n))
+ explicit SimpleVector(size_t n, typename Data::ArrayOptions f = Data::DefaultAllocationFlags)
+ : d(Data::allocate(n, f))
{
if (n)
d->appendInitialize(n);
}
- SimpleVector(size_t n, const T &t)
- : d(Data::allocate(n))
+ SimpleVector(size_t n, const T &t, typename Data::ArrayOptions f = Data::DefaultAllocationFlags)
+ : d(Data::allocate(n, f))
{
if (n)
d->copyAppend(n, t);
}
- SimpleVector(const T *begin, const T *end)
- : d(Data::allocate(end - begin))
+ SimpleVector(const T *begin, const T *end, typename Data::ArrayOptions f = Data::DefaultAllocationFlags)
+ : d(Data::allocate(end - begin, f))
{
if (end - begin)
d->copyAppend(begin, end);