summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorunknown <jlayt@kde.org>2013-03-28 18:51:37 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-12 11:46:01 +0200
commit7d56edebc94b2b16afb1de5acb63abfb03f7c450 (patch)
treebe24f7f2a7d69030e8768bea9d3bd4db3388e237 /tests
parent61d0f728ae40b9031e2c76d4def15986a8e6439a (diff)
QDateTime - Fix auto tests on Windows before 1980
Auto tests using CET expect there to be no Daylight Time before 1980, but Windows does apply Daylight Time. Fix expected test results to match. Task-number: QTBUG-30420 Change-Id: I7080598fa0a20c1cd5680782606ab983e714e546 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index b84039f557..6cfcf74069 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -478,7 +478,12 @@ void tst_QDateTime::setMSecsSinceEpoch_data()
// positive value 1 too big for qint64max, causing an overflow.
<< std::numeric_limits<qint64>::min() + 1
<< QDateTime(QDate(-292275056, 5, 16), QTime(16, 47, 4, 193), Qt::UTC)
+#ifdef Q_OS_WIN
+ // Windows applies Daylight Time to dates before 1980, Olsen does not
+ << QDateTime(QDate(-292275056, 5, 16), QTime(18, 47, 4, 193), Qt::LocalTime);
+#else
<< QDateTime(QDate(-292275056, 5, 16), QTime(17, 47, 4, 193), Qt::LocalTime);
+#endif
QTest::newRow("max")
<< std::numeric_limits<qint64>::max()
<< QDateTime(QDate(292278994, 8, 17), QTime(7, 12, 55, 807), Qt::UTC)
@@ -844,10 +849,20 @@ void tst_QDateTime::toTimeSpec_data()
QTest::newRow("-271821/4/20 00:00 UTC (JavaScript min date, start of day)")
<< QDateTime(QDate(-271821, 4, 20), QTime(0, 0, 0), Qt::UTC)
+#ifdef Q_OS_WIN
+ // Windows applies Daylight Time to dates before 1980, Olsen does not
+ << QDateTime(QDate(-271821, 4, 20), QTime(2, 0, 0), Qt::LocalTime);
+#else
<< QDateTime(QDate(-271821, 4, 20), QTime(1, 0, 0), Qt::LocalTime);
+#endif
QTest::newRow("-271821/4/20 23:00 UTC (JavaScript min date, end of day)")
<< QDateTime(QDate(-271821, 4, 20), QTime(23, 0, 0), Qt::UTC)
+#ifdef Q_OS_WIN
+ // Windows applies Daylight Time to dates before 1980, Olsen does not
+ << QDateTime(QDate(-271821, 4, 21), QTime(1, 0, 0), Qt::LocalTime);
+#else
<< QDateTime(QDate(-271821, 4, 21), QTime(0, 0, 0), Qt::LocalTime);
+#endif
QTest::newRow("QDate min")
<< QDateTime(QDate::fromJulianDay(minJd()), QTime(0, 0, 0), Qt::UTC)