OpenCoverage

qloggingregistry.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qloggingregistry.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qloggingregistry_p.h"-
41-
42#include <QtCore/qfile.h>-
43#include <QtCore/qlibraryinfo.h>-
44#include <QtCore/qstandardpaths.h>-
45#include <QtCore/qtextstream.h>-
46#include <QtCore/qdir.h>-
47-
48// We can't use the default macros because this would lead to recursion.-
49// Instead let's define our own one that unconditionally logs...-
50#define debugMsg QMessageLogger(__FILE__, __LINE__, __FUNCTION__, "qt.core.logging").debug-
51#define warnMsg QMessageLogger(__FILE__, __LINE__, __FUNCTION__, "qt.core.logging").warning-
52-
53-
54QT_BEGIN_NAMESPACE-
55-
56Q_GLOBAL_STATIC(QLoggingRegistry, qtLoggingRegistry)
executed 1191 times by 429 tests: end of block
Executed by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qanimationgroup - unknown status
  • ...
executed 1191 times by 429 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qanimationgroup - unknown status
  • ...
executed 244573 times by 547 tests: return &holder.value;
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
guard.load() =...c::InitializedDescription
TRUEevaluated 1191 times by 429 tests
Evaluated by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qanimationgroup - unknown status
  • ...
FALSEnever evaluated
0-244573
57-
58/*!-
59 \internal-
60 Constructs a logging rule with default values.-
61*/-
62QLoggingRule::QLoggingRule() :-
63 enabled(false)-
64{-
65}
never executed: end of block
0
66-
67/*!-
68 \internal-
69 Constructs a logging rule.-
70*/-
71QLoggingRule::QLoggingRule(const QStringRef &pattern, bool enabled) :-
72 messageType(-1),-
73 enabled(enabled)-
74{-
75 parse(pattern);-
76}
executed 24116 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24116
77-
78/*!-
79 \internal-
80 Return value 1 means filter passed, 0 means filter doesn't influence this-
81 category, -1 means category doesn't pass this filter.-
82 */-
83int QLoggingRule::pass(const QString &cat, QtMsgType msgType) const-
84{-
85 // check message type-
86 if (messageType > -1 && messageType != msgType)
messageType > -1Description
TRUEevaluated 516 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 865359 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
messageType != msgTypeDescription
TRUEevaluated 384 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 132 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
132-865359
87 return 0;
executed 384 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
384
88-
89 if (flags == FullText) {
flags == FullTextDescription
TRUEevaluated 1050 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 864441 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
1050-864441
90 // full match-
91 if (category == cat)
category == catDescription
TRUEevaluated 127 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 923 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
127-923
92 return (enabled ? 1 : -1);
executed 127 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
127
93 else-
94 return 0;
executed 923 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
923
95 }-
96-
97 const int idx = cat.indexOf(category);-
98 if (idx >= 0) {
idx >= 0Description
TRUEevaluated 288174 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 576267 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
288174-576267
99 if (flags == MidFilter) {
flags == MidFilterDescription
TRUEevaluated 75 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 288099 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
75-288099
100 // matches somewhere-
101 if (idx >= 0)
idx >= 0Description
TRUEevaluated 75 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
0-75
102 return (enabled ? 1 : -1);
executed 75 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
75
103 } else if (flags == LeftFilter) {
never executed: end of block
flags == LeftFilterDescription
TRUEevaluated 288081 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
0-288081
104 // matches left-
105 if (idx == 0)
idx == 0Description
TRUEevaluated 288081 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
0-288081
106 return (enabled ? 1 : -1);
executed 288081 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
288081
107 } else if (flags == RightFilter) {
never executed: end of block
flags == RightFilterDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
0-18
108 // matches right-
109 if (idx == (cat.count() - category.count()))
idx == (cat.co...egory.count())Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
2-16
110 return (enabled ? 1 : -1);
executed 16 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
16
111 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
2
112 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
2
113 return 0;
executed 576269 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
576269
114}-
115-
116/*!-
117 \internal-
118 Parses \a pattern.-
119 Allowed is f.ex.:-
120 qt.core.io.debug FullText, QtDebugMsg-
121 qt.core.* LeftFilter, all types-
122 *.io.warning RightFilter, QtWarningMsg-
123 *.core.* MidFilter-
124 */-
125void QLoggingRule::parse(const QStringRef &pattern)-
126{-
127 QStringRef p;-
128-
129 // strip trailing ".messagetype"-
130 if (pattern.endsWith(QLatin1String(".debug"))) {
pattern.endsWi...ing(".debug"))Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 24102 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
14-24102
131 p = QStringRef(pattern.string(), pattern.position(),-
132 pattern.length() - 6); // strlen(".debug")-
133 messageType = QtDebugMsg;-
134 } else if (pattern.endsWith(QLatin1String(".info"))) {
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
pattern.endsWi...ring(".info"))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 24098 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
4-24098
135 p = QStringRef(pattern.string(), pattern.position(),-
136 pattern.length() - 5); // strlen(".info")-
137 messageType = QtInfoMsg;-
138 } else if (pattern.endsWith(QLatin1String(".warning"))) {
executed 4 times by 1 test: end of block
Executed by:
  • tst_QLogging
pattern.endsWi...g(".warning"))Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 24089 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
4-24089
139 p = QStringRef(pattern.string(), pattern.position(),-
140 pattern.length() - 8); // strlen(".warning")-
141 messageType = QtWarningMsg;-
142 } else if (pattern.endsWith(QLatin1String(".critical"))) {
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
pattern.endsWi...(".critical"))Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 24085 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
4-24085
143 p = QStringRef(pattern.string(), pattern.position(),-
144 pattern.length() - 9); // strlen(".critical")-
145 messageType = QtCriticalMsg;-
146 } else {
executed 4 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
4
147 p = pattern;-
148 }
executed 24085 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24085
149-
150 if (!p.contains(QLatin1Char('*'))) {
!p.contains(QLatin1Char('*'))Description
TRUEevaluated 63 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 24053 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
63-24053
151 flags = FullText;-
152 } else {
executed 63 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
63
153 if (p.endsWith(QLatin1Char('*'))) {
p.endsWith(QLatin1Char('*'))Description
TRUEevaluated 24040 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
13-24040
154 flags |= LeftFilter;-
155 p = QStringRef(p.string(), p.position(), p.length() - 1);-
156 }
executed 24040 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24040
157 if (p.startsWith(QLatin1Char('*'))) {
p.startsWith(QLatin1Char('*'))Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 23966 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
25-23966
158 flags |= RightFilter;-
159 p = QStringRef(p.string(), p.position() + 1, p.length() - 1);-
160 }
executed 25 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
25
161 if (p.contains(QLatin1Char('*'))) // '*' only supported at start/end
p.contains(QLatin1Char('*'))Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 24050 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
3-24050
162 flags = 0;
executed 3 times by 1 test: flags = 0;
Executed by:
  • tst_QLoggingRegistry
3
163 }
executed 24053 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24053
164-
165 category = p.toString();-
166}
executed 24116 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24116
167-
168/*!-
169 \class QLoggingSettingsParser-
170 \since 5.3-
171 \internal-
172-
173 Parses a .ini file with the following format:-
174-
175 [rules]-
176 rule1=[true|false]-
177 rule2=[true|false]-
178 ...-
179-
180 [rules] is the default section, and therefore optional.-
181*/-
182-
183/*!-
184 \internal-
185 Parses configuration from \a content.-
186*/-
187void QLoggingSettingsParser::setContent(const QString &content)-
188{-
189 QString content_ = content;-
190 QTextStream stream(&content_, QIODevice::ReadOnly);-
191 setContent(stream);-
192}
executed 24025 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24025
193-
194/*!-
195 \internal-
196 Parses configuration from \a stream.-
197*/-
198void QLoggingSettingsParser::setContent(QTextStream &stream)-
199{-
200 _rules.clear();-
201 while (!stream.atEnd()) {
!stream.atEnd()Description
TRUEevaluated 24089 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 24031 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
24031-24089
202 QString line = stream.readLine();-
203-
204 // Remove all whitespace from line-
205 line = line.simplified();-
206 line.remove(QLatin1Char(' '));-
207-
208 // comment-
209 if (line.startsWith(QLatin1Char(';')))
line.startsWit...tin1Char(';'))Description
TRUEnever evaluated
FALSEevaluated 24089 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
0-24089
210 continue;
never executed: continue;
0
211-
212 if (line.startsWith(QLatin1Char('[')) && line.endsWith(QLatin1Char(']'))) {
line.startsWit...tin1Char('['))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 24080 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
line.endsWith(...tin1Char(']'))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEnever evaluated
0-24080
213 // new section-
214 _section = line.mid(1, line.size() - 2);-
215 continue;
executed 9 times by 1 test: continue;
Executed by:
  • tst_QLoggingRegistry
9
216 }-
217-
218 if (_section.toLower() == QLatin1String("rules")) {
_section.toLow...tring("rules")Description
TRUEevaluated 24079 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLoggingRegistry
1-24079
219 int equalPos = line.indexOf(QLatin1Char('='));-
220 if (equalPos != -1) {
equalPos != -1Description
TRUEevaluated 24079 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
0-24079
221 if (line.lastIndexOf(QLatin1Char('=')) == equalPos) {
line.lastIndex...)) == equalPosDescription
TRUEevaluated 24079 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
0-24079
222 const QStringRef pattern = line.leftRef(equalPos);-
223 const QStringRef valueStr = line.midRef(equalPos + 1);-
224 int value = -1;-
225 if (valueStr == QLatin1String("true"))
valueStr == QL...String("true")Description
TRUEevaluated 12029 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 12050 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
12029-12050
226 value = 1;
executed 12029 times by 2 tests: value = 1;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
12029
227 else if (valueStr == QLatin1String("false"))
valueStr == QL...tring("false")Description
TRUEevaluated 12041 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
9-12041
228 value = 0;
executed 12041 times by 2 tests: value = 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
12041
229 QLoggingRule rule(pattern, (value == 1));-
230 if (rule.flags != 0 && (value != -1))
rule.flags != 0Description
TRUEevaluated 24078 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLoggingRegistry
(value != -1)Description
TRUEevaluated 24069 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
1-24078
231 _rules.append(rule);
executed 24069 times by 2 tests: _rules.append(rule);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24069
232 else-
233 warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
executed 10 times by 2 tests: QMessageLogger(__FILE__, 233, __FUNCTION__, "qt.core.logging").warning("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
10
234 } else {-
235 warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());-
236 }
never executed: end of block
0
237 }-
238 }
executed 24079 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24079
239 }
executed 24080 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24080
240}
executed 24031 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24031
241-
242/*!-
243 \internal-
244 QLoggingRegistry constructor-
245 */-
246QLoggingRegistry::QLoggingRegistry()-
247 : categoryFilter(defaultCategoryFilter)-
248{-
249}
executed 885 times by 34 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDate
  • tst_QDateTime
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QPainterPath
  • tst_QRegularExpression_AlwaysOptimize
  • tst_QRegularExpression_DefaultOptimize
  • tst_QRegularExpression_ForceOptimize
  • tst_QSql
  • tst_QString
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • ...
885
250-
251static bool qtLoggingDebug()-
252{-
253 static const bool debugEnv = qEnvironmentVariableIsSet("QT_LOGGING_DEBUG");-
254 return debugEnv;
executed 24023 times by 2 tests: return debugEnv;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24023
255}-
256-
257static QVector<QLoggingRule> loadRulesFromFile(const QString &filePath)-
258{-
259 QFile file(filePath);-
260 if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
file.open(QIOD...ODevice::Text)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 1080 times by 24 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
4-1080
261 if (qtLoggingDebug())
qtLoggingDebug()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
0-4
262 debugMsg("Loading \"%s\" ...",
never executed: QMessageLogger(__FILE__, 262, __FUNCTION__, "qt.core.logging").debug("Loading \"%s\" ...", QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
0
263 QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
never executed: QMessageLogger(__FILE__, 262, __FUNCTION__, "qt.core.logging").debug("Loading \"%s\" ...", QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
0
264 QTextStream stream(&file);-
265 QLoggingSettingsParser parser;-
266 parser.setContent(stream);-
267 return parser.rules();
executed 4 times by 1 test: return parser.rules();
Executed by:
  • tst_QLoggingRegistry
4
268 }-
269 return QVector<QLoggingRule>();
executed 1080 times by 24 tests: return QVector<QLoggingRule>();
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1080
270}-
271-
272/*!-
273 \internal-
274 Initializes the rules database by loading-
275 $QT_LOGGING_CONF, $QT_LOGGING_RULES, and .config/QtProject/qtlogging.ini.-
276 */-
277void QLoggingRegistry::init()-
278{-
279 // get rules from environment-
280 const QByteArray rulesFilePath = qgetenv("QT_LOGGING_CONF");-
281 if (!rulesFilePath.isEmpty())
!rulesFilePath.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 1078 times by 23 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
3-1078
282 envRules = loadRulesFromFile(QFile::decodeName(rulesFilePath));
executed 3 times by 1 test: envRules = loadRulesFromFile(QFile::decodeName(rulesFilePath));
Executed by:
  • tst_QLoggingRegistry
3
283-
284 const QByteArray rulesSrc = qgetenv("QT_LOGGING_RULES").replace(';', '\n');-
285 if (!rulesSrc.isEmpty()) {
!rulesSrc.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 1079 times by 24 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
2-1079
286 QTextStream stream(rulesSrc);-
287 QLoggingSettingsParser parser;-
288 parser.setSection(QStringLiteral("Rules"));
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_QLoggingRegistry
2
289 parser.setContent(stream);-
290 envRules += parser.rules();-
291 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
2
292-
293 const QString configFileName = QStringLiteral("qtlogging.ini");
executed 1081 times by 24 tests: return qstring_literal_temp;
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1081
294-
295#if !defined(QT_BOOTSTRAPPED)-
296 // get rules from Qt data configuration path-
297 const QString qtConfigPath-
298 = QDir(QLibraryInfo::location(QLibraryInfo::DataPath)).absoluteFilePath(configFileName);-
299 qtConfigRules = loadRulesFromFile(qtConfigPath);-
300#endif-
301-
302 // get rules from user's/system configuration-
303 const QString envPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation,-
304 QString::fromLatin1("QtProject/") + configFileName);-
305 if (!envPath.isEmpty())
!envPath.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 1079 times by 24 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1-1079
306 configRules = loadRulesFromFile(envPath);
executed 1 time by 1 test: configRules = loadRulesFromFile(envPath);
Executed by:
  • tst_QLoggingRegistry
1
307-
308 if (!envRules.isEmpty() || !qtConfigRules.isEmpty() || !configRules.isEmpty()) {
!envRules.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 1077 times by 23 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
!qtConfigRules.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 1077 times by 23 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
!configRules.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 1077 times by 23 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
0-1077
309 QMutexLocker locker(&registryMutex);-
310 updateRules();-
311 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
3
312}
executed 1080 times by 24 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1080
313-
314/*!-
315 \internal-
316 Registers a category object.-
317-
318 This method might be called concurrently for the same category object.-
319*/-
320void QLoggingRegistry::registerCategory(QLoggingCategory *cat, QtMsgType enableForLevel)-
321{-
322 QMutexLocker locker(&registryMutex);-
323-
324 if (!categories.contains(cat)) {
!categories.contains(cat)Description
TRUEevaluated 918 times by 243 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
FALSEnever evaluated
0-918
325 categories.insert(cat, enableForLevel);-
326 (*categoryFilter)(cat);-
327 }
executed 918 times by 243 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
918
328}
executed 918 times by 243 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
918
329-
330/*!-
331 \internal-
332 Unregisters a category object.-
333*/-
334void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat)-
335{-
336 QMutexLocker locker(&registryMutex);-
337 categories.remove(cat);-
338}
executed 1485 times by 306 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
  • tst_QNoDebug
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qanimationgroup - unknown status
  • tst_qapplication - unknown status
  • ...
1485
339-
340/*!-
341 \internal-
342 Installs logging rules as specified in \a content.-
343 */-
344void QLoggingRegistry::setApiRules(const QString &content)-
345{-
346 QLoggingSettingsParser parser;-
347 parser.setSection(QStringLiteral("Rules"));
executed 24019 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24019
348 parser.setContent(content);-
349-
350 QMutexLocker locker(&registryMutex);-
351-
352 if (qtLoggingDebug())
qtLoggingDebug()Description
TRUEnever evaluated
FALSEevaluated 24019 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
0-24019
353 debugMsg("Loading logging rules set by QLoggingCategory::setFilterRules ...");
never executed: QMessageLogger(__FILE__, 353, __FUNCTION__, "qt.core.logging").debug("Loading logging rules set by QLoggingCategory::setFilterRules ...");
0
354-
355 apiRules = parser.rules();-
356-
357 updateRules();-
358}
executed 24019 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24019
359-
360/*!-
361 \internal-
362 Activates a new set of logging rules for the default filter.-
363-
364 (The caller must lock registryMutex to make sure the API is thread safe.)-
365*/-
366void QLoggingRegistry::updateRules()-
367{-
368 rules = qtConfigRules + configRules + apiRules + envRules;-
369-
370 for (auto it = categories.keyBegin(), end = categories.keyEnd(); it != end; ++it)
it != endDescription
TRUEevaluated 216136 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 24025 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
24025-216136
371 (*categoryFilter)(*it);
executed 216136 times by 2 tests: (*categoryFilter)(*it);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
216136
372}
executed 24025 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24025
373-
374/*!-
375 \internal-
376 Installs a custom filter rule.-
377*/-
378QLoggingCategory::CategoryFilter-
379QLoggingRegistry::installFilter(QLoggingCategory::CategoryFilter filter)-
380{-
381 QMutexLocker locker(&registryMutex);-
382-
383 if (filter == 0)
filter == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QLogging
3-4
384 filter = defaultCategoryFilter;
executed 3 times by 1 test: filter = defaultCategoryFilter;
Executed by:
  • tst_QLogging
3
385-
386 QLoggingCategory::CategoryFilter old = categoryFilter;-
387 categoryFilter = filter;-
388-
389 for (auto it = categories.keyBegin(), end = categories.keyEnd(); it != end; ++it)
it != endDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QLogging
7-22
390 (*categoryFilter)(*it);
executed 22 times by 1 test: (*categoryFilter)(*it);
Executed by:
  • tst_QLogging
22
391-
392 return old;
executed 7 times by 1 test: return old;
Executed by:
  • tst_QLogging
7
393}-
394-
395QLoggingRegistry *QLoggingRegistry::instance()-
396{-
397 return qtLoggingRegistry();
executed 244573 times by 547 tests: return qtLoggingRegistry();
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
244573
398}-
399-
400/*!-
401 \internal-
402 Updates category settings according to rules.-
403*/-
404void QLoggingRegistry::defaultCategoryFilter(QLoggingCategory *cat)-
405{-
406 const QLoggingRegistry *reg = QLoggingRegistry::instance();-
407 Q_ASSERT(reg->categories.contains(cat));-
408 QtMsgType enableForLevel = reg->categories.value(cat);-
409-
410 // NB: note that the numeric values of the Qt*Msg constants are-
411 // not in severity order.-
412 bool debug = (enableForLevel == QtDebugMsg);-
413 bool info = debug || (enableForLevel == QtInfoMsg);
debugDescription
TRUEevaluated 169024 times by 243 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
FALSEevaluated 48041 times by 1 test
Evaluated by:
  • tst_QLogging
(enableForLevel == QtInfoMsg)Description
TRUEevaluated 24020 times by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 24021 times by 1 test
Evaluated by:
  • tst_QLogging
24020-169024
414 bool warning = info || (enableForLevel == QtWarningMsg);
infoDescription
TRUEevaluated 193044 times by 243 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
FALSEevaluated 24021 times by 1 test
Evaluated by:
  • tst_QLogging
(enableForLeve... QtWarningMsg)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 24020 times by 1 test
Evaluated by:
  • tst_QLogging
1-193044
415 bool critical = warning || (enableForLevel == QtCriticalMsg);
warningDescription
TRUEevaluated 193045 times by 243 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
FALSEevaluated 24020 times by 1 test
Evaluated by:
  • tst_QLogging
(enableForLeve...QtCriticalMsg)Description
TRUEnever evaluated
FALSEevaluated 24020 times by 1 test
Evaluated by:
  • tst_QLogging
0-193045
416-
417 // hard-wired implementation of-
418 // qt.*.debug=false-
419 // qt.debug=false-
420 if (const char *categoryName = cat->categoryName()) {
const char *ca...categoryName()Description
TRUEevaluated 217065 times by 243 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
FALSEnever evaluated
0-217065
421 // == "qt" or startsWith("qt.")-
422 if (strcmp(categoryName, "qt") == 0 || strncmp(categoryName, "qt.", 3) == 0)
strcmp(categor...me, "qt") == 0Description
TRUEnever evaluated
FALSEevaluated 217065 times by 243 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
strncmp(catego..."qt.", 3) == 0Description
TRUEevaluated 379 times by 137 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • ...
FALSEevaluated 216686 times by 160 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • ...
0-217065
423 debug = false;
executed 379 times by 137 tests: debug = false;
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • ...
379
424 }
executed 217065 times by 243 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
217065
425-
426 QString categoryName = QLatin1String(cat->categoryName());-
427 for (const QLoggingRule &item : reg->rules) {-
428 int filterpass = item.pass(categoryName, QtDebugMsg);-
429 if (filterpass != 0)
filterpass != 0Description
TRUEevaluated 72079 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 144381 times by 1 test
Evaluated by:
  • tst_QLogging
72079-144381
430 debug = (filterpass > 0);
executed 72079 times by 2 tests: debug = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72079
431 filterpass = item.pass(categoryName, QtInfoMsg);-
432 if (filterpass != 0)
filterpass != 0Description
TRUEevaluated 72067 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 144393 times by 1 test
Evaluated by:
  • tst_QLogging
72067-144393
433 info = (filterpass > 0);
executed 72067 times by 2 tests: info = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72067
434 filterpass = item.pass(categoryName, QtWarningMsg);-
435 if (filterpass != 0)
filterpass != 0Description
TRUEevaluated 72067 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 144393 times by 1 test
Evaluated by:
  • tst_QLogging
72067-144393
436 warning = (filterpass > 0);
executed 72067 times by 2 tests: warning = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72067
437 filterpass = item.pass(categoryName, QtCriticalMsg);-
438 if (filterpass != 0)
filterpass != 0Description
TRUEevaluated 72066 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 144394 times by 1 test
Evaluated by:
  • tst_QLogging
72066-144394
439 critical = (filterpass > 0);
executed 72066 times by 2 tests: critical = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72066
440 }
executed 216460 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
216460
441-
442 cat->setEnabled(QtDebugMsg, debug);-
443 cat->setEnabled(QtInfoMsg, info);-
444 cat->setEnabled(QtWarningMsg, warning);-
445 cat->setEnabled(QtCriticalMsg, critical);-
446}
executed 217065 times by 243 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • ...
217065
447-
448-
449QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9