diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/tools/qarraydata/simplevector.h | 2 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/corelib/tools/qarraydata/simplevector.h b/tests/auto/corelib/tools/qarraydata/simplevector.h index b5308e2231..f3e3a1bb50 100644 --- a/tests/auto/corelib/tools/qarraydata/simplevector.h +++ b/tests/auto/corelib/tools/qarraydata/simplevector.h @@ -90,7 +90,7 @@ public: bool isSharedWith(const SimpleVector &other) const { return d == other.d; } size_t size() const { return d->size; } - size_t capacity() const { return d->alloc; } + size_t capacity() const { return d->allocatedCapacity(); } iterator begin() { detach(); return d->begin(); } iterator end() { detach(); return d->end(); } diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 1a043f7797..23ea417481 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -154,10 +154,10 @@ void tst_QArrayData::sharedNullEmpty() QVERIFY(null != empty); QCOMPARE(null->size, 0); - QCOMPARE(null->alloc, 0u); + QCOMPARE(null->allocatedCapacity(), size_t(0)); QCOMPARE(empty->size, 0); - QCOMPARE(empty->alloc, 0u); + QCOMPARE(empty->allocatedCapacity(), size_t(0)); } void tst_QArrayData::staticData() @@ -597,9 +597,9 @@ void tst_QArrayData::allocate() QCOMPARE(data->size, 0); if (allocateOptions & QArrayData::GrowsForward) - QVERIFY(data->alloc > uint(capacity)); + QVERIFY(data->allocatedCapacity() > uint(capacity)); else - QCOMPARE(data->alloc, uint(capacity)); + QCOMPARE(data->allocatedCapacity(), size_t(capacity)); QCOMPARE(bool(data->flags & QArrayData::CapacityReserved), isCapacityReserved); // Check that the allocated array can be used. Best tested with a @@ -642,9 +642,9 @@ void tst_QArrayData::reallocate() QCOMPARE(data->size, capacity); if (allocateOptions & QArrayData::GrowsForward) - QVERIFY(data->alloc > uint(newCapacity)); + QVERIFY(data->allocatedCapacity() > size_t(newCapacity)); else - QCOMPARE(data->alloc, uint(newCapacity)); + QCOMPARE(data->allocatedCapacity(), size_t(newCapacity)); QCOMPARE(!(data->flags & QArrayData::CapacityReserved), !isCapacityReserved); for (int i = 0; i < capacity; ++i) @@ -684,7 +684,7 @@ void tst_QArrayData::alignment() QVERIFY(data); QCOMPARE(data->size, 0); - QVERIFY(data->alloc >= uint(8)); + QVERIFY(data->allocatedCapacity() >= uint(8)); // These conditions should hold as long as header and array are // allocated together @@ -756,7 +756,7 @@ void tst_QArrayData::typedData() QVERIFY(array); QCOMPARE(array->size, 0); - QCOMPARE(array->alloc, 10u); + QCOMPARE(array->allocatedCapacity(), size_t(10)); // Check that the allocated array can be used. Best tested with a // memory checker, such as valgrind, running. @@ -776,7 +776,7 @@ void tst_QArrayData::typedData() QVERIFY(array); QCOMPARE(array->size, 0); - QCOMPARE(array->alloc, 10u); + QCOMPARE(array->allocatedCapacity(), size_t(10)); // Check that the allocated array can be used. Best tested with a // memory checker, such as valgrind, running. @@ -796,7 +796,7 @@ void tst_QArrayData::typedData() QVERIFY(array); QCOMPARE(array->size, 0); - QCOMPARE(array->alloc, 10u); + QCOMPARE(array->allocatedCapacity(), size_t(10)); // Check that the allocated array can be used. Best tested with a // memory checker, such as valgrind, running. |