qt5base-lts/tests/auto/corelib/tools
João Abecasis 5e82bb9e6f Introduce QArrayDataPointer::needsDetach
While QArrayDataPointer offers generic detach() functionality, this is
only useful for operations that may modify data, but don't otherwise
affect the container itself, such as non-const iteration, front() and
back().

For other modifying operations, users of the API typically need to
decide whether a detach is needed based on QArrayData's requirements
(is data mutable? is it currently shared?) and its own (do we have
spare capacity for growth?).

Now that data may be shared, static or otherwise immutable (e.g.,
fromRawData) it no longer suffices to check the ref-count for
isShared().

This commit adds needsDetach() which, from the point-of-view of
QArrayData(Pointer), answers the question: 'Can contained data and
associated metadata be changed?'.

This fixes QArrayDataPointer::setSharable for static data (e.g.,
Q_ARRAY_LITERAL), previously it only catered to shared_null.
SimpleVector is also fixed since it wasn't checking Mutability and it
needs to because it supports fromRawData().

Change-Id: I3c7f9c85c83dfd02333762852fa456208e96d5ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 16:34:21 +02:00
..
qalgorithms Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qarraydata Introduce QArrayDataPointer::needsDetach 2012-04-02 16:34:21 +02:00
qbitarray Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qbytearray Add tests to verify QByteArray's zero termination 2012-03-30 11:21:34 +02:00
qbytearraymatcher Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qcache Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qchar Changed qchar unittest to check return from QFINDTESTDATA 2012-03-01 05:43:39 +01:00
qcontiguouscache Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qcryptographichash Add SHA-224, SHA-256, SHA-384, and SHA-512 support to QCryptographicHash 2012-02-27 22:24:00 +01:00
qdate Eliminate duplicate data row names from corelib autotests. 2012-02-14 06:19:16 +01:00
qdatetime Eliminate duplicate data row names from corelib autotests. 2012-02-14 06:19:16 +01:00
qeasingcurve QEasingCurve: implement move constructor 2012-02-21 15:28:40 +01:00
qelapsedtimer Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qexplicitlyshareddatapointer Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qfreelist Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qhash Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qline Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qlist Merge remote-tracking branch 'origin/master' into api_changes 2012-03-12 21:03:49 +01:00
qlocale Merge master into api_changes 2012-03-27 19:22:48 +02:00
qmap Fix loop conditions, after warnings from clang 2012-03-28 09:36:33 +02:00
qmargins Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qpair QPair: specialise QTypeInfo based on the typeinfos of its arguments 2012-03-01 14:26:06 +01:00
qpoint Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qqueue Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qrect Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qregexp Remove #if 0 sections from QRegExp autotest 2012-03-23 11:45:25 +01:00
qregularexpression QRegularExpression: minor fix to captureIndexForName 2012-03-08 22:00:53 +01:00
qringbuffer Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qscopedpointer Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qscopedvaluerollback Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qset containers: add C++11-style c{begin,end}() as alias for const{Begin,End}() 2012-03-17 09:10:57 +01:00
qsharedpointer tst_qsharedpointer: don't inherit from QSharedPointer 2012-03-23 11:22:40 +01:00
qsize Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qsizef Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qstl Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qstring QRegularExpression: support for QString overloads 2012-03-15 00:37:56 +01:00
qstringbuilder Allow QChar::SpecialCharacter with QStringBuilder. 2012-02-29 14:08:43 +01:00
qstringlist QRegularExpression: support for QStringList overloads 2012-03-21 11:43:30 +01:00
qstringmatcher Eliminate duplicate data row names from corelib autotests. 2012-02-14 06:19:16 +01:00
qstringref Eliminate duplicate data row names from corelib autotests. 2012-02-14 06:19:16 +01:00
qtextboundaryfinder Eliminate duplicate data row names from corelib autotests. 2012-02-14 06:19:16 +01:00
qtime QDateTime: Add validity checks 2012-01-31 04:18:37 +01:00
qtimeline Mark tst_qtimeline as insignificant on Windows 2012-03-15 00:50:47 +01:00
qvarlengtharray Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qvector Merge remote-tracking branch 'gerrit/master' into containers 2012-02-05 21:26:33 +01:00
tools.pro Merge remote-tracking branch 'origin/api_changes' into containters 2012-03-08 12:02:41 +01:00