qt5base-lts/tests/auto/corelib
João Abecasis 75286739de Fix and simplify QString::mid
'position' was being used to initialize 'n' before being fully
validated. To compensate for this, the code attempted to fix 'n' once
'position' was found to be invalid (negative). This would, however, also
attempt to "fix" a perfectly valid value of 'n'.

By fully validating 'position' beforehand we avoid this trap and can
safely use it to validate and reset 'n', as needed.

Arithmetic for boundary conditions of 'n' was rearranged to avoid
triggering integer overflow.

Removed explicit check for shared_null, as the same behaviour can be
supported without it.

Change-Id: Ie9bff7b8137a74f55c7dcfe629bd569045e28f3c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-14 12:50:14 +01:00
..
animation Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
codecs Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00
global QtDebug: Include file, line, function information 2012-02-01 02:16:32 +01:00
io Fix QTextStream and QDebug operator<< for QLatin1String 2012-02-02 11:10:04 +01:00
itemmodels tst_qabstractitemmodel does not need QT += widgets 2012-01-31 04:55:47 +01:00
json Update contact address in license headers. 2012-01-31 04:54:56 +01:00
kernel Bring qmetaobjectbuilder in sync with moc 2012-02-03 15:09:03 +01:00
plugin Changed qlibrary unittest to use applicationDirPath() 2012-01-31 04:55:35 +01:00
statemachine Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
thread Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00
tools Fix and simplify QString::mid 2012-02-14 12:50:14 +01:00
xml Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
corelib.pro Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00