summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-02-18 09:23:49 -0800
committerThiago Macieira <thiago.macieira@intel.com>2022-02-20 23:32:26 -0800
commit5731b83445d890c5316c16cd3a16cd2f5bca2fbd (patch)
treef9b0921009556c51fe88f7fa32500aaeb369e314 /tests/auto/corelib/global/qlogging/tst_qlogging.cpp
parent43a171a7d635f02765337e8ecbf848224f69eda4 (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. Pick-to: 6.3 Change-Id: Ic15405335d804bdea761fffd16d4f141e09537f4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/corelib/global/qlogging/tst_qlogging.cpp')
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp7
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}"))