qloggingregistry.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qloggingregistry.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11namespace { namespace Q_QGS_qtLoggingRegistry { typedef QLoggingRegistry Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 992 times by 430 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
) guard.store(QtGlobalStatic::Destroyed);
executed 992 times by 430 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 992 times by 430 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
  • ...
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 244159 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
  • ...
&holder.value;
executed 244159 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
  • ...
} } } static QGlobalStatic<QLoggingRegistry, Q_QGS_qtLoggingRegistry::innerFunction, Q_QGS_qtLoggingRegistry::guard> qtLoggingRegistry;
0-244159
12-
13-
14-
15-
16-
17QLoggingRule::QLoggingRule() :-
18 enabled(false)-
19{-
20}
never executed: end of block
0
21-
22-
23-
24-
25-
26QLoggingRule::QLoggingRule(const QStringRef &pattern, bool enabled) :-
27 messageType(-1),-
28 enabled(enabled)-
29{-
30 parse(pattern);-
31}
executed 24116 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24116
32-
33-
34-
35-
36-
37-
38int QLoggingRule::pass(const QString &cat, QtMsgType msgType) const-
39{-
40-
41 if (messageType > -1
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 != msgType
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
42 return
executed 384 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
0;
executed 384 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
384
43-
44 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
45-
46 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
47 return
executed 127 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
(enabled
enabledDescription
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_QLogging
? 1 : -1);
executed 127 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
44-127
48 else-
49 return
executed 923 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
0;
executed 923 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
923
50 }-
51-
52 const int idx = cat.indexOf(category);-
53 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
54 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
55-
56 if (idx >= 0
idx >= 0Description
TRUEevaluated 75 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
)
0-75
57 return
executed 75 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
(enabled
enabledDescription
TRUEevaluated 27 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_QLogging
? 1 : -1);
executed 75 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
27-75
58 }
never executed: end of block
else if (flags == LeftFilter
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
59-
60 if (idx == 0
idx == 0Description
TRUEevaluated 288081 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
)
0-288081
61 return
executed 288081 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
(enabled
enabledDescription
TRUEevaluated 144041 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 144040 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
? 1 : -1);
executed 288081 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
144040-288081
62 }
never executed: end of block
else if (flags == RightFilter
flags == RightFilterDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
) {
0-18
63-
64 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
65 return
executed 16 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
(enabled
enabledDescription
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QLogging
? 1 : -1);
executed 16 times by 2 tests: return (enabled ? 1 : -1);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
7-16
66 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
2
67 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
2
68 return
executed 576269 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
0;
executed 576269 times by 2 tests: return 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
576269
69}-
70void QLoggingRule::parse(const QStringRef &pattern)-
71{-
72 QStringRef p;-
73-
74-
75 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
76 p = QStringRef(pattern.string(), pattern.position(),-
77 pattern.length() - 6);-
78 messageType = QtDebugMsg;-
79 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
else if (pattern.endsWith(QLatin1String(".info"))
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
80 p = QStringRef(pattern.string(), pattern.position(),-
81 pattern.length() - 5);-
82 messageType = QtInfoMsg;-
83 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QLogging
else if (pattern.endsWith(QLatin1String(".warning"))
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
84 p = QStringRef(pattern.string(), pattern.position(),-
85 pattern.length() - 8);-
86 messageType = QtWarningMsg;-
87 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
else if (pattern.endsWith(QLatin1String(".critical"))
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
88 p = QStringRef(pattern.string(), pattern.position(),-
89 pattern.length() - 9);-
90 messageType = QtCriticalMsg;-
91 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
else {
4
92 p = pattern;-
93 }
executed 24085 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24085
94-
95 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
96 flags = FullText;-
97 }
executed 63 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
else {
63
98 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
99 flags |= LeftFilter;-
100 p = QStringRef(p.string(), p.position(), p.length() - 1);-
101 }
executed 24040 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24040
102 if (p.startsWith(QLatin1Char('*'))
p.startsWith(QLatin1Char('*'))Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEevaluated 24028 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
) {
25-24028
103 flags |= RightFilter;-
104 p = QStringRef(p.string(), p.position() + 1, p.length() - 1);-
105 }
executed 25 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
25
106 if (p.contains(QLatin1Char('*'))
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
107 flags = 0;
executed 3 times by 1 test: flags = 0;
Executed by:
  • tst_QLoggingRegistry
3
108 }
executed 24053 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24053
109-
110 category = p.toString();-
111}
executed 24116 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24116
112void QLoggingSettingsParser::setContent(const QString &content)-
113{-
114 QString content_ = content;-
115 QTextStream stream(&content_, QIODevice::ReadOnly);-
116 setContent(stream);-
117}
executed 24025 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24025
118-
119-
120-
121-
122-
123void QLoggingSettingsParser::setContent(QTextStream &stream)-
124{-
125 _rules.clear();-
126 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
127 QString line = stream.readLine();-
128-
129-
130 line = line.simplified();-
131 line.remove(QLatin1Char(' '));-
132-
133-
134 if (line.startsWith(QLatin1Char(';'))
line.startsWit...tin1Char(';'))Description
TRUEnever evaluated
FALSEevaluated 24089 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
)
0-24089
135 continue;
never executed: continue;
0
136-
137 if (line.startsWith(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(QLatin1Char(']'))
line.endsWith(...tin1Char(']'))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEnever evaluated
) {
0-24080
138-
139 _section = line.mid(1, line.size() - 2);-
140 continue;
executed 9 times by 1 test: continue;
Executed by:
  • tst_QLoggingRegistry
9
141 }-
142-
143 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
144 int equalPos = line.indexOf(QLatin1Char('='));-
145 if (equalPos != -1
equalPos != -1Description
TRUEevaluated 24079 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
) {
0-24079
146 if (line.lastIndexOf(QLatin1Char('=')) == equalPos
line.lastIndex...)) == equalPosDescription
TRUEevaluated 24079 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
FALSEnever evaluated
) {
0-24079
147 const QStringRef pattern = line.leftRef(equalPos);-
148 const QStringRef valueStr = line.midRef(equalPos + 1);-
149 int value = -1;-
150 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
151 value = 1;
executed 12029 times by 2 tests: value = 1;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
12029
152 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
153 value = 0;
executed 12041 times by 2 tests: value = 0;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
12041
154 QLoggingRule rule(pattern, (value == 1));-
155 if (rule.flags != 0
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
value != -1)
(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
156 _rules.append(rule);
executed 24069 times by 2 tests: _rules.append(rule);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24069
157 else-
158 QMessageLogger(__FILE__, 227, __FUNCTION__, "qt.core.logging").warning("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
executed 10 times by 2 tests: QMessageLogger(__FILE__, 227, __FUNCTION__, "qt.core.logging").warning("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
10
159 } else {-
160 QMessageLogger(__FILE__, 229, __FUNCTION__, "qt.core.logging").warning("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());-
161 }
never executed: end of block
0
162 }-
163 }
executed 24079 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24079
164 }
executed 24080 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24080
165}
executed 24031 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24031
166-
167-
168-
169-
170-
171QLoggingRegistry::QLoggingRegistry()-
172 : categoryFilter(defaultCategoryFilter)-
173{-
174}
executed 672 times by 33 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
  • ...
672
175-
176static bool qtLoggingDebug()-
177{-
178 static const bool debugEnv = qEnvironmentVariableIsSet("QT_LOGGING_DEBUG");-
179 return
executed 24023 times by 2 tests: return debugEnv;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
debugEnv;
executed 24023 times by 2 tests: return debugEnv;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24023
180}-
181-
182static QVector<QLoggingRule> loadRulesFromFile(const QString &filePath)-
183{-
184 QFile file(filePath);-
185 if (file.open(QIODevice::ReadOnly | QIODevice::Text)
file.open(QIOD...ODevice::Text)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 870 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_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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
) {
4-870
186 if (qtLoggingDebug()
qtLoggingDebug()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
)
0-4
187 QMessageLogger(__FILE__, 256, __FUNCTION__, "qt.core.logging").debug("Loading \"%s\" ...",
never executed: QMessageLogger(__FILE__, 256, __FUNCTION__, "qt.core.logging").debug("Loading \"%s\" ...", QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
0
188 QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
never executed: QMessageLogger(__FILE__, 256, __FUNCTION__, "qt.core.logging").debug("Loading \"%s\" ...", QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
0
189 QTextStream stream(&file);-
190 QLoggingSettingsParser parser;-
191 parser.setContent(stream);-
192 return
executed 4 times by 1 test: return parser.rules();
Executed by:
  • tst_QLoggingRegistry
parser.rules();
executed 4 times by 1 test: return parser.rules();
Executed by:
  • tst_QLoggingRegistry
4
193 }-
194 return
executed 870 times by 23 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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
QVector<QLoggingRule>();
executed 870 times by 23 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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
870
195}-
196-
197-
198-
199-
200-
201-
202void QLoggingRegistry::init()-
203{-
204 QVector<QLoggingRule> er, qr, cr;-
205-
206 const QByteArray rulesFilePath = qgetenv("QT_LOGGING_CONF");-
207 if (!rulesFilePath.isEmpty()
!rulesFilePath.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 868 times by 22 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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
)
3-868
208 er = loadRulesFromFile(QFile::decodeName(rulesFilePath));
executed 3 times by 1 test: er = loadRulesFromFile(QFile::decodeName(rulesFilePath));
Executed by:
  • tst_QLoggingRegistry
3
209-
210 const QByteArray rulesSrc = qgetenv("QT_LOGGING_RULES").replace(';', '\n');-
211 if (!rulesSrc.isEmpty()
!rulesSrc.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 869 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_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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
) {
2-869
212 QTextStream stream(rulesSrc);-
213 QLoggingSettingsParser parser;-
214 parser.setSection(([]() -> QString { enum { Size = sizeof(u"" "Rules")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Rules" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_QLoggingRegistry
qstring_literal_temp;
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_QLoggingRegistry
}()));
2
215 parser.setContent(stream);-
216 er += parser.rules();-
217 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
2
218-
219 const QString configFileName = ([]() -> QString { enum { Size = sizeof(u"" "qtlogging.ini")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qtlogging.ini" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 871 times by 23 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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
qstring_literal_temp;
executed 871 times by 23 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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
}());
871
220-
221-
222-
223 const QString qtConfigPath-
224 = QDir(QLibraryInfo::location(QLibraryInfo::DataPath)).absoluteFilePath(configFileName);-
225 qr = loadRulesFromFile(qtConfigPath);-
226-
227-
228-
229 const QString envPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation,-
230 QString::fromLatin1("QtProject/") + configFileName);-
231 if (!envPath.isEmpty()
!envPath.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 869 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_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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
)
1-869
232 cr = loadRulesFromFile(envPath);
executed 1 time by 1 test: cr = loadRulesFromFile(envPath);
Executed by:
  • tst_QLoggingRegistry
1
233-
234 const QMutexLocker locker(&registryMutex);-
235-
236 envRules = std::move(er);-
237 qtConfigRules = std::move(qr);-
238 configRules = std::move(cr);-
239-
240 if (!envRules.isEmpty()
!envRules.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLoggingRegistry
FALSEevaluated 867 times by 22 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_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()
!qtConfigRules.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 867 times by 22 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_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()
!configRules.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 867 times by 22 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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
) {
0-867
241 updateRules();-
242 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QLoggingRegistry
3
243}
executed 870 times by 23 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_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
870
244-
245-
246-
247-
248-
249-
250-
251void QLoggingRegistry::registerCategory(QLoggingCategory *cat, QtMsgType enableForLevel)-
252{-
253 QMutexLocker locker(&registryMutex);-
254-
255 if (!categories.contains(cat)
!categories.contains(cat)Description
TRUEevaluated 846 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-846
256 categories.insert(cat, enableForLevel);-
257 (*categoryFilter)(cat);-
258 }
executed 846 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
  • ...
846
259}
executed 846 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
  • ...
846
260-
261-
262-
263-
264-
265void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat)-
266{-
267 QMutexLocker locker(&registryMutex);-
268 categories.remove(cat);-
269}
executed 1425 times by 307 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
  • ...
1425
270-
271-
272-
273-
274-
275void QLoggingRegistry::setApiRules(const QString &content)-
276{-
277 QLoggingSettingsParser parser;-
278 parser.setSection(([]() -> QString { enum { Size = sizeof(u"" "Rules")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Rules" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 24019 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
qstring_literal_temp;
executed 24019 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
}()));
24019
279 parser.setContent(content);-
280-
281 if (qtLoggingDebug()
qtLoggingDebug()Description
TRUEnever evaluated
FALSEevaluated 24019 times by 2 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
)
0-24019
282 QMessageLogger(__FILE__, 351, __FUNCTION__, "qt.core.logging").debug("Loading logging rules set by QLoggingCategory::setFilterRules ...");
never executed: QMessageLogger(__FILE__, 351, __FUNCTION__, "qt.core.logging").debug("Loading logging rules set by QLoggingCategory::setFilterRules ...");
0
283-
284 const QMutexLocker locker(&registryMutex);-
285-
286 apiRules = parser.rules();-
287-
288 updateRules();-
289}
executed 24019 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24019
290-
291-
292-
293-
294-
295-
296-
297void QLoggingRegistry::updateRules()-
298{-
299 rules = qtConfigRules + configRules + apiRules + envRules;-
300-
301 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(categories.keys())>::type> _container_((categories.keys())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QLoggingCategory *cat = *_container_.i; _container_.control; _container_.control = 0)-
302 (*
executed 216136 times by 2 tests: (*categoryFilter)(cat);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
categoryFilter)(cat);
executed 216136 times by 2 tests: (*categoryFilter)(cat);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
216136
303}
executed 24025 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
24025
304-
305-
306-
307-
308-
309QLoggingCategory::CategoryFilter-
310QLoggingRegistry::installFilter(QLoggingCategory::CategoryFilter filter)-
311{-
312 QMutexLocker locker(&registryMutex);-
313-
314 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
315 filter = defaultCategoryFilter;
executed 3 times by 1 test: filter = defaultCategoryFilter;
Executed by:
  • tst_QLogging
3
316-
317 QLoggingCategory::CategoryFilter old = categoryFilter;-
318 categoryFilter = filter;-
319-
320 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(categories.keys())>::type> _container_((categories.keys())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QLoggingCategory *cat = *_container_.i; _container_.control; _container_.control = 0)-
321 (*
executed 22 times by 1 test: (*categoryFilter)(cat);
Executed by:
  • tst_QLogging
categoryFilter)(cat);
executed 22 times by 1 test: (*categoryFilter)(cat);
Executed by:
  • tst_QLogging
22
322-
323 return
executed 7 times by 1 test: return old;
Executed by:
  • tst_QLogging
old;
executed 7 times by 1 test: return old;
Executed by:
  • tst_QLogging
7
324}-
325-
326QLoggingRegistry *QLoggingRegistry::instance()-
327{-
328 return
executed 244159 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
  • ...
qtLoggingRegistry();
executed 244159 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
  • ...
244159
329}-
330-
331-
332-
333-
334-
335-
336-
337void QLoggingRegistry::defaultCategoryFilter(QLoggingCategory *cat)-
338{-
339 QLoggingRegistry *reg = QLoggingRegistry::instance();-
340 ((!(reg->categories.contains(cat))) ? qt_assert("reg->categories.contains(cat)",__FILE__,409) : qt_noop());-
341 QtMsgType enableForLevel = reg->categories.value(cat);-
342-
343-
344-
345 bool debug = (enableForLevel == QtDebugMsg);-
346 bool info = debug
debugDescription
TRUEevaluated 168952 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
enableForLevel == QtInfoMsg)
(enableForLevel == QtInfoMsg)Description
TRUEevaluated 24020 times by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 24021 times by 1 test
Evaluated by:
  • tst_QLogging
;
24020-168952
347 bool warning = info
infoDescription
TRUEevaluated 192972 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
enableForLevel == QtWarningMsg)
(enableForLeve... QtWarningMsg)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 24020 times by 1 test
Evaluated by:
  • tst_QLogging
;
1-192972
348 bool critical = warning
warningDescription
TRUEevaluated 192973 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
enableForLevel == QtCriticalMsg)
(enableForLeve...QtCriticalMsg)Description
TRUEnever evaluated
FALSEevaluated 24020 times by 1 test
Evaluated by:
  • tst_QLogging
;
0-192973
349-
350-
351-
352-
353 if (const
const char *ca...categoryName()Description
TRUEevaluated 216993 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
char *categoryName = cat->categoryName()
const char *ca...categoryName()Description
TRUEevaluated 216993 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-216993
354-
355 if (strcmp(categoryName, "qt") == 0
strcmp(categor...me, "qt") == 0Description
TRUEnever evaluated
FALSEevaluated 216993 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(categoryName, "qt.", 3) == 0
strncmp(catego..."qt.", 3) == 0Description
TRUEevaluated 360 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 216633 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-216993
356 debug = false;
executed 360 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
  • ...
360
357 }
executed 216993 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
  • ...
216993
358-
359 QString categoryName = QLatin1String(cat->categoryName());-
360 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(reg->rules)>::type> _container_((reg->rules)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QLoggingRule &item = *_container_.i; _container_.control; _container_.control = 0) {-
361 int filterpass = item.pass(categoryName, QtDebugMsg);-
362 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
363 debug = (filterpass > 0);
executed 72079 times by 2 tests: debug = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72079
364 filterpass = item.pass(categoryName, QtInfoMsg);-
365 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
366 info = (filterpass > 0);
executed 72067 times by 2 tests: info = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72067
367 filterpass = item.pass(categoryName, QtWarningMsg);-
368 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
369 warning = (filterpass > 0);
executed 72067 times by 2 tests: warning = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72067
370 filterpass = item.pass(categoryName, QtCriticalMsg);-
371 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
372 critical = (filterpass > 0);
executed 72066 times by 2 tests: critical = (filterpass > 0);
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
72066
373 }
executed 216460 times by 2 tests: end of block
Executed by:
  • tst_QLogging
  • tst_QLoggingRegistry
216460
374-
375 cat->setEnabled(QtDebugMsg, debug);-
376 cat->setEnabled(QtInfoMsg, info);-
377 cat->setEnabled(QtWarningMsg, warning);-
378 cat->setEnabled(QtCriticalMsg, critical);-
379}
executed 216993 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
  • ...
216993
380-
381-
382-
Switch to Source codePreprocessed file

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