qt 6.6.0 clean

This commit is contained in:
kleuter
2023-11-01 22:23:55 +01:00
parent 7b5ada15e7
commit 5d8194efa7
1449 changed files with 134276 additions and 31391 deletions

View File

@ -77,6 +77,28 @@ void checkItWorksWithFreeSpaceAtBegin(const String &chunk, const Separator &sepa
QCOMPARE(str, expected);
}
template <typename String>
void checkNullVsEmpty(const String &empty, const char *failureReason = nullptr)
{
String a;
String b;
QVERIFY(a.isNull());
QVERIFY(b.isNull());
String result = a P b;
QVERIFY(result.isNull());
String d = empty;
QVERIFY(d.isEmpty());
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());
}
void runScenario()
{
@ -357,6 +379,10 @@ void runScenario()
QCOMPARE(ba2, QByteArray(withZero + withZero + withZero));
}
// null vs. empty
checkNullVsEmpty(QStringLiteral(""));
checkNullVsEmpty(QByteArrayLiteral(""), "QTBUG-114238: inconsistent isEmpty/isNull between QString and QByteArray concatenation");
checkItWorksWithFreeSpaceAtBegin(QByteArray(UTF8_LITERAL), "1234");
if (QTest::currentTestFailed())
return;

View File

@ -17,7 +17,11 @@
#define LITERAL "some literal"
void runScenario(); // Defined in stringbuilder.cpp #included below.
namespace {
#define P %
#include "stringbuilder.cpp"
#undef P
} // namespace
class tst_QStringBuilder1 : public QObject
{
@ -27,10 +31,6 @@ private slots:
void scenario() { runScenario(); }
};
#define P %
#include "stringbuilder.cpp"
#undef P
#include "tst_qstringbuilder1.moc"
QTEST_APPLESS_MAIN(tst_QStringBuilder1)