qt5base-lts/tests/auto/corelib
Edward Welbourne 063b421251 Correct handling of last second of 1969 (again)
In my prior attempt to handle the last second of 1969, I forgot that
the QTime we're describing is a local time, so whether *it* thinks
we're at the last second of the day is beside the point. Fortunately,
preceding second should get -2 as return if mktime()'s initial -1
actually meant the last second of 1969, so we can test via that, after
a cheap pre-test to save doing this too often (albeit we only even
attempt the check if mktime() returned -1 in any case).

Restructured qt_mktime() in the process to deal with the error case's
early return promptly instead of doing it in an else clause. Also
repackage the calls to mktime to isolate various quirks and simplify
the logic in qt_mktime(). This also prepares for setting tm_isdst as a
hint when we know when we came from, in massageAdjustedDateTime().

Refined one test, added two more test cases. These didn't fail before
this fix, but a judiciously-placed qDebug() in testing revealed that
localMSecsToEpochMSecs() resorted to its fall-back handling - as if
the date-time were outside the time_t range - due to qt_mktime()
failing, for these test-cases (and several others). This fix evades
that fall-back behavior; a judiciously-placed qDebug() shows none of
our test-cases now fail callMkTime().

Change-Id: I11aa5015191dc4a565c28482307f7bc341c207e7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-06-11 17:12:12 +02:00
..
animation Avoid use after free in tst_qsequentialanimationgroup 2021-06-02 16:45:23 +02:00
global Long live qToUnderlying 2021-05-18 02:09:11 +02:00
io Implement QFileInfo::junctionTarget(), adjust auto-test 2021-06-05 01:16:06 +02:00
itemmodels QSortFilterProxyModel: create mappings on demand again 2021-06-03 00:53:08 +02:00
kernel normalizeTypeFromSignature: Beware of anonymous struct/union 2021-06-08 15:37:38 +02:00
mimetypes Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
platform Android: Add runOnMainAndroidThread() under QNativeInterface 2021-05-26 23:24:11 +00:00
plugin Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
serialization Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
text Hangul composition: use < base + count checks, not <= checks 2021-06-11 13:57:19 +02:00
thread QTestlib: Add formatting for QObject * in QCOMPARE 2021-05-26 11:02:48 +00:00
time Correct handling of last second of 1969 (again) 2021-06-11 17:12:12 +02:00
tools QHash: fix qHash(std::pair) 2021-05-23 12:08:43 -07:00
CMakeLists.txt Add tests for QAndroidApplication's sdkVersion and activity 2021-05-13 01:41:36 +03:00