diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-04-26 13:41:25 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-11 13:46:41 +0200 |
commit | aeec731262bf981f90760d477966cea5f1621ea1 (patch) | |
tree | c775d38ebc5e5a176cc58709716c358e0995b41f /tests/auto/corelib/time | |
parent | 1ea0625ca8762787097d33a4acaf3830d7ee104c (diff) |
Correct startOfDay_endOfDay:BajaMexico test case
This follows up on commit ca4aa065230d3524479f4a5cdbc077d11cc62e5d
with a correction to the start of day, which should of course be
01:00, not invalid.
Unsurprisingly, the MS backend doesn't know anything about that, so
gets this wrong; kludge round it. In the process, adapt the kludge to
the Sofia test-case to work the same way.
Change-Id: If18e6d005783a0854c56092e695177898ec61712
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/corelib/time')
-rw-r--r-- | tests/auto/corelib/time/qdate/tst_qdate.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/auto/corelib/time/qdate/tst_qdate.cpp b/tests/auto/corelib/time/qdate/tst_qdate.cpp index 3c280ca159..75574d7865 100644 --- a/tests/auto/corelib/time/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/time/qdate/tst_qdate.cpp @@ -14,6 +14,10 @@ using namespace QtPrivate::DateTimeConstants; +#if defined(Q_OS_WIN) && !QT_CONFIG(icu) +# define USING_WIN_TZ +#endif + class tst_QDate : public QObject { Q_OBJECT @@ -510,7 +514,12 @@ void tst_QDate::startOfDay_endOfDay_data() // The western Mexico time-zones skipped the first hour of 1970. QTest::newRow("BajaMexico") << QDate(1970, 1, 1) << QByteArray("America/Hermosillo") - << invalid << late; +#ifdef USING_WIN_TZ // MS's TZ APIs lack data + << invalid +#else + << QTime(1, 0) +#endif + << late; } if (QTimeZone("America/Sao_Paulo").isValid()) { QTest::newRow("Brazil") @@ -519,18 +528,21 @@ void tst_QDate::startOfDay_endOfDay_data() // Several South American zones coincide, see // tst_QDateTime::fromStringDateFormat(ISO 24:00 in DST). } -#if QT_CONFIG(icu) || !defined(Q_OS_WIN) // MS's TZ APIs lack data if (QTimeZone("Europe/Sofia").isValid()) { // Several southern zones within EET (but not the northern ones) spent // part of the 1990s using midnight as spring transition. These included // Asia/{Beirut,Famagusta,Nicosia} and Europe/{Bucharest,Chisinau,Nicosia}. QTest::newRow("Sofia") << QDate(1994, 3, 27) << QByteArray("Europe/Sofia") - << QTime(1, 0) << late; +#ifdef USING_WIN_TZ // MS's TZ APIs lack data + << invalid +#else + << QTime(1, 0) +#endif + << late; // Additionally, America/Scoresbysund, Atlantic/Azores, // Asia/{Choibalsan,Hovd,Tbilisi,Ulan_Bator,Ulaanbaatar} coincide. } -#endif if (QTimeZone("Pacific/Kiritimati").isValid()) { QTest::newRow("Kiritimati") << QDate(1994, 12, 31) << QByteArray("Pacific/Kiritimati") |