summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-06-04 22:31:26 +0200
committerLars Knoll <lars.knoll@qt.io>2019-12-07 14:18:19 +0100
commitf6a151024b03158bcf46dc86e346d4227f8ca9d4 (patch)
tree898bbc0be052034801a5269bdd291de09766bd95 /tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
parent8fb45ae5b8b8ad276aeb9bc9e40f351f47523087 (diff)
Introduce flags to indicate the QArrayData type
These flags allow us to determine what type of data QArrayData is carrying. There are currently only two supported types: - raw data type: constructed via fromRawData or static data - allocated data type: regular data done via heap allocation The QArrayData object is usually allocated on the heap, unless its own reference count is -1 (indicating static const QArrayData). Such object should have a type of RawDataType, since we can't call free(). Add GrowsBackward for completeness as well as the StaticDataFlags default for static data. Change-Id: Icc915a468a2acf2eae91a94e82451f852d382c92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp')
-rw-r--r--tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
index 23ea417481..d86f9f25d3 100644
--- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
+++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
@@ -84,7 +84,7 @@ void tst_QArrayData::referenceCounting()
{
{
// Reference counting initialized to 1 (owned)
- QArrayData array = { { Q_BASIC_ATOMIC_INITIALIZER(1) }, 0, 0, 0, 0 };
+ QArrayData array = { { Q_BASIC_ATOMIC_INITIALIZER(1) }, QArrayData::DefaultRawFlags, 0, 0, 0 };
QCOMPARE(array.ref.atomic.loadRelaxed(), 1);
@@ -107,10 +107,9 @@ void tst_QArrayData::referenceCounting()
// Now would be a good time to free/release allocated data
}
-
{
// Reference counting initialized to -1 (static read-only data)
- QArrayData array = { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, 0, 0 };
+ QArrayData array = { Q_REFCOUNT_INITIALIZE_STATIC, QArrayData::StaticDataFlags, 0, 0, 0 };
QCOMPARE(array.ref.atomic.loadRelaxed(), -1);
@@ -186,7 +185,7 @@ void tst_QArrayData::staticData()
void tst_QArrayData::simpleVector()
{
- QArrayData data0 = { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, 0, 0 };
+ QArrayData data0 = { Q_REFCOUNT_INITIALIZE_STATIC, QArrayData::StaticDataFlags, 0, 0, 0 };
QStaticArrayData<int, 7> data1 = {
Q_STATIC_ARRAY_DATA_HEADER_INITIALIZER(int, 7),
{ 0, 1, 2, 3, 4, 5, 6 }