diff options
Diffstat (limited to 'tests/auto/corelib/text/qstring/tst_qstring.cpp')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index 8af644d012..cefcd4f2e5 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -6543,18 +6543,22 @@ void tst_QString::literals() QString str(QStringLiteral("abcd")); QVERIFY(str.length() == 4); + QCOMPARE(str.capacity(), 0); QVERIFY(str == QLatin1String("abcd")); QVERIFY(str.data_ptr()->isStatic()); const QChar *s = str.constData(); QString str2 = str; QVERIFY(str2.constData() == s); + QCOMPARE(str2.capacity(), 0); // detach on non const access QVERIFY(str.data() != s); + QVERIFY(str.capacity() >= str.length()); QVERIFY(str2.constData() == s); QVERIFY(str2.data() != s); + QVERIFY(str2.capacity() >= str2.length()); } #endif |