qt5base-lts/tests/auto/corelib
Marc Mutz a7885c9756 QVector: preserve capacity in clear()
This is what std::vector implementations usually do,
because it minimizes memory fragmentation and useless
allocations since no user will call clear() unless
she intends to append new data afterwards.

Fix calls to resize(0) that show how existing code
tried to work around the issue.

Adjust test. Port from QVERIFY(==) to QCOMPARE as a
drive-by.

[ChangeLog][QtCore][QVector] clear() now preserves
capacity. To shed capacity, call squeeze() or swap
with a default-constructed QVector object, see the
documentation for an example.

Change-Id: I9cebe611a97e027a89e821e64408a4741b31f1f6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-29 07:57:47 +00:00
..
animation Updated license headers 2016-01-21 18:55:18 +00:00
codecs Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
global Add qOverload to select overloaded functions 2016-02-15 12:33:24 +00:00
io Merge remote-tracking branch 'origin/5.6' into 5.7 2016-02-18 20:50:35 +01:00
itemmodels Updated license headers 2016-01-21 18:55:18 +00:00
json Update testdata 2016-02-17 04:50:50 +00:00
kernel Fix warnings about constructor initialization order in tst_QObject. 2016-02-26 17:37:32 +00:00
mimetypes Updated license headers 2016-01-21 18:55:18 +00:00
plugin Merge remote-tracking branch 'origin/5.6' into dev 2016-02-02 15:57:44 +01:00
statemachine Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
thread Add Intel copyright to files that Intel has had non-trivial contribution 2016-01-21 22:44:21 +00:00
tools QVector: preserve capacity in clear() 2016-02-29 07:57:47 +00:00
xml Updated license headers 2016-01-21 18:55:18 +00:00
corelib.pro iOS: Enable building of basic tests 2014-01-22 12:35:17 +01:00