From 589c42c4f3cb51bc23592f8fdbfb7af08998929b Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 27 Jul 2010 17:01:40 +1000 Subject: Make tst_qdatetime failures more verbose. --- tests/auto/qdatetime/tst_qdatetime.cpp | 56 ++++++++++++++++++++++++---------- 1 file 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); -- cgit v0.12