qt5base-lts/tests/auto/corelib
Edward Welbourne ce159d1a3e Fix toFloat()s between float and double ranges and document
Revised some toFloat()s to be consistent with the matching
toDouble()s; previously, they would return infinity if toDouble() did
but return 0 if toDouble() got a finite value outside float's range.
That also applied to values that underflowed float's range, succeeding
and returning 0 as long as they were within double's range but failing
if toDouble() underflowed.  Now float-underflow also fails.  Amended
their documentation to reflect this more consistent reality.
Added some tests of out-of-range values, infinities and NaNs.

[ChangeLog][QtCore][toFloat] QString, QByteArray and QLocale returned
an infinity on double-overflow (since 5.7) but returned 0 on a finite
double outside float's range, while setting ok to false; this was at
odds with their documented behavior of returning 0 on any failure.
They also succeeded, returning zero, on underflow of float's range,
unless double underflowed, where they failed.  Changed the handling of
values outside float's range to match that of values outside double's
range: fail, returning an infinity on overflow or zero on underflow.
The documentation now reflects the revised behavior, which matches
toDouble().

Change-Id: Ia168bcacf7def0df924840d45d8edc5f850449d6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:24 +00:00
..
animation _q_interpolate<T> is unsafe with unsigned template arguments 2018-08-22 08:38:44 +00:00
codecs Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
global Android: fix tst_qlogging 2018-06-28 07:29:30 +00:00
io Modernize the "settings" feature 2018-11-15 17:20:15 +00:00
itemmodels QSortFilterProxyModel inserting at bottom of source model 2018-08-17 08:10:11 +00:00
kernel QObject: do allow setProperty() to change the type of the property 2018-08-04 15:46:02 +00:00
mimetypes QMimeDatabase: fix assert when fetching data for invalid mimetype 2018-04-06 07:19:01 +00:00
plugin tst_qpluginloader: Fix preprocessor condition 2018-07-27 04:48:30 +00:00
serialization QJsonDocument: Make emptyObject an object 2018-07-31 09:33:42 +00:00
statemachine tst_QStateMachine: Don't use unconditional waits 2018-04-04 07:07:40 +00:00
thread tst_qthreadpool: Skip "stackSize" if unsupported 2018-06-27 17:40:28 +00:00
tools Fix toFloat()s between float and double ranges and document 2018-11-23 10:05:24 +00:00
corelib.pro Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00