summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-02-27 11:36:54 +0100
committerMitch Curtis <mitch.curtis@qt.io>2020-02-28 10:16:15 +0100
commit981c1fe15f68106b88d89b5e31c8a932b95bb635 (patch)
tree235599a4b78677b7782c583a8bc9434f4ea51a1f /tests/auto/corelib/io
parent7ef6ddaf7af71ed6b630b44bbb31beb126e05a3c (diff)
QDebug::toString(): use nospace()
The intended use cases for toString() are the situations where you can't use operator<<, such as QVERIFY2, Q_ASSERT_X, etc., which means that it will often be used as an argument to e.g. QString::arg(), where the user has control over the structure of the message. For that reason, adding an extra space to the end is not necessary and just gets in the way. This amends 658b9697f9d85d4ed294810b4f60bafdbdd8e247. Change-Id: I0695e6809026a0f92ed783899da80de4fa2a1684 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index 7b9e614cf7..4260accfd0 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -748,7 +748,7 @@ void tst_QDebug::toString() const
MyPoint point(3, 4);
QString expectedString;
QDebug stream(&expectedString);
- stream << point;
+ stream.nospace() << point;
QCOMPARE(QDebug::toString(point), expectedString);
}
@@ -758,7 +758,7 @@ void tst_QDebug::toString() const
qobject.setObjectName("test");
QString expectedString;
QDebug stream(&expectedString);
- stream << &qobject;
+ stream.nospace() << &qobject;
QCOMPARE(QDebug::toString(&qobject), expectedString);
}
}