tst_qlogging (tst_qmessagehandler): use one line for output and expected

Makes it easier to interpret the output from the test, because of
embedded newlines.

Change-Id: Ic15405335d804bdea761fffd16d4f141e09537f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5731b83445d890c5316c16cd3a16cd2f5bca2fbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2022-02-18 09:23:49 -08:00 committed by Qt Cherry-pick Bot
parent 31e19aa440
commit 9de4ef9d46

View File

@ -799,9 +799,10 @@ void tst_qmessagehandler::qMessagePattern()
for (const QByteArray &e : qAsConst(expected)) {
if (!output.contains(e)) {
qDebug() << output;
qDebug() << "expected: " << e;
QVERIFY(output.contains(e));
// use QDebug so we get proper string escaping for the newlines
QString buf;
QDebug(&buf) << "Got:" << output << "; Expected:" << e;
QVERIFY2(output.contains(e), qPrintable(buf));
}
}
if (pattern.startsWith("%{pid}"))