summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-11-16 23:25:26 +0100
committerLars Knoll <lars.knoll@qt.io>2020-07-06 21:29:58 +0200
commit76004502baa118016c8e0f32895af7a822f1ba37 (patch)
tree3fb524e333cb2edf6e983c4898c76f9eebb04eb4 /tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
parent2e51686746c45055e5bb74f58e0c159bfb6a8c13 (diff)
Get rid of shared null for QByteArray, QString and QVector
As a side effect, data() can now return a nullptr. This has the potential to cause crashes in existig code. To work around this, return an empty string from QString::data() and QByteArray::data() for now. For Qt 6 (and once all our internal issues are fixed), data() will by default return a nullptr for a null QString, but we'll offer a #define to enable backwards compatible behavior. Change-Id: I4f66d97ff1dce3eb99a239f1eab9106fa9b1741a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp')
-rw-r--r--tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
index 73d9f8e765..940865b98e 100644
--- a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
@@ -2277,7 +2277,7 @@ void tst_QByteArray::literals()
QVERIFY(str.length() == 4);
QCOMPARE(str.capacity(), 0);
QVERIFY(str == "abcd");
- QVERIFY(str.data_ptr()->isStatic());
+ QVERIFY(!str.data_ptr()->isMutable());
const char *s = str.constData();
QByteArray str2 = str;