aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfigtest.cpp
diff options
context:
space:
mode:
authorMatthew Dawson <matthew@mjdsystems.ca>2015-11-09 09:42:42 -0500
committerMatthew Dawson <matthew@mjdsystems.ca>2015-11-09 09:42:42 -0500
commit0f1e67051dae0c9b1f23461f7caed594795e8a27 (patch)
tree5cf8a52cf505ba7a4448edeb4861470335387bc3 /autotests/kconfigtest.cpp
parent809e7156b21c5cecea68fc474d210d1068372ef9 (diff)
downloadkconfig-0f1e67051dae0c9b1f23461f7caed594795e8a27.tar.gz
kconfig-0f1e67051dae0c9b1f23461f7caed594795e8a27.tar.bz2
In KConfigTest::testEntryMap, convert QByteArray with nulls using a char *
Due to https://codereview.qt-project.org/#/c/106473/, Qt 5.6 keeps null characters in QByteArray -> QString conversions, which breaks this test as one QByteArray contains nulls. Instead, convert the QByteArray to const char * first, so QString stops at the first null. The actual behaviour of KConfig is unchanged, as internally the conversion always went through a const char *, which avoids creating QStrings with null characters. REVIEW: 126001
Diffstat (limited to 'autotests/kconfigtest.cpp')
-rw-r--r--autotests/kconfigtest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp
index 9a299864..e92197f3 100644
--- a/autotests/kconfigtest.cpp
+++ b/autotests/kconfigtest.cpp
@@ -607,7 +607,7 @@ void KConfigTest::testEntryMap()
QVERIFY(!entryMap.contains("stringEntry5"));
QVERIFY(!entryMap.contains("stringEntry6"));
QCOMPARE(entryMap.value("Test"), QString::fromUtf8(UTF8BITENTRY));
- QCOMPARE(entryMap.value("bytearrayEntry"), QString::fromUtf8(BYTEARRAYENTRY));
+ QCOMPARE(entryMap.value("bytearrayEntry"), QString::fromUtf8(BYTEARRAYENTRY.constData()));
QCOMPARE(entryMap.value("emptyEntry"), QString());
QVERIFY(entryMap.contains("emptyEntry"));
QCOMPARE(entryMap.value("boolEntry1"), QString(BOOLENTRY1 ? "true" : "false"));