From d3f6249de30ade8e75fe01bd61f5e7416790c032 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Mar 2015 03:20:32 +0100 Subject: [PATCH] tst_QDateTime: Mark more Windows incorrect transitions The refactoring from a8c74ddcf78604c9038ba2a2bea81e445e4b3c58 commit exposed more issues in the Windows API. There were already quite a few QEXPECT_FAIL for this, so this isn't new. For example, localtime(1351386000) on the Central European Timezone should be "Sun Oct 28 02:00:00 CET 2012" (the second occurrence of 2 am), but the Windows API returns tm_isdst = 1 (i.e., still in the CEST timezone) and that's incorrect. Change-Id: I1bc63ac99b1d67b55d783f9606e5c59b24223b13 Reviewed-by: Frederik Gladhorn --- tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index e3ea0bbd2c..24453d35b6 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -2634,6 +2634,10 @@ void tst_QDateTime::daylightTransitions() const QVERIFY(test.isValid()); QCOMPARE(test.date(), QDate(2012, 10, 28)); QCOMPARE(test.time(), QTime(2, 0, 0)); +#ifdef Q_OS_WIN + // Windows uses SecondOccurrence + QEXPECT_FAIL("", "QDateTime doesn't properly support Daylight Transitions", Continue); +#endif // Q_OS_WIN QCOMPARE(test.toMSecsSinceEpoch(), standard2012 - msecsOneHour); // Add year to get to after tran FirstOccurrence @@ -2672,6 +2676,10 @@ void tst_QDateTime::daylightTransitions() const QVERIFY(test.isValid()); QCOMPARE(test.date(), QDate(2012, 10, 28)); QCOMPARE(test.time(), QTime(2, 0, 0)); +#ifdef Q_OS_WIN + // Windows uses SecondOccurrence + QEXPECT_FAIL("", "QDateTime doesn't properly support Daylight Transitions", Continue); +#endif // Q_OS_WIN QCOMPARE(test.toMSecsSinceEpoch(), standard2012 - msecsOneHour); // Add month to get to after tran FirstOccurrence @@ -2710,6 +2718,10 @@ void tst_QDateTime::daylightTransitions() const QVERIFY(test.isValid()); QCOMPARE(test.date(), QDate(2012, 10, 28)); QCOMPARE(test.time(), QTime(2, 0, 0)); +#ifdef Q_OS_WIN + // Windows uses SecondOccurrence + QEXPECT_FAIL("", "QDateTime doesn't properly support Daylight Transitions", Continue); +#endif // Q_OS_WIN QCOMPARE(test.toMSecsSinceEpoch(), standard2012 - msecsOneHour); // Add day to get to after tran FirstOccurrence