From 1d2efe1f27bedcbaa157ef4e82b8eda33dda46ad Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 21 Jan 2015 14:35:25 +0100 Subject: QDateTime: micro-optimize QDebug op<< Instead of constructing a QString that describes the QDateTime instance, stream the constituents of the string into QDebug directly, using op<< for Q_ENUM, now that it's available. Adapt test to new format of enums. Effects on Linux GCC 4.9 stripped release builds: text -1068B data +-0B relocs +-0 Change-Id: I1a5ce28904edd7d0f6c8d982fd41c52e3536e036 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/auto/corelib/io/qnodebug') diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp index 8938e8bebf..12a67be213 100644 --- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp +++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp @@ -69,9 +69,8 @@ void tst_QNoDebug::noDebugOutput() const void tst_QNoDebug::streaming() const { QDateTime dt(QDate(1,2,3),QTime(4,5,6)); - QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")) - + QStringLiteral(" Qt::LocalTime"); - QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(\"%1\")").arg(debugString))); + const QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")); + QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::asprintf("QDateTime(\"%1\" Qt::TimeSpec(LocalTime))").arg(debugString))); qWarning() << dt; } -- cgit v1.2.3