From b8755e2a4d70a5ff30d0fc52ba30475f65b51cbb Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Thu, 3 Mar 2022 13:11:56 +0100 Subject: [PATCH] Fix an error in tst_QStringApiSymmetry::count_impl() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Marc Mutz --- .../corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index c1795791c5b..53861aab8f7 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(nref, nl1, nutf8);