diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-06-13 18:22:27 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-12-08 18:19:38 +0100 |
commit | b42a2b3c3338a320a438bc081cb885fd4547f01f (patch) | |
tree | 80c729495f45bb9db011ed07c3c542f8a2727989 /tests/auto/corelib/tools/qvector/tst_qvector.cpp | |
parent | 3d9bae304cb1fa8f5f6f8854141fc8ecca92a333 (diff) |
Inline the size and begin pointer in QVector
Add QGenericArray to simplify operations. This class can be shared by
other tool classes. If there is nothing else to share it, we can move
the code onto qvector.h. The one candidate is QList.
All tests pass and valgrind is good.
Change-Id: Ieaa80709caf5f50520aa97312ab726396f5475eb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools/qvector/tst_qvector.cpp')
-rw-r--r-- | tests/auto/corelib/tools/qvector/tst_qvector.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp index ed952954cd..7a69e844d4 100644 --- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp +++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp @@ -104,7 +104,7 @@ private: static void check(const State state1, const State state2) { - QCOMPARE(state1, state2); + QCOMPARE(int(state1), int(state2)); } }; @@ -174,7 +174,7 @@ private: { // check if c object has been moved QCOMPARE(c, c->that); - QCOMPARE(c->state, Constructed); + QCOMPARE(int(c->state), int(Constructed)); } }; QAtomicInt Custom::counter = 0; @@ -724,16 +724,12 @@ void tst_QVector::capacity() const myvec.remove(3); myvec.remove(3); myvec.remove(3); - // TODO: is this a safe assumption? presumably it won't release memory until shrink(), but can we asser that is true? - QVERIFY(myvec.capacity() >= 6); myvec.squeeze(); QVERIFY(myvec.capacity() >= 3); myvec.remove(0); myvec.remove(0); myvec.remove(0); - // TODO: as above note - QVERIFY(myvec.capacity() >= 3); myvec.squeeze(); QVERIFY(myvec.capacity() == 0); } |