aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllocale
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2016-10-28 17:24:46 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2017-11-14 17:18:15 +0000
commit2b8b7a162be52f8cd6c2bc39f498a1ddfb59dd68 (patch)
tree31b34d5ea5e7e13a75379ad80e54a2b962403fca /tests/auto/qml/qqmllocale
parentef2f92d779a719d5b734dc09ae59ba947ac557aa (diff)
V4 Date: fix what we can within ECMA 262's limitations
Use QDateTime and QTimeZone to simplify code (when we can). Note which defective methods are so because the ECMAScript spec requires those defects, reference my bug report against those defects. Fix currentTime to return a UTC time. Fix getLocalTZA to actually deliver the standard offset, without daylight-saving corrections. Fix DaylightSavingTA(t) to return the difference between current standard time offset and pertinent total offset at time t (explaining why that's the least broken answer), rather than assuming DST is one hour when active. (In some places it's half an hour, in some places two hours; and the bugs in the spec break UTC() and LocalTime() if we only return actual DST offset, without adjusting for historical changes to standard offset.) Fix tests to use actual IANA IDs for zones. Change QTime-to-Time conversion to use a modernish date, for which time-zone data is likely to at least be consistently handled, instead of MakeDay(0, 0, 0); that's (nominal proleptic Gregorian) 2 BC, December 31st (represented denormally) for which any time-zone data we have is artificial and contrived. I chose Cassini's third centennary, as it's not likely to be near any zone transitions and is within the era of sane time-zone data. Task-number: QTBUG-56787 Change-Id: I5f21ee2010070a5c1798134fdd2915a723208fd9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllocale')
-rw-r--r--tests/auto/qml/qqmllocale/tst_qqmllocale.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
index d0ce83b997..4f4deaafe5 100644
--- a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
+++ b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
@@ -1268,8 +1268,8 @@ void tst_qqmllocale::timeZoneUpdated()
{
QByteArray original(qgetenv("TZ"));
- // Set the timezone to Brisbane time
- setTimeZone(QByteArray("AEST-10:00"));
+ // Set the timezone to Brisbane time, AEST-10:00
+ setTimeZone(QByteArray("Australia/Brisbane"));
DateFormatter formatter;
@@ -1281,8 +1281,8 @@ void tst_qqmllocale::timeZoneUpdated()
QVERIFY(obj);
QVERIFY(obj->property("success").toBool());
- // Change to Indian time
- setTimeZone(QByteArray("IST-05:30"));
+ // Change to Indian time, IST-05:30
+ setTimeZone(QByteArray("Asia/Kolkata"));
QMetaObject::invokeMethod(obj.data(), "check");