summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-08-19 23:17:48 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-03-05 13:03:13 +0200
commit16f927a4f1ffeff399351b625d73ac3cd7bccd51 (patch)
treeb4f99e0b56232cd60fa45e5992ca6092dd2ac5e0 /tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
parentc58249c32774646a4be5c7504339b483d658a4da (diff)
QLoggingRegistry: use QStringView/QLatin1String more
- QLoggingRule::parse() and the ctor take pattern as QStringView - parseNextLine takes lines as QStringView and produces the pattern as QStringView for QLoggingRule - (setContent has to wait for QStringTokenizer) - QLoggingRule::pass()'s first argument is always QLatin1String, so take it as one Use chopped() more, add a std::move(). Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp')
-rw-r--r--tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
index a10e706ed7..4c269822d6 100644
--- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
+++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
@@ -158,10 +158,13 @@ private slots:
QFETCH(QtMsgType, msgType);
QFETCH(LoggingRuleState, result);
- QLoggingRule rule(QStringRef(&pattern), true);
+ const auto categoryL1 = category.toLatin1();
+ const auto categoryL1S = QLatin1String(categoryL1);
+
+ QLoggingRule rule(pattern, true);
LoggingRuleState state = Invalid;
if (rule.flags != 0) {
- switch (rule.pass(category, msgType)) {
+ switch (rule.pass(categoryL1S, msgType)) {
case -1: QFAIL("Shoudn't happen, we set pattern to true"); break;
case 0: state = NoMatch; break;
case 1: state = Match; break;