diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-03 13:11:56 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-04 04:05:12 +0100 |
commit | b8755e2a4d70a5ff30d0fc52ba30475f65b51cbb (patch) | |
tree | 612432236823e33102b720848261f08f6ff7f89e /tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | |
parent | 0c3ac95899afa29e0b9e671d7d0ca7aa8c0a13b8 (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.
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>
Diffstat (limited to 'tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp')
-rw-r--r-- | tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | 2 |
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); |