From 6b8106383228785bf7a184d01f8c9692dd91e6c0 Mon Sep 17 00:00:00 2001 From: Vladimir Belyavsky Date: Wed, 7 Jun 2023 16:38:07 +0300 Subject: QStringBuilder: remove QString/QByteArray specializations This is an improved version of the previous attempt to remove this 3c6c3eccd1f91bd1ae0a518318ef264f8eff63f5. Now we also take into account that concatenation of 2 null stings must also produce null string as a result. Change-Id: I39c270552839b056247c1cce334cef4fa8f1cfdd Reviewed-by: Thiago Macieira --- .../corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests/auto/corelib/text/qstringbuilder') diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp index dc2aa9eb39..a547205460 100644 --- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp +++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp @@ -78,7 +78,7 @@ void checkItWorksWithFreeSpaceAtBegin(const String &chunk, const Separator &sepa } template -void checkNullVsEmpty(const String &empty, const char *failureReason = nullptr) +void checkNullVsEmpty(const String &empty) { String a; String b; @@ -92,12 +92,10 @@ void checkNullVsEmpty(const String &empty, const char *failureReason = nullptr) QVERIFY(!d.isNull()); result = a P d; QVERIFY(result.isEmpty()); - if (failureReason) - QEXPECT_FAIL("", failureReason, Continue); QVERIFY(!result.isNull()); result = a P a P a; - QVERIFY(!result.isNull()); + QVERIFY(result.isNull()); } void runScenario() @@ -381,7 +379,7 @@ void runScenario() // null vs. empty checkNullVsEmpty(QStringLiteral("")); - checkNullVsEmpty(QByteArrayLiteral(""), "QTBUG-114238: inconsistent isEmpty/isNull between QString and QByteArray concatenation"); + checkNullVsEmpty(QByteArrayLiteral("")); checkItWorksWithFreeSpaceAtBegin(QByteArray(UTF8_LITERAL), "1234"); if (QTest::currentTestFailed()) -- cgit v1.2.3