Fix an error in tst_QStringApiSymmetry::count_impl()

Don't use the haystack as needle when testing count() for QLatin1String.
This wasn't caught earlier, since QLatin1String has no count() yet, and
the codepath was never tested.

Pick-to: 6.3 6.2
Change-Id: I2764070894ddce047eceaea52456e5a521252dab
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Sona Kurazyan 2022-03-03 13:11:56 +01:00
parent 0c3ac95899
commit b8755e2a4d

View File

@ -2199,7 +2199,7 @@ void tst_QStringApiSymmetry::count_impl()
const auto nutf8 = needle.toUtf8();
const auto nl1s = needle.toLatin1();
const auto nl1 = nl1s.isNull() ? QLatin1String() : QLatin1String(l1s);
const auto nl1 = nl1s.isNull() ? QLatin1String() : QLatin1String(nl1s);
const auto nref = needle.isNull() ? QStringView() : QStringView(needle);
const auto ns = make<String>(nref, nl1, nutf8);