summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2020-11-30 20:19:12 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2020-12-24 19:41:48 +0100
commit741862875c4bd72ba6d28cf53f6f88579602e4bf (patch)
tree11634e7980db42d416839ecb21374aac50f53eee /tests/auto
parent41e665a452166259b5cad64994de3298751eb7f3 (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. Pick-to: 6.0 Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp9
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 7507969362..0cf227611a 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")