diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-05-11 20:58:18 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-05-11 20:58:18 (GMT) |
commit | 37475bcc4aef3f08c5917f22c7f0f427e4214b91 (patch) | |
tree | 3435339043a3d31c9592bbb7f9d8d786eef90696 /tests/auto | |
parent | c316e141fa511a6f0549630153e3502cca42f592 (diff) | |
parent | a1cda97c4002195f98c18c460d1f30682bb5a82e (diff) | |
download | Qt-37475bcc4aef3f08c5917f22c7f0f427e4214b91.zip Qt-37475bcc4aef3f08c5917f22c7f0f427e4214b91.tar.gz Qt-37475bcc4aef3f08c5917f22c7f0f427e4214b91.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qdatetime/tst_qdatetime.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index 6aca996..47c54a5 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -106,6 +106,8 @@ private slots: void daysTo(); void secsTo_data(); void secsTo(); + void msecsTo_data(); + void msecsTo(); void operator_eqeq(); void currentDateTime(); void currentDateTimeUtc(); @@ -910,6 +912,30 @@ void tst_QDateTime::secsTo() QVERIFY((dt >= result) == (0 >= nsecs)); } +void tst_QDateTime::msecsTo_data() +{ + addMSecs_data(); +} + +void tst_QDateTime::msecsTo() +{ + QFETCH(QDateTime, dt); + QFETCH(int, nsecs); + QFETCH(QDateTime, result); + +#ifdef Q_OS_IRIX + QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort); +#endif + QCOMPARE(dt.msecsTo(result), qint64(nsecs) * 1000); + QCOMPARE(result.msecsTo(dt), -qint64(nsecs) * 1000); + QVERIFY((dt == result) == (0 == (qint64(nsecs) * 1000))); + QVERIFY((dt != result) == (0 != (qint64(nsecs) * 1000))); + QVERIFY((dt < result) == (0 < (qint64(nsecs) * 1000))); + QVERIFY((dt <= result) == (0 <= (qint64(nsecs) * 1000))); + QVERIFY((dt > result) == (0 > (qint64(nsecs) * 1000))); + QVERIFY((dt >= result) == (0 >= (qint64(nsecs) * 1000))); +} + void tst_QDateTime::currentDateTime() { #if defined(Q_OS_WINCE) |