diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-07-27 07:01:40 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-07-27 07:01:40 (GMT) |
commit | 589c42c4f3cb51bc23592f8fdbfb7af08998929b (patch) | |
tree | 221b1423b6461517d182096e0b5db110a5e3f1d9 /tests | |
parent | 5929062996c9d0d90f19198064953a0086be7741 (diff) | |
download | Qt-589c42c4f3cb51bc23592f8fdbfb7af08998929b.zip Qt-589c42c4f3cb51bc23592f8fdbfb7af08998929b.tar.gz Qt-589c42c4f3cb51bc23592f8fdbfb7af08998929b.tar.bz2 |
Make tst_qdatetime failures more verbose.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdatetime/tst_qdatetime.cpp | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index 0900b35..1a82a4c 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -961,14 +961,26 @@ void tst_QDateTime::currentDateTime() upperBound.setTime_t(buf2); upperBound = upperBound.addSecs(1); - QVERIFY(lowerBound < upperBound); - - QVERIFY(lowerBound <= dt1); - QVERIFY(dt1 < upperBound); - QVERIFY(lowerBound <= dt2); - QVERIFY(dt2 < upperBound); - QVERIFY(lowerBound <= dt3); - QVERIFY(dt3 < upperBound); + QString details = QString("\n" + "lowerBound: %1\n" + "dt1: %2\n" + "dt2: %3\n" + "dt3: %4\n" + "upperBound: %5\n") + .arg(lowerBound.toTime_t()) + .arg(dt1.toTime_t()) + .arg(dt2.toTime_t()) + .arg(dt3.toTime_t()) + .arg(upperBound.toTime_t()); + + QVERIFY2(lowerBound < upperBound, qPrintable(details)); + + QVERIFY2(lowerBound <= dt1, qPrintable(details)); + QVERIFY2(dt1 < upperBound, qPrintable(details)); + QVERIFY2(lowerBound <= dt2, qPrintable(details)); + QVERIFY2(dt2 < upperBound, qPrintable(details)); + QVERIFY2(lowerBound <= dt3, qPrintable(details)); + QVERIFY2(dt3 < upperBound, qPrintable(details)); QVERIFY(dt1.timeSpec() == Qt::LocalTime); QVERIFY(dt2.timeSpec() == Qt::LocalTime); @@ -1000,14 +1012,26 @@ void tst_QDateTime::currentDateTimeUtc() upperBound.setTime_t(buf2); upperBound = upperBound.addSecs(1); - QVERIFY(lowerBound < upperBound); - - QVERIFY(lowerBound <= dt1); - QVERIFY(dt1 < upperBound); - QVERIFY(lowerBound <= dt2); - QVERIFY(dt2 < upperBound); - QVERIFY(lowerBound <= dt3); - QVERIFY(dt3 < upperBound); + QString details = QString("\n" + "lowerBound: %1\n" + "dt1: %2\n" + "dt2: %3\n" + "dt3: %4\n" + "upperBound: %5\n") + .arg(lowerBound.toTime_t()) + .arg(dt1.toTime_t()) + .arg(dt2.toTime_t()) + .arg(dt3.toTime_t()) + .arg(upperBound.toTime_t()); + + QVERIFY2(lowerBound < upperBound, qPrintable(details)); + + QVERIFY2(lowerBound <= dt1, qPrintable(details)); + QVERIFY2(dt1 < upperBound, qPrintable(details)); + QVERIFY2(lowerBound <= dt2, qPrintable(details)); + QVERIFY2(dt2 < upperBound, qPrintable(details)); + QVERIFY2(lowerBound <= dt3, qPrintable(details)); + QVERIFY2(dt3 < upperBound, qPrintable(details)); QVERIFY(dt1.timeSpec() == Qt::UTC); QVERIFY(dt2.timeSpec() == Qt::LocalTime); |