qt5base-lts/tests/auto/corelib
Giuseppe D'Angelo f0c2c987e3 QBA(V)/QS(V)::lastIndexOf: fix the search of 1-char needles
When a needle has length 1 (because it's a QChar/char16_t, or because
it's a string-like of length 1) then an ad-hoc search algorithm is
used. This algorithm had a off-by-one, by not allowing to match at
the last position of a haystack (in case `from` was `haystack.size()`).

That is inconsistent with the general search of substring needles
(and what QByteArray does). Fix that case and amend wrong tests.
This in turn unveiled the fact that the algorithm was unable to cope
with 0-length haystacks (whops), so fix that as well. Drive-by, add a
similar fix for QByteArray.

Amends 6cee204d56.

Pick-to: 6.2
Change-Id: I6b3effc4ecd74bcbcd33dd2e550da2df7bf05ae3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-08-26 07:08:34 +02:00
..
animation Avoid use after free in tst_qsequentialanimationgroup 2021-06-02 16:45:23 +02:00
global tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
io tst_qurl{,internal}: Use U+FB01 for normalization to ASCII test cases 2021-08-25 00:13:39 +02:00
itemmodels emit layoutAboutToBeChanged timely 2021-07-20 21:27:27 +01:00
kernel Re-add QPropertyAlias functionality 2021-08-23 12:39:44 +00: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 tst_QPluginLoader: Simplify creating a fake pointer in fakeplugin.cpp 2021-08-20 22:19:58 +03:00
serialization tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
text QBA(V)/QS(V)::lastIndexOf: fix the search of 1-char needles 2021-08-26 07:08:34 +02:00
thread Use constexpr for constants and ranged-based for loops 2021-08-23 15:11:49 +02:00
time Fix and clean up utterly confused (and confusing) transition tests 2021-06-15 16:58:46 +02:00
tools QS(V)/QBA(V)/QL1S::lastIndexOf: fix the offset calculations 2021-08-19 01:55:01 +02:00
CMakeLists.txt Add tests for QAndroidApplication's sdkVersion and activity 2021-05-13 01:41:36 +03:00