qt5base-lts/tests/auto/corelib/tools
Edward Welbourne 6e3f58cbbe QDateTime, QTimeZone: fix mappings from zone time to UTC
Such mappings are ill-defined in the presence of daylight-savings time
(DST); at its transitions, you need information about whether DST is
active or not to determine the correct UTC value.  Existing code did
not have a way to be told that hint, so could not be correct.

Fixing this required changing the (thankfully private) APIs by which
QDateTime accessed QTimeZone's information stipulated by zone time.
In QDateTime, this required propagating the needed hint, when DST
status was known.

QAndroidTimeZonePrivate overloaded QTimeZonePrivate::dataForLocalTime
with an implementation that works whenever !hasTransitions(); the base
implementation handled this case lamely, so I've moved the Android
implementation there, to have only one place for both re-writes.

Amended tst_QDateTime's expected failures; passing a date and time to
the constructor *is* ambiguous when the moment indicated is in a
transition.  I have changed which way we resolve that ambiguity.

Added round-trip test of QDateTime's fromMSecs/toMSecs (but as a
QTimeZone test, since that's what's actually getting tested), based on
a test-case from Marko Kangas.  Initially failed for various zones,
each at one hour-offset; and, on some platforms, for some zones, at
all offsets.  These last revealed that a platform may claim to have
zone information yet, for some zones, lack it (or have very incomplete
information).  In each case, despite this, the platform does give
offsetFromUtc().  (The test also found another pre-existing bug on
Linux; fixed in an earlier commit.)

To accommodate these gaps in transition data, the transition-based
code now falls back to the offsetFromUtc()-based code (used when there
are no transitions) if it can't find a previous transition (which, in
any case, it needs to do its job).

Task-number: QTBUG-56460
Task-number: QTBUG-56397
Task-number: QTBUG-52284
Change-Id: I2f7422a9e9d3767940b1901d887c6a2c1f36ac9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:58:26 +00:00
..
collections Updated license headers 2016-01-21 18:55:18 +00:00
qalgorithms Updated license headers 2016-01-21 18:55:18 +00:00
qarraydata Add QArrayData::reallocateUnaligned for QString and QByteArray 2016-09-07 14:35:51 +00:00
qarraydata_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qbitarray Updated license headers 2016-01-21 18:55:18 +00:00
qbytearray Merge remote-tracking branch 'origin/5.7' into 5.8 2016-09-05 18:47:27 +02:00
qbytearraylist Updated license headers 2016-01-21 18:55:18 +00:00
qbytearraymatcher Updated license headers 2016-01-21 18:55:18 +00:00
qbytedatabuffer Updated license headers 2016-01-21 18:55:18 +00:00
qcache Updated license headers 2016-01-21 18:55:18 +00:00
qchar Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
qcollator Modularize configure.json/.pri 2016-09-15 08:23:53 +00:00
qcommandlineparser Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
qcontiguouscache Updated license headers 2016-01-21 18:55:18 +00:00
qcryptographichash Remove the traces of the discontinued android-no-sdk platform 2016-03-30 10:12:34 +00:00
qdate Add Qt::ISODateWithMs date format, with support in QTime/Date/DateTime 2016-10-20 15:15:40 +00:00
qdatetime QDateTime, QTimeZone: fix mappings from zone time to UTC 2016-12-12 13:58:26 +00:00
qeasingcurve Updated license headers 2016-01-21 18:55:18 +00:00
qexplicitlyshareddatapointer Updated license headers 2016-01-21 18:55:18 +00:00
qfreelist Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qhash Add qHash(QHash) and qHash(QMultiHash) 2016-07-14 06:53:48 +00:00
qhash_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qhashfunctions Replace custom type traits with std one's 2016-11-08 15:31:17 +00:00
qlatin1string Merge remote-tracking branch 'origin/5.7' into 5.8 2016-09-21 11:57:52 +02:00
qline Add QLineF::center() returning the point in the center of the line 2016-05-27 08:49:44 +00:00
qlinkedlist Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qlist Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qlist_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qlocale macOS: Don't build auto-tests as application bundles unless explicitly requested 2016-10-23 10:39:56 +00:00
qmap Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qmap_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qmargins Updated license headers 2016-01-21 18:55:18 +00:00
qmessageauthenticationcode Updated license headers 2016-01-21 18:55:18 +00:00
qpair Merge remote-tracking branch 'origin/5.6' into 5.7 2016-07-15 20:47:57 +02:00
qpoint Updated license headers 2016-01-21 18:55:18 +00:00
qpointf Updated license headers 2016-01-21 18:55:18 +00:00
qqueue Updated license headers 2016-01-21 18:55:18 +00:00
qrect Merge remote-tracking branch 'origin/5.6' into 5.7 2016-03-21 09:02:57 +01:00
qregexp QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qregularexpression Merge dev into 5.8 2016-08-22 11:30:01 +02:00
qringbuffer QRingBuffer: add packet mode 2016-07-23 09:05:13 +00:00
qscopedpointer QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr 2016-06-08 09:09:47 +00:00
qscopedvaluerollback Updated license headers 2016-01-21 18:55:18 +00:00
qset Updated license headers 2016-01-21 18:55:18 +00:00
qsharedpointer QSharedPointer: clean up #ifdefs 2016-08-15 16:55:45 +00:00
qsize Updated license headers 2016-01-21 18:55:18 +00:00
qsizef Updated license headers 2016-01-21 18:55:18 +00:00
qstl Updated license headers 2016-01-21 18:55:18 +00:00
qstring Modularize configure.json/.pri 2016-09-15 08:23:53 +00:00
qstring_no_cast_from_bytearray Updated license headers 2016-01-21 18:55:18 +00:00
qstringapisymmetry Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qstringbuilder QString: add some missing overloaded operator+ 2016-06-29 14:58:25 +00:00
qstringiterator Updated license headers 2016-01-21 18:55:18 +00:00
qstringlist Add QStringList::join(QLatin1String) overload 2016-09-18 07:28:56 +00:00
qstringmatcher Updated license headers 2016-01-21 18:55:18 +00:00
qstringref QStringRef: add chop() 2016-07-07 15:12:27 +00:00
qtextboundaryfinder Remove the traces of the discontinued android-no-sdk platform 2016-03-30 10:12:34 +00:00
qtime Add Qt::ISODateWithMs date format, with support in QTime/Date/DateTime 2016-10-20 15:15:40 +00:00
qtimeline Merge remote-tracking branch 'origin/5.7' into dev 2016-05-12 08:33:08 +02:00
qtimezone QDateTime, QTimeZone: fix mappings from zone time to UTC 2016-12-12 13:58:26 +00:00
qvarlengtharray Updated license headers 2016-01-21 18:55:18 +00:00
qvector Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qvector_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qversionnumber Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
tools.pro Move QElapsedTimer to src/corelib/kernel 2016-07-02 07:51:45 +00:00