From 0f1e67051dae0c9b1f23461f7caed594795e8a27 Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Mon, 9 Nov 2015 09:42:42 -0500 Subject: 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 --- autotests/kconfigtest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'autotests/kconfigtest.cpp') 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")); -- cgit v1.2.1