summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-03-03 13:11:56 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-04 16:32:46 +0000
commitc68fdae1626fe11707ee0654322c010ae1641fd9 (patch)
tree6af90933b355289231443b0ade67a4ea96585bc3 /tests
parent58c6f37ed06c9cbc4de2ce8c87a9608bd628c64d (diff)
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. 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> (cherry picked from commit b8755e2a4d70a5ff30d0fc52ba30475f65b51cbb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
index c1795791c5..53861aab8f 100644
--- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
+++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
@@ -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);