summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/time
Commit message (Collapse)AuthorAgeFilesLines
* Use qint64 for value of that type in tst_QDateTime millisecond testsEdward Welbourne2020-09-151-71/+91
| | | | | | | | | | | | The test was previously using int; I shall be wanting to add tests that exercise the bounds of qint64. Clean up the layout of the test-row additions in the process of making a trivial change to them all. Also const the QFETCH() types so we catch any use of non-const methods on the values fetched. Change-Id: I4b0187de71f5f14b39b4eabe8afd12a196f73d23 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Trim trailing 0s from QTime construction, where neither use nor ornamentEdward Welbourne2020-09-151-153/+153
| | | | | | | | The seconds and milliseconds default to 0; so omit them when they're zero, unless there's nearby code that contrasts nicely with them. Change-Id: Iea049015e976f5a5209fe87a2cbfdae9de49a559 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't use default-constructed QTime() where QTime(0, 0) is intendedEdward Welbourne2020-09-141-35/+43
| | | | | | | | | | QTime() is invalid. Only the seconds and milliseconds are optional, for valid times. Use startOfDay() for zoned times, QTime(0, 0) for fixed-offset ones. Change-Id: I3b65d5c3733ac83dc3a6c214859c3f56a480bb94 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove some unused private methods and replace anotherEdward Welbourne2020-09-141-90/+90
| | | | | | | | | | | | | Nothing used defDateTime(), nothing but it used defTime(). The only other use of defDate() were from one test, which might as well make it a local variable. QDateTime's default is invalid, making invalidDateTime() redundant, and the invalidDate() and invalidTime() it called had no other users. Change-Id: I0e07ee58478bfe8ba680eafb52e2f73a962edd33 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [QtCore] Fix QDateTime unit test: time zone of system was usedAndreas Buhr2020-09-111-10/+9
| | | | | | | | | | | | | | | | Test data for QDateTime unit tests was constructed in system's local time, which made unit test outcome dependent on the time zone of the system running the tests. This led to failing unit tests on systems with libc6 version 2.31 or newer. A QDateTime in a timezone, which has daylight saving time, was created and then used in Hawaii's time zone,which has no daylight saving time. Newer glibc checks this and returns errors. This patch changes the behavior to create the test data in a specified time zone setting. Task-number: QTBUG-80441 Change-Id: I0330b647fa011be99141dde09001ff2d58bd3a5f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* [QtCore] QDateTime: switch from newRow to addRow in unit testsAndreas Buhr2020-09-111-4/+4
| | | | | | | | | Instead of doing string formating first and then using QTest::newRow, we can do both at the same time using QTest::addRow Change-Id: Ia5c90eb705a806e37b96a1fa174a6557f91bee6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* [QtCore] Adapt QDateTime unit tests to use QByteArrayAndreas Buhr2020-09-111-8/+8
| | | | | | | | | | | To not have to bother with encodings, a few QStrings are changed to QByteArrays. This way, a few calls to QString::fromLatin1 and to QString::toLocal8Bit can be removed Change-Id: Ia0cf27fc2a86f9842ed0f3ebe47b050bb8a3f4e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Adapt QDate unit tests to not take into account system localeAndreas Buhr2020-09-101-14/+13
| | | | | | | | | | | | QDate was changed to consistently use the C local in serialization and parsing in git commit 5ba66c5622e9e0da87a5037399b375d7e8cee554. This commit reflects this change in the unit tests. Task-number: QTBUG-80441 Change-Id: Ib21a215ef0e36c9eaa2c161b92c6877a50ae6f06 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix failures in tst_qdatetime under non-english localesMarcel Krems2020-09-091-2/+2
| | | | | | | | | QDateTime::toString uses the C locale since 5ba66c5622e9e0da87a5037399b375d7e8cee554 So don't expect locale specific day- and month-names. Task-number: QTBUG-80441 Change-Id: I08f53b6b33ed9e7eaaa58df4ca6a966c4ba9ef24 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix crash on serializing default-constructed QTimeZoneEdward Welbourne2020-08-231-0/+28
| | | | | | | | | | | | | | The serialization code neglected to check against null. Sinze zones are saved either by IANA ID or in our special OffsetFromUtc format, representing an invalid zone by a string that cannot possibly be a valid IANA ID will do. Fixes: QTBUG-86019 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I6882026403d00f8b254aab34c645f1cf8f9fcc2d Reviewed-by: Taylor Braun-Jones <taylor@braun-jones.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Sort out the overflow cases in tst_QDateTimeEdward Welbourne2020-08-111-13/+12
| | | | | | | | | Use the actual minimum value, rather than minus the maximum, and adapt the overflow expectations so that they're correct west of Greenwich as well as east. Change-Id: I7a5f4510db0fdea3855b5b2bd4c4a86882030efd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of last second in 1969Edward Welbourne2020-08-111-0/+12
| | | | | | | | Due to a limitation of mktime(), we would have declared it invalid. Tidied up qt_mktime() slightly in the process. Change-Id: I25469e314afee6e0394e564bc69a98883005d4ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-095-8/+8
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make feature datetimeparser depend on feature datestringEdward Welbourne2020-07-025-30/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | No client of QDateTimeParser actually uses it unless datestring was enabled, nor is it any use without datestring. Various methods conditioned on datestring are broken unless datetimeparser is enabled. We can't condition public API on datetimeparser, as it's a private feature, but client code can condition use of it on the private feature. All string-to-date/time conversions that use a string format (this includes all locale-specific formats) depend on feature datetimeparser. Change #if-ery (or add it) in all client (including test) code to test the right feature. Tidied up some code in the process. Killed some already-redundant textdate #if-ery. Renamed a test whose name claimed it involved locale, which it doesn't, in the course of #if-ing it. This simplifies the condition for feature datetimeedit (which overtly depended on textdate, redundantly since it depends on datestring which depends on textdate; its dependence on datetimeparser now makes its dependency on datestring also redundant). It also removes the need for assorted datestring checks in QDateTimeParser itself. Change-Id: I5dfe3a977042134b2cfb16cbcc795070634e7adf Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update tests/auto/corelib/time/'s CMake configEdward Welbourne2020-07-025-1/+15
| | | | | | | | | Recent changes in .pro files hadn't been propagated. Re-ran pro2cmake.py and saved the results. Change-Id: I91e4cd513329bce10ce8cbd0ddae8240af050213 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove assortee pre-Qt6 code from date/time testsEdward Welbourne2020-07-023-147/+0
| | | | | | | | Assume QT_VERSION >= QT_VERSION_CHECK(6,0,0) throughout. Change-Id: If70c59f9319f72549de581fc446fd60d32b02521 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Replace a constant with a predicate function using itEdward Welbourne2020-07-011-6/+8
| | | | | | | | | | Rather than naming a "GMT" string so as to repeatedly test whether a date-time's string representation ends in it, use a simple lambda to do the test, so that the string is only used in one place anyway. Makes the test code more readable. Change-Id: I5afad9ad5d58702bea7f24e5e5688ea4d738ae0d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use ranged for loops in place of foreach in QTimeZone testsEdward Welbourne2020-06-238-13/+15
| | | | | | | | | This (and use of Q_SLOTS for the test slots) makes it possible to enable QT_NO_KEYWORDS and QT_NO_FOREACH in all the corelib/time/ tests. Change-Id: I85fd358f3d1a72c9269d5260d0224640c1751f2d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove winrtOliver Wolff2020-06-061-3/+0
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Turn badly-named test into two data rows of another testEdward Welbourne2020-05-291-16/+6
| | | | | | | | | | | | Since ancient times, tst_QDateTime::fromString_LOCALE_ILDATE() has claimed to be Windows-only, although there is nothing MS-specific about it; its name also purports to implicate locale, which it doesn't. Turn it into two data rows for the more general fromStringDateFormat() test, with no extra #if-ery about it. Change-Id: I239c0f80f8f7fa42d498a0f801cc8edfb1db3d8c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Rework QLocale and QDateTime tests that expect CET abbreviationEdward Welbourne2020-05-281-21/+6
| | | | | | | | | | | | | | | | | | | | | | The name CET is locale-dependent; but QLocale doesn't know about localization of time zone names. Such abbreviated zone names are, in any case, potentially ambiguous - various zones around the world have collisions - so they can't be relied on. QTimeZone's various backends have differing handlings of how to abbreviate zone names (MS's provides no abbreviated names at all); and it appears macOS actually follows the relevant localizations. So it is hopeless to hard-code the expected zone abbreviations. Changed the tests to consult QTimeZone for the abbreviation and compare what it gets with the results of checks which should match this. This is less stringent, but it is at least robustly correct, thereby getting rid of assorted kludges and #if-ery. Pick-to: 5.15 Task-number: QTBUG-70149 Change-Id: I0c565de3fd8b5987c8f5a3f785ebd8f6e941e055 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QDateTimeParser recognize local time offsetsAndrei Golubev2020-05-281-1/+39
| | | | | | | Fixes: QTBUG-84209 Pick-to: 5.15 Change-Id: Iedbc7beafcaa55c72fec3ac5a5f519c6ed5f7770 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Teach QDateTimeParser some common time-zone offset formatsAndrei Golubev2020-05-121-2/+129
| | | | | | | | Fixes: QTBUG-83687 Fixes: QTBUG-83844 Pick-to: 5.15 Change-Id: Ia1c827017b93cf8277aa5a0266805d773d2d9818 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make qtbase compile without QT_CONFIG(timezone)Andrei Golubev2020-05-112-9/+54
| | | | | | | | Fixes: QTBUG-83795 Pick-to: 5.15 Change-Id: I05eaaf57d87a9111d3609ebab81bc707f8af98f0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Catch overflow in QDateTime::fromSecsSinceEpoch()Edward Welbourne2020-05-081-0/+31
| | | | | | | | | | It's documented to be undefined if the number of seconds is outside the allowed range, but it doesn't hurt for that undefined behavior to happen to be that the result is invalid. Added a simple test. Change-Id: I20c3f680c7948b3904f213452272133be77e4d62 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove all locale-dependence from Q(Date|Time)+Edward Welbourne2020-05-081-10/+0
| | | | | | | | | | | | | | | [ChangeLog][Important Behavior Changes][QDateTime] Removed all locale-dependence from QDate, QTime and QDateTime, including the Qt::DateFormat members that select the formats of the default and system locales and the toString(Qt::DateFormat, QCalendar) overload, which only used its calendar for these formats. All toString() methods now use, and all fromString() methods only recognize, the C locale's names for days and months. Use QLocale's methods if you need to take locale into account. Fixes: QTBUG-80441 Change-Id: I3a8968438741afb00f44262f79659c51e9b06c35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move a test of QLocale's methods out of tst_QDateTimeEdward Welbourne2020-05-081-51/+1
| | | | | | | | | | | | It clearly belonged in tst_QDate::toDateTime(), for which it adds a few more test-case and in which it inspires some further testing. The new testing of case-insensitivity doesn't work if the format contains stray non-format characters, so added a new data column to take care of that. Pick-to: 5.15 Change-Id: I73619be02091c97024a84cb963c7029e9fd0569a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Condition some date-time tests on feature textdateEdward Welbourne2020-05-081-8/+18
| | | | | | | | | | They use the Qt::TextDate format, so do depend on the feature. Rename one in the process; nothing in its test has anything to do with de_DE locale. Pick-to: 5.15 Change-Id: I2adae5c46e6009c13b433993ed2c3c761a500bfb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Purge from Q(Date|Time)+ most things marked to go at Qt 6Edward Welbourne2020-05-053-194/+3
| | | | | | Change-Id: Ib3f48c74132b47649dc7b4cbacf2cefed5a57687 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-231-0/+5
|\ | | | | | | Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
| * Handle specified time-spec in date-time parsingAndrei Golubev2020-04-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a date-time was parsed from a string, the result was equal (as a date-time) to the correct value, but had (at least in some cases) the wrong spec, where it should have had a spec reflecting the zone specifier parsed. The time-spec imposed for the benefit of QDateTimeEdit is now moved from QDateTimeParser to QDateTimeEditPrivate, which takes over responsibility for imposing it. QDateTimeParser assumes Qt::LocalTime in member functions (where applicable) and uses the time-spec parsed from the string when constructing the date-time. QDateTime::fromString() and QLocale::toDateTime() are updated to use the full QDateTime returned by QDateTimeParser. Fixes: QTBUG-83075 Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I8b79add2c7fc13a200e1252d48dbfa70b36757bf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Make QLocale(QString) explicitLars Knoll2020-04-011-4/+4
| | | | | | | | | | | | | | | | We should not implicitly convert a QString to a QLocale object. It can easily create unwanted side effects. Change-Id: I7bd9b4a4e4512c0e60176ee4d241d172f00fdc32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Purge QRegExp use in QDateTime's rfcDateImpl()Edward Welbourne2020-02-273-20/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace with a parser which actually does the job right, fixing various infelicities in the parsing in the process. Make the parser strict about formatting. Adjusted tests to match. Fixed some QTime invalidity tests to each test only one invalidity at a time (the invalid year and day tests also used an invalid month). [ChangeLog][QtCore][QDateTime] The parser for the Qt::RFC2822Date format is now stricter, requiring the text to exactly match the form of one of the relevant formats. A valid date or time will still be parsed, even if the other part of the content is invalid, as long as it (and any offset, if present) has the right form. In particular, the parser now rejects texts with trailing cruft (other than space). Fixes: QTBUG-80038 Change-Id: Id25675afd75f82f6351f20e79f0154f3ceda35ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-02-133-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt Hopefully final merge from wip/cmake, and then all cmake changes should target dev directly. Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
| * | Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-123-3/+3
| | | | | | | | | | | | | | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-134-9/+49
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
| * Deprecate locale-related DateFormat enum membersEdward Welbourne2020-01-313-5/+22
| | | | | | | | | | | | | | | | Qt 6 shall remove all locale-dependence from Q(Date|Time)+. Task-number: QTBUG-80441 Change-Id: Iebaaa2bd776bccfe0d73c15f36cbdd456b71ca59 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Clarify handling of unspecified year in two QCalendar methodsEdward Welbourne2020-01-311-1/+24
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore] QCalendar::monthsInYear(QCalendar::Unspecified) now returns maximumMonthsInYear(). QCalendar::daysInYear() now makes clear that its handling of unspecified year is undefined. Change-Id: Ifef8723193868c666f6afeb7f190af4929d30dea Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Deprecate QDateTime(const QDate &) in favor of QDate::startOfDay()Edward Welbourne2020-01-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | It needed re-implemented in terms of the new API (in case QTime(0, 0) was skipped, on the date in question, by a spring-forwrd), which makes it redundant (and supports choice of spec and zone or offset, which it did not). Change-Id: I1e3c3e794632c234f254be754ed6e4ebdaaaa6bc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-245-89/+308
|\| | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-151-22/+17
| |\ | | | | | | | | | Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
| | * Combine negativeYear() and printNegativeYear()Edward Welbourne2020-01-141-22/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They overlapped and the latter had duplicated code, so make them into a single data-driven test. At the same time, replace the '-' at the start of the expected string with QLocale::negativeSign(), since the test fails otherwise when LC_NUMERIC=nb_NO on Linux (Debian/testing). Change-Id: I051c75abff16b2e6f8278fcb152b6bde14c71f9a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QTime: fix tests with Qt6Christian Ehrlicher2020-01-031-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt6 there is a behavior change with extra stuff after the seconds - it's no longer allowed and will result in an invalid QTime. This was introduced with bf65c277892f6f322fa689c06d81ba9b1d9a8038 but the autotests were not adjusted for it. Change-Id: Ia78f4f2a8019e46d9d0e8e8b8918a3ab2d4638e2 Reviewed-by: Liang Qi <liang.qi@qt.io>
| * | QDateTime: fix tests with Qt6Christian Ehrlicher2020-01-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt6 there is a behavior change with extra stuff after the seconds - it's no longer allowed and will result in an invalid QDateTime. This was introduced with bf65c277892f6f322fa689c06d81ba9b1d9a8038 but the autotests were not adjusted for it. Change-Id: Iee6a9a7ac6cbb2754a68e082bb7074d17fac9d9c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-121-0/+38
| |\| | | | | | | | | | Change-Id: I69238f23882deebeaad46e4fdcf899ab22cc2b8f
| | * Fix more mis-handling of spaces in ISO date format stringsEdward Welbourne2019-12-101-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISO date format doesn't allow spaces within a date, although 3339 does allow a space to replace the T between date and time. Sixteen tests added to check this all failed. So clean up the handling of spaces in the parsing of ISO date-time strings. [ChangeLog][QtCore][QDateTime] ISO 8601: parsing of dates now requires a punctuator as separator (it previously allowed any non-digit; officially only a dash should be allowed) and parsing of date-times no longer tolerates spaces in the numeric fields: an internal space is only allowed in an ISO 8601 date-time as replacement for the T between date and time. Change-Id: I24d110e71d416ecef74e196d5ee270b59d1bd813 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-101-14/+51
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| | * Allow lower-case for the T and Z in ISO 8601 date formatEdward Welbourne2019-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Cite RFC 3339 as basis for allowing a space in place of the T, too. The RFC mentions that ISO 8601 accepts t and z for T and Z, so test for them case-insensitively. Add a test for this. Change-Id: Iba700c8d74d485df154d27300aab7b1958e1ccef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix handling of trailing space at the end of an ISO date-timeEdward Welbourne2019-12-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If milliseconds were followed by a space, the space was included in the count of "digits" read as the fractional part; since we read (up to) four digits (so that we round correctly if extras are given), a harmless apce could cause scaling down by too large a power of ten. Since QString::toInt() ignores leading space, we were also allowing interior space at the start of the milliseconds, which we should not, so catch that at the same time. Added tests, including one for the rounding that's the reason for reading the extra digit, when present. Fixes: QTBUG-80445 Change-Id: I606b29a94818a101f45c8b59a0f5d1f78893d78f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix crash when a date-time has an invalid time-zoneEdward Welbourne2019-12-061-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDateTime is a friend of QTimeZone, so can access its internals; but it must check the zone is valid before doing so. Expanded tst_QDateTime::invalid() and made it data-driven to catch the failure cases. Commented on a test-case that caught a mistake in my first attempt at this, and on QDateTimeParser's surprising reliance on a quirk of QDateTime::toMSecsSinceEpoch()'s behavior. Fixes: QTBUG-80146 Change-Id: I24856e19ff9bf402152d17d71f83be84e366faad Reviewed-by: Alex Blasche <alexander.blasche@qt.io>