diff options
author | Andreas Buhr <andreas.buhr@qt.io> | 2020-11-30 20:19:12 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-12-24 20:37:04 +0000 |
commit | dae30b73c5de18a69044975886d5b4b9b9b61537 (patch) | |
tree | fbc4f544c1b6bb3497966f86ece290a375fde418 /tests/auto/corelib | |
parent | 6663d90d19fe40f297cb2e1d5cf9a33a053f4d98 (diff) |
Add test creating QDateTime in double-DST gap in 1947 Germany
In 1947, Germany had not only a summer time but also a
"Hochsommerzeit", a high summer time. This patch adds a test
creating a QDateTime in the time gap at the beginning of this
Hochsommerzeit on May 11, 1947.
Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 741862875c4bd72ba6d28cf53f6f88579602e4bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index 4e2fe96442..7815183d55 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -2775,6 +2775,15 @@ void tst_QDateTime::fromStringStringFormat_data() // That's in the hour skipped - expect the matching time after the spring-forward, in DST: << QDateTime(QDate(2008, 10, 19), QTime(1, 23, 45, 678), southBrazil); } + + QTimeZone berlintz("Europe/Berlin"); + if (berlintz.isValid()) { + QTest::newRow("begin-of-high-summer-time-with-tz") + << QString("1947-05-11 03:23:45.678 Europe/Berlin") + << QString("yyyy-MM-dd hh:mm:ss.zzz t") + // That's in the hour skipped - expecting an invalid DateTime + << QDateTime(QDate(1947, 05, 11), QTime(3, 23, 45, 678), berlintz); + } #endif QTest::newRow("late") << QString("9999-12-31T23:59:59.999Z") << QString("yyyy-MM-ddThh:mm:ss.zZ") |