diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2020-08-27 22:10:53 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2020-09-10 17:31:23 +0200 |
commit | ec7e680c5007345c34542a57bd2ac344fb112063 (patch) | |
tree | d246b9bb323acaf844a650dae6929d27fa68f386 /tests/auto/corelib/text | |
parent | 04d78df344c341b6a13d4cbe0162ed20e828c88a (diff) |
Remove '\0' space reservation logic in QString
Changed QString to use implicit element reserved by QArrayData
Task-number: QTBUG-84320
Change-Id: If517500b3f0e71bb8d2989c64815a634aa8dd554
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/text')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index ad59025dfe..319d429c10 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -4822,7 +4822,8 @@ void tst_QString::capacity() s2 = s1; // share again s2.reserve( res * 2 ); QVERIFY( (int)s2.capacity() >= res * 2 ); - QVERIFY(s2.constData() != s1.constData()); + if (res != 0) // can both point to QString::_empty when empty + QVERIFY(s2.constData() != s1.constData()); QCOMPARE( s2, s1 ); // don't share again -- s2 must be detached for squeeze() to do anything |