tst_QXmlStream: remove unneeded _ba UDLs

... and collapse adjacent C string literals.

Both QStringBuilder and non-QStringBuilder builds have no problem
resolving an operator+ for char[] and QByteArray, so there's no need
to turn the char[] into a QByteArray using the _ba UDL first.

It just causes pain because not all active branches support this UDL,
so remove, to bring this code in line with what the cherry-picks to
6.2 and 5.15 must needs had to use.

Amends 6326bec46a618c72feba4a2bb994c4d475050aed.

Change-Id: Id3d61483729c51c82f58b826efcc8fc7960c3ccd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 3bc3b8d69a291aa513d2d120c8ef46f968f1efdf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-06-28 08:27:42 +02:00 committed by Qt Cherry-pick Bot
parent f0feeb8486
commit 0714ab7db5

View File

@ -1837,19 +1837,19 @@ void tst_QXmlStream::test_fastScanName_data() const
// 4096 is the limit in QXmlStreamReaderPrivate::fastScanName()
QByteArray arr = "<a"_ba + ":" + QByteArray("b").repeated(4096 - 1);
QByteArray arr = "<a:" + QByteArray("b").repeated(4096 - 1);
QTest::newRow("data1") << arr << QXmlStreamReader::PrematureEndOfDocumentError;
arr = "<a"_ba + ":" + QByteArray("b").repeated(4096);
arr = "<a:" + QByteArray("b").repeated(4096);
QTest::newRow("data2") << arr << QXmlStreamReader::NotWellFormedError;
arr = "<"_ba + QByteArray("a").repeated(4000) + ":" + QByteArray("b").repeated(96);
arr = "<" + QByteArray("a").repeated(4000) + ":" + QByteArray("b").repeated(96);
QTest::newRow("data3") << arr << QXmlStreamReader::PrematureEndOfDocumentError;
arr = "<"_ba + QByteArray("a").repeated(4000) + ":" + QByteArray("b").repeated(96 + 1);
arr = "<" + QByteArray("a").repeated(4000) + ":" + QByteArray("b").repeated(96 + 1);
QTest::newRow("data4") << arr << QXmlStreamReader::NotWellFormedError;
arr = "<"_ba + QByteArray("a").repeated(4000 + 1) + ":" + QByteArray("b").repeated(96);
arr = "<" + QByteArray("a").repeated(4000 + 1) + ":" + QByteArray("b").repeated(96);
QTest::newRow("data5") << arr << QXmlStreamReader::NotWellFormedError;
}