diff options
author | Mike FABIAN <mike.fabian@basyskom.de> | 2010-05-08 20:14:50 +0200 |
---|---|---|
committer | Mike FABIAN <mike.fabian@basyskom.de> | 2010-07-16 17:09:18 +0300 |
commit | 9ebc352f85af70d2b89676dc4d8eb8be9b25738d (patch) | |
tree | 51dd74f2924aa633eedb887629f573dad0d5609a /tests | |
parent | cc003de09bdcec50d730bd0ab5f1a4fbc44ed2a4 (diff) |
Changes: add some dates before 1970 and after 2038 to Ut_MCalendar::testConversionFromAndToQDateTime_data
RevBy: John Tapsell
Details:
To test whether the fix for the bug
Bug 164283 - DuiCalendar (and therefore DuiLocale) does not support QDateTimes before start of epoch
works.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ut_mcalendar/ut_mcalendar.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/ut_mcalendar/ut_mcalendar.cpp b/tests/ut_mcalendar/ut_mcalendar.cpp index 8a9dc5bb..4844fb89 100644 --- a/tests/ut_mcalendar/ut_mcalendar.cpp +++ b/tests/ut_mcalendar/ut_mcalendar.cpp @@ -63,6 +63,36 @@ void Ut_MCalendar::testConversionFromAndToQDateTime_data() QTest::addColumn<int>("qTimeSpec"); QTest::addColumn<QString>("timeZone"); + QTest::newRow("1945-07-21 Qt::Localtime UTC") + << QDate(1945, 7, 31) + << QTime(14, 31, 0, 0) + << (int) Qt::LocalTime + << "UTC"; + + QTest::newRow("1963-07-21 Qt::Localtime UTC") + << QDate(1963, 7, 31) + << QTime(14, 31, 0, 0) + << (int) Qt::LocalTime + << "UTC"; + + QTest::newRow("2040-07-21 Qt::Localtime UTC") + << QDate(2040, 7, 31) + << QTime(14, 31, 0, 0) + << (int) Qt::LocalTime + << "UTC"; + + QTest::newRow("2050-07-21 Qt::Localtime UTC") + << QDate(2050, 7, 31) + << QTime(14, 31, 0, 0) + << (int) Qt::LocalTime + << "UTC"; + + QTest::newRow("2068-07-21 Qt::Localtime UTC") + << QDate(2068, 7, 31) + << QTime(14, 31, 0, 0) + << (int) Qt::LocalTime + << "UTC"; + QTest::newRow("2008-07-21 Qt::Localtime UTC") << QDate(2008, 7, 21) << QTime(12, 31, 0, 0) @@ -100,7 +130,7 @@ void Ut_MCalendar::testConversionFromAndToQDateTime() MCalendar mcal; QDateTime datetime(qDate, qTime, (Qt::TimeSpec) qTimeSpec); mcal.setDateTime(datetime); - QCOMPARE(datetime, mcal.qDateTime((Qt::TimeSpec) qTimeSpec)); + QCOMPARE(mcal.qDateTime((Qt::TimeSpec) qTimeSpec), datetime); } void Ut_MCalendar::testIcuFormatString_data() |