diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 16 | ||||
-rw-r--r-- | tests/auto/other/toolsupport/tst_toolsupport.cpp | 4 |
2 files changed, 9 insertions, 11 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index 01376036b7..ad31f9cefc 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -608,8 +608,7 @@ QString verifyZeroTermination(const QString &str) QString::DataPtr strDataPtr = const_cast<QString &>(str).data_ptr(); // Skip if isStatic() or fromRawData(), as those offer no guarantees - if (strDataPtr->isStatic() - || strDataPtr->offset != QString().data_ptr()->offset) + if (strDataPtr.d->isStatic() || !strDataPtr.d->isMutable()) return str; int strSize = str.size(); @@ -620,7 +619,7 @@ QString verifyZeroTermination(const QString &str) .arg(strTerminator.unicode(), 4, 16, QChar('0')); // Skip mutating checks on shared strings - if (strDataPtr->isShared()) + if (strDataPtr.d->isShared()) return str; const QChar *strData = str.constData(); @@ -4070,12 +4069,12 @@ void tst_QString::setRawData() QVERIFY(cstr == QString(ptr, 1)); // This actually tests the recycling of the shared data object - QString::DataPtr csd = cstr.data_ptr(); + void *csd = cstr.data_ptr().d; cstr.setRawData(ptr2, 1); QVERIFY(cstr.isDetached()); QVERIFY(cstr.constData() == ptr2); QVERIFY(cstr == QString(ptr2, 1)); - QVERIFY(cstr.data_ptr() == csd); + QVERIFY(cstr.data_ptr().d == csd); // This tests the discarding of the shared data object cstr = "foo"; @@ -4083,12 +4082,12 @@ void tst_QString::setRawData() QVERIFY(cstr.constData() != ptr2); // Another test of the fallback - csd = cstr.data_ptr(); + csd = cstr.data_ptr().d; cstr.setRawData(ptr2, 1); QVERIFY(cstr.isDetached()); QVERIFY(cstr.constData() == ptr2); QVERIFY(cstr == QString(ptr2, 1)); - QVERIFY(cstr.data_ptr() != csd); + QVERIFY(cstr.data_ptr().d != csd); } void tst_QString::fromStdString() @@ -6637,8 +6636,7 @@ void tst_QString::literals() QVERIFY(str.length() == 4); QVERIFY(str == QLatin1String("abcd")); - QVERIFY(str.data_ptr()->isStatic()); - QVERIFY(str.data_ptr()->offset == sizeof(QStringData)); + QVERIFY(str.data_ptr().d->isStatic()); const QChar *s = str.constData(); QString str2 = str; diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp index 2440b4a5e9..9591eca16a 100644 --- a/tests/auto/other/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp @@ -126,9 +126,9 @@ void tst_toolsupport::offsets_data() #ifdef Q_PROCESSOR_X86 // x86 32-bit has weird alignment rules. Refer to QtPrivate::AlignOf in // qglobal.h for more details. - data << 176 << 272; + data << 184 << 288; #else - data << 180 << 272; + data << 188 << 288; #endif } #endif |