qt5base-lts/tests/auto/corelib/tools/qbytearray
Bradley T. Hughes a219b8f382 Fix QString and QByteArray reserve() and squeeze()
These functions should not take care not to unconditionally set the
capacityReserved private member, since the d may be referencing the
const shared_null or shared_empty which live in read-only memory.

The squeeze() methods check for ref > 1 instead of ref != 1 to prevent
detaching from the shared_null/shared_empty unnecessarily; the
shared_null/shared_empty ref count is -1, meaning squeeze() will never
detach from it.

Change-Id: Id3f1725a6f08b3a462343640a47bbe78f08ca7e7
Rubberstamped-by: Lars Knoll
Reviewed-on: http://codereview.qt-project.org/5454
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-23 13:42:22 +02:00
..
.gitattributes Moving relevant tests to corelib/tools 2011-09-01 13:07:23 +02:00
.gitignore Moving relevant tests to corelib/tools 2011-09-01 13:07:23 +02:00
qbytearray.pro Moving relevant tests to corelib/tools 2011-09-01 13:07:23 +02:00
rfc3252.txt Moving relevant tests to corelib/tools 2011-09-01 13:07:23 +02:00
tst_qbytearray.cpp Fix QString and QByteArray reserve() and squeeze() 2011-09-23 13:42:22 +02:00