diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-10 08:08:07 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-10 08:12:09 (GMT) |
commit | b31da7012a6f675b69e1ef8d6f5aec612337a2ea (patch) | |
tree | dc0f369315e9520864b02cd8a87315a6e4cc5cc9 /tests | |
parent | 6bc7b6b2598e767363591b48ca10f868454519d7 (diff) | |
download | Qt-b31da7012a6f675b69e1ef8d6f5aec612337a2ea.zip Qt-b31da7012a6f675b69e1ef8d6f5aec612337a2ea.tar.gz Qt-b31da7012a6f675b69e1ef8d6f5aec612337a2ea.tar.bz2 |
Autotest: add some debugging, just in case there's something wrong
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp b/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp index 498d4d7..87df57d 100644 --- a/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp +++ b/tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp @@ -46,6 +46,17 @@ static const int minResolution = 50; // the minimum resolution for the tests +QDebug operator<<(QDebug s, const QElapsedTimer &t) +{ + union { + QElapsedTimer t; + struct { qint64 t1, t2; } i; + } copy; + copy.t = t; + s.nospace() << "(" << copy.i.t1 << ", " << copy.i.t2 << ")"; + return s.space(); +} + class tst_QElapsedTimer : public QObject { Q_OBJECT @@ -110,10 +121,12 @@ void tst_QElapsedTimer::basics() #endif quint64 value1 = t1.msecsSinceReference(); + qDebug() << value1 << t1; qint64 elapsed = t1.restart(); QVERIFY(elapsed < minResolution); quint64 value2 = t1.msecsSinceReference(); + qDebug() << value2 << t1 << elapsed; // in theory, elapsed == value2 - value1 // However, since QElapsedTimer keeps internally the full resolution, |