From b9d0fd3a09c23b410bb8ef228ff5326d118f3069 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 15 Apr 2021 18:46:45 +0200 Subject: [PATCH] tst_qcborstreamwriter: don't pass char8_t strings to QByteArray There isn't a QByteArray constructor taking a char8_t*. (I am not sure if there should be one; QByteArray is not going to anything special about that information anyways.) Change such strings to be "ordinary" narrow string literals. There should be no problems at doing so, as by default we build in UTF-8 mode under all compilers. Pick-to: 6.1 6.0 Change-Id: Ia200ec6e3b0453bad033d5d8ff34c013bb27abd1 Reviewed-by: Thiago Macieira --- .../serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp b/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp index cf717aaad5d..b32a2b4d73c 100644 --- a/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp +++ b/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp @@ -193,7 +193,7 @@ void tst_QCborStreamWriter::nonAsciiStrings_data() QTest::addColumn("input"); QTest::addColumn("isLatin1"); - QByteArray latin1 = u8"Résumé"; + QByteArray latin1 = "Résumé"; QTest::newRow("shortlatin1") << ("\x68" + latin1) << QString::fromUtf8(latin1) << true; @@ -202,7 +202,7 @@ void tst_QCborStreamWriter::nonAsciiStrings_data() QTest::newRow("longlatin1") << ("\x78\x28" + latin1) << QString::fromUtf8(latin1) << true; - QByteArray nonlatin1 = u8"Χαίρετε"; + QByteArray nonlatin1 = "Χαίρετε"; QTest::newRow("shortnonlatin1") << ("\x6e" + nonlatin1) << QString::fromUtf8(nonlatin1) << false;