summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp')
-rw-r--r--tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
index e3009a78fb..67259c04dc 100644
--- a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
@@ -2271,18 +2271,22 @@ void tst_QByteArray::literals()
QByteArray str(QByteArrayLiteral("abcd"));
QVERIFY(str.length() == 4);
+ QCOMPARE(str.capacity(), 0);
QVERIFY(str == "abcd");
QVERIFY(str.data_ptr()->isStatic());
const char *s = str.constData();
QByteArray 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());
}
void tst_QByteArray::toUpperLower_data()