diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-18 09:23:49 -0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-23 04:07:32 +0000 |
commit | 9de4ef9d46610732ede4475827c16a467517747c (patch) | |
tree | 8a340c73de9995f89f75fed4497ea3a7ab3ae670 /tests | |
parent | 31e19aa44073ceb84e1a5aacf20fe1c36bf85192 (diff) |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 19a66d7d86..226a98dfd5 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -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}")) |