qt5base-lts/tests/auto
Edward Welbourne e5dc46d966 Allow millisecond-overflow when the result remains valid
Even before adding support for fractional hours, a fraction of a
minute might potentially have represented a whole number of seconds by
a fractional part that, due to rounding, was less than the whole
number of seconds by less than half a millisecond. Previously, the
parsing would have clipped the fractional part at 999 milliseconds, in
the preceding second, instead of correctly rounding it up to the whole
second.

For QTime::fromString(), which can't represent 24:00, and for
TextDate, which doesn't allow 24:00 as a synomym for the next day's
0:0, applying such rounding to 23:59:59.999999 would produce an
invalid result from a string that does represent a valid time, so use
the nearest representable time, as previously.

Added some tests and amended others.

[ChangeLog][QtCore][QDateTime] QDateTime and QTime, in fromString()
with format ISODate or TextDate, now allow a fractional part of the
hour, minute or seconds to round up to the next second (hence
potentially into the next minute, etc.) when this is the closest
representable value to the exact fractional part given. When rounding
up would turn a valid result into an invalid one, however, the old
behavior of clipping to 999 milliseconds is retained.

Change-Id: I8104848d246cdb4545a12819fb4b6755da2b1372
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2020-10-07 13:58:33 +00:00
..
cmake CMake: Clean up the public API a bit 2020-10-01 14:57:12 +02:00
concurrent Use universal references in QtConcurrent 2020-09-30 15:28:01 +02:00
corelib Allow millisecond-overflow when the result remains valid 2020-10-07 13:58:33 +00:00
dbus Use QMetaType instead of integer based type ids 2020-09-23 19:30:28 +02:00
gui Rename the new platform APIs from QPlatformInterface to QNativeInterface 2020-10-07 13:03:27 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
installed_cmake
network Add test case for QSslSocket to show the wrong behavior 2020-10-02 13:22:38 +02:00
opengl Remove tst_QGL 2020-08-28 11:43:11 +02:00
other Remove compiler test 2020-10-02 22:13:18 +00:00
printsupport QPrinter: unit tests fail when default printer supports duplex 2020-09-30 11:02:36 +02:00
shared Remove most compiler warnings about missing overrides 2020-09-11 00:20:47 +02:00
sql CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
testlib QTestResult: Don't pass a nullptr file to addFailure() 2020-09-30 16:20:29 +02:00
tools Use QMetaType instead of integer based type ids 2020-09-23 19:30:28 +02:00
widgets Test end-date, not just its string representation, in QDTE test 2020-10-06 06:31:18 +02:00
xml CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
.prev_CMakeLists.txt CMake: Regenerate projects 2020-09-22 19:08:53 +02:00
auto.pro Don't error out when configuring Qt on a headless system 2020-09-26 14:36:13 +02:00
CMakeLists.txt CMake: Fix building with -DQT_FEATURE_gui=OFF 2020-09-15 20:05:32 +02:00
network-settings.h Revert "QAbstractSocket: deprecate 'error' member-function" 2020-02-26 23:07:52 +03:00