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>
This commit is contained in:
parent
1ea0625ca8
commit
aeec731262
@ -14,6 +14,10 @@
|
|||||||
|
|
||||||
using namespace QtPrivate::DateTimeConstants;
|
using namespace QtPrivate::DateTimeConstants;
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN) && !QT_CONFIG(icu)
|
||||||
|
# define USING_WIN_TZ
|
||||||
|
#endif
|
||||||
|
|
||||||
class tst_QDate : public QObject
|
class tst_QDate : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -510,7 +514,12 @@ void tst_QDate::startOfDay_endOfDay_data()
|
|||||||
// The western Mexico time-zones skipped the first hour of 1970.
|
// The western Mexico time-zones skipped the first hour of 1970.
|
||||||
QTest::newRow("BajaMexico")
|
QTest::newRow("BajaMexico")
|
||||||
<< QDate(1970, 1, 1) << QByteArray("America/Hermosillo")
|
<< 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()) {
|
if (QTimeZone("America/Sao_Paulo").isValid()) {
|
||||||
QTest::newRow("Brazil")
|
QTest::newRow("Brazil")
|
||||||
@ -519,18 +528,21 @@ void tst_QDate::startOfDay_endOfDay_data()
|
|||||||
// Several South American zones coincide, see
|
// Several South American zones coincide, see
|
||||||
// tst_QDateTime::fromStringDateFormat(ISO 24:00 in DST).
|
// 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()) {
|
if (QTimeZone("Europe/Sofia").isValid()) {
|
||||||
// Several southern zones within EET (but not the northern ones) spent
|
// Several southern zones within EET (but not the northern ones) spent
|
||||||
// part of the 1990s using midnight as spring transition. These included
|
// part of the 1990s using midnight as spring transition. These included
|
||||||
// Asia/{Beirut,Famagusta,Nicosia} and Europe/{Bucharest,Chisinau,Nicosia}.
|
// Asia/{Beirut,Famagusta,Nicosia} and Europe/{Bucharest,Chisinau,Nicosia}.
|
||||||
QTest::newRow("Sofia")
|
QTest::newRow("Sofia")
|
||||||
<< QDate(1994, 3, 27) << QByteArray("Europe/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,
|
// Additionally, America/Scoresbysund, Atlantic/Azores,
|
||||||
// Asia/{Choibalsan,Hovd,Tbilisi,Ulan_Bator,Ulaanbaatar} coincide.
|
// Asia/{Choibalsan,Hovd,Tbilisi,Ulan_Bator,Ulaanbaatar} coincide.
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (QTimeZone("Pacific/Kiritimati").isValid()) {
|
if (QTimeZone("Pacific/Kiritimati").isValid()) {
|
||||||
QTest::newRow("Kiritimati")
|
QTest::newRow("Kiritimati")
|
||||||
<< QDate(1994, 12, 31) << QByteArray("Pacific/Kiritimati")
|
<< QDate(1994, 12, 31) << QByteArray("Pacific/Kiritimati")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user