diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-01-21 14:35:25 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-02-15 19:38:59 +0000 |
commit | 1d2efe1f27bedcbaa157ef4e82b8eda33dda46ad (patch) | |
tree | 03fe10da803183531b8d4eec213647fa48f15da3 /tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp | |
parent | 85ecc44eee3eb8112faf9989570664ed9302073f (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp')
-rw-r--r-- | tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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; } |