OpenCoverage

qlogging.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/global/qlogging.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>-
5** Copyright (C) 2016 Intel Corporation.-
6** Contact: https://www.qt.io/licensing/-
7**-
8** This file is part of the QtCore module of the Qt Toolkit.-
9**-
10** $QT_BEGIN_LICENSE:LGPL$-
11** Commercial License Usage-
12** Licensees holding valid commercial Qt licenses may use this file in-
13** accordance with the commercial license agreement provided with the-
14** Software or, alternatively, in accordance with the terms contained in-
15** a written agreement between you and The Qt Company. For licensing terms-
16** and conditions see https://www.qt.io/terms-conditions. For further-
17** information use the contact form at https://www.qt.io/contact-us.-
18**-
19** GNU Lesser General Public License Usage-
20** Alternatively, this file may be used under the terms of the GNU Lesser-
21** General Public License version 3 as published by the Free Software-
22** Foundation and appearing in the file LICENSE.LGPL3 included in the-
23** packaging of this file. Please review the following information to-
24** ensure the GNU Lesser General Public License version 3 requirements-
25** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
26**-
27** GNU General Public License Usage-
28** Alternatively, this file may be used under the terms of the GNU-
29** General Public License version 2.0 or (at your option) the GNU General-
30** Public license version 3 or any later version approved by the KDE Free-
31** Qt Foundation. The licenses are as published by the Free Software-
32** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
33** included in the packaging of this file. Please review the following-
34** information to ensure the GNU General Public License requirements will-
35** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
36** https://www.gnu.org/licenses/gpl-3.0.html.-
37**-
38** $QT_END_LICENSE$-
39**-
40****************************************************************************/-
41-
42#include "qlogging.h"-
43#include "qlist.h"-
44#include "qbytearray.h"-
45#include "qstring.h"-
46#include "qvarlengtharray.h"-
47#include "qdebug.h"-
48#include "qmutex.h"-
49#include "qloggingcategory.h"-
50#ifndef QT_BOOTSTRAPPED-
51#include "qelapsedtimer.h"-
52#include "qdatetime.h"-
53#include "qcoreapplication.h"-
54#include "qthread.h"-
55#include "private/qloggingregistry_p.h"-
56#include "private/qcoreapplication_p.h"-
57#include "private/qsimd_p.h"-
58#endif-
59#ifdef Q_OS_WIN-
60#include <qt_windows.h>-
61#endif-
62#ifdef QT_USE_SLOG2-
63#include <slog2.h>-
64#endif-
65-
66#ifdef Q_OS_ANDROID-
67#include <android/log.h>-
68#endif-
69-
70#if defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)-
71# define SD_JOURNAL_SUPPRESS_LOCATION-
72# include <systemd/sd-journal.h>-
73# include <syslog.h>-
74#endif-
75#if defined(QT_USE_SYSLOG) && !defined(QT_BOOTSTRAPPED)-
76# include <syslog.h>-
77#endif-
78#ifdef Q_OS_UNIX-
79# include <sys/types.h>-
80# include <sys/stat.h>-
81# include <unistd.h>-
82# include "private/qcore_unix_p.h"-
83#endif-
84-
85#ifndef QT_BOOTSTRAPPED-
86#if !defined QT_NO_REGULAREXPRESSION-
87# ifdef __UCLIBC__-
88# if __UCLIBC_HAS_BACKTRACE__-
89# define QLOGGING_HAVE_BACKTRACE-
90# endif-
91# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (QT_HAS_INCLUDE(<cxxabi.h>) && QT_HAS_INCLUDE(<execinfo.h>))-
92# define QLOGGING_HAVE_BACKTRACE-
93# endif-
94#endif-
95-
96#if defined(QT_USE_SLOG2)-
97extern char *__progname;-
98#endif-
99-
100#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || QT_HAS_INCLUDE(<sys/syscall.h>))-
101# include <sys/syscall.h>-
102-
103# if defined(Q_OS_ANDROID) && !defined(SYS_gettid)-
104# define SYS_gettid __NR_gettid-
105# endif-
106-
107static long qt_gettid()-
108{-
109 // no error handling-
110 // this syscall has existed since Linux 2.4.11 and cannot fail-
111 return syscall(SYS_gettid);
executed 8 times by 1 test: return syscall(186);
Executed by:
  • tst_qlogging - unknown status
8
112}-
113#elif defined(Q_OS_DARWIN)-
114# include <pthread.h>-
115static int qt_gettid()-
116{-
117 // no error handling: this call cannot fail-
118 __uint64_t tid;-
119 pthread_threadid_np(NULL, &tid);-
120 return tid;-
121}-
122#elif defined(Q_OS_FREEBSD_KERNEL) && defined(__FreeBSD_version) && __FreeBSD_version >= 900031-
123# include <pthread_np.h>-
124static int qt_gettid()-
125{-
126 return pthread_getthreadid_np();-
127}-
128#else-
129static QT_PREPEND_NAMESPACE(qint64) qt_gettid()-
130{-
131 QT_USE_NAMESPACE-
132 return qintptr(QThread::currentThreadId());-
133}-
134#endif-
135-
136#ifdef QLOGGING_HAVE_BACKTRACE-
137# include <qregularexpression.h>-
138# include <cxxabi.h>-
139# include <execinfo.h>-
140#endif-
141#endif // !QT_BOOTSTRAPPED-
142-
143#include <stdio.h>-
144-
145QT_BEGIN_NAMESPACE-
146-
147#if !defined(Q_CC_MSVC)-
148Q_NORETURN-
149#endif-
150static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message);-
151static void qt_message_print(QtMsgType, const QMessageLogContext &context, const QString &message);-
152-
153static bool isFatal(QtMsgType msgType)-
154{-
155 if (msgType == QtFatalMsg)
msgType == QtFatalMsgDescription
TRUEnever evaluated
FALSEevaluated 267528 times by 161 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-267528
156 return true;
never executed: return true;
0
157-
158 if (msgType == QtCriticalMsg) {
msgType == QtCriticalMsgDescription
TRUEevaluated 39 times by 4 tests
Evaluated by:
  • tst_QDebug
  • tst_QLogging
  • tst_qlogging - unknown status
  • tst_selftests - unknown status
FALSEevaluated 267489 times by 161 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
  • ...
39-267489
159 static bool fatalCriticals = !qEnvironmentVariableIsEmpty("QT_FATAL_CRITICALS");-
160 return fatalCriticals;
executed 39 times by 4 tests: return fatalCriticals;
Executed by:
  • tst_QDebug
  • tst_QLogging
  • tst_qlogging - unknown status
  • tst_selftests - unknown status
39
161 }-
162-
163 if (msgType == QtWarningMsg || msgType == QtCriticalMsg) {
msgType == QtWarningMsgDescription
TRUEevaluated 251597 times by 129 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDesktopWidget
  • tst_QDialogButtonBox
  • tst_QDir
  • ...
FALSEevaluated 15892 times by 72 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBrush
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • ...
msgType == QtCriticalMsgDescription
TRUEnever evaluated
FALSEevaluated 15892 times by 72 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBrush
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • ...
0-251597
164 static bool fatalWarnings = !qEnvironmentVariableIsEmpty("QT_FATAL_WARNINGS");-
165 return fatalWarnings;
executed 251597 times by 129 tests: return fatalWarnings;
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDesktopWidget
  • tst_QDialogButtonBox
  • tst_QDir
  • ...
251597
166 }-
167-
168 return false;
executed 15892 times by 72 tests: return false;
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBrush
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • ...
15892
169}-
170-
171static bool willLogToConsole()-
172{-
173#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT)-
174 // these systems have no stderr, so always log to the system log-
175 return false;-
176#elif defined(QT_BOOTSTRAPPED)-
177 return true;-
178#else-
179 // rules to determine if we'll log preferably to the console:-
180 // 1) if QT_LOGGING_TO_CONSOLE is set, it determines behavior:-
181 // - if it's set to 0, we will not log to console-
182 // - if it's set to 1, we will log to console-
183 // 2) otherwise, we will log to console if we have a console window (Windows)-
184 // or a controlling TTY (Unix). This is done even if stderr was redirected-
185 // to the blackhole device (NUL or /dev/null).-
186-
187 bool ok = true;-
188 uint envcontrol = qgetenv("QT_LOGGING_TO_CONSOLE").toUInt(&ok);-
189 if (ok)
okDescription
TRUEevaluated 24 times by 4 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qlogging - unknown status
  • tst_qprocess - unknown status
  • tst_qsystemsemaphore - unknown status
FALSEnever evaluated
0-24
190 return envcontrol;
executed 24 times by 4 tests: return envcontrol;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qlogging - unknown status
  • tst_qprocess - unknown status
  • tst_qsystemsemaphore - unknown status
24
191-
192# ifdef Q_OS_WIN-
193 return GetConsoleWindow();-
194# elif defined(Q_OS_UNIX)-
195 // if /dev/tty exists, we can only open it if we have a controlling TTY-
196 int devtty = qt_safe_open("/dev/tty", O_RDONLY);-
197 if (devtty == -1 && (errno == ENOENT || errno == EPERM)) {
devtty == -1Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
(*__errno_location ()) == 1Description
TRUEnever evaluated
FALSEnever evaluated
0
198 // no /dev/tty, fall back to isatty on stderr-
199 return isatty(STDERR_FILENO);
never executed: return isatty(2);
0
200 } else if (devtty != -1) {
devtty != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
201 // there is a /dev/tty and we could open it: we have a controlling TTY-
202 qt_safe_close(devtty);-
203 return true;
never executed: return true;
0
204 }-
205-
206 // no controlling TTY-
207 return false;
never executed: return false;
0
208# else-
209# error "Not Unix and not Windows?"-
210# endif-
211#endif-
212}-
213-
214Q_CORE_EXPORT bool qt_logging_to_console()-
215{-
216 static const bool logToConsole = willLogToConsole();-
217 return logToConsole;
executed 120 times by 4 tests: return logToConsole;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qlogging - unknown status
  • tst_qprocess - unknown status
  • tst_qsystemsemaphore - unknown status
120
218}-
219-
220/*!-
221 \class QMessageLogContext-
222 \inmodule QtCore-
223 \brief The QMessageLogContext class provides additional information about a log message.-
224 \since 5.0-
225-
226 The class provides information about the source code location a qDebug(), qInfo(), qWarning(),-
227 qCritical() or qFatal() message was generated.-
228-
229 \note By default, this information is recorded only in debug builds. You can overwrite-
230 this explicitly by defining \c QT_MESSAGELOGCONTEXT or \c{QT_NO_MESSAGELOGCONTEXT}.-
231-
232 \sa QMessageLogger, QtMessageHandler, qInstallMessageHandler()-
233*/-
234-
235/*!-
236 \class QMessageLogger-
237 \inmodule QtCore-
238 \brief The QMessageLogger class generates log messages.-
239 \since 5.0-
240-
241 QMessageLogger is used to generate messages for the Qt logging framework. Usually one uses-
242 it through qDebug(), qInfo(), qWarning(), qCritical, or qFatal() functions,-
243 which are actually macros: For example qDebug() expands to-
244 QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO).debug()-
245 for debug builds, and QMessageLogger(0, 0, 0).debug() for release builds.-
246-
247 One example of direct use is to forward errors that stem from a scripting language, e.g. QML:-
248-
249 \snippet code/qlogging/qlogging.cpp 1-
250-
251 \sa QMessageLogContext, qDebug(), qInfo(), qWarning(), qCritical(), qFatal()-
252*/-
253-
254#ifdef Q_OS_WIN-
255static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) Q_DECL_NOEXCEPT-
256{-
257 size_t len = qstrlen(s);-
258 if (len + 1 > space) {-
259 const size_t skip = len - space + 4; // 4 for "..." + '\0'-
260 s += skip;-
261 len -= skip;-
262 for (int i = 0; i < 3; ++i)-
263 *d++ = L'.';-
264 }-
265 while (len--)-
266 *d++ = *s++;-
267 *d++ = 0;-
268}-
269#endif-
270-
271/*!-
272 \internal-
273*/-
274Q_NEVER_INLINE-
275static QString qt_message(QtMsgType msgType, const QMessageLogContext &context, const char *msg, va_list ap)-
276{-
277 QString buf = QString::vasprintf(msg, ap);-
278 qt_message_print(msgType, context, buf);-
279 return buf;
executed 252232 times by 139 tests: return buf;
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • 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_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
252232
280}-
281-
282#undef qDebug-
283/*!-
284 Logs a debug message specified with format \a msg. Additional-
285 parameters, specified by \a msg, may be used.-
286-
287 \sa qDebug()-
288*/-
289void QMessageLogger::debug(const char *msg, ...) const-
290{-
291 va_list ap;-
292 va_start(ap, msg); // use variable arg list-
293 const QString message = qt_message(QtDebugMsg, context, msg, ap);-
294 va_end(ap);-
295-
296 if (isFatal(QtDebugMsg))
isFatal(QtDebugMsg)Description
TRUEnever evaluated
FALSEevaluated 687 times by 29 tests
Evaluated by:
  • tst_Compiler
  • tst_PlatformSocketEngine
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QLogging
  • tst_QMutex
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QReadWriteLock
  • tst_QSharedPointer
  • tst_QSocks5SocketEngine
  • tst_QSql
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QtConcurrentRun
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • ...
0-687
297 qt_message_fatal(QtDebugMsg, context, message);
never executed: qt_message_fatal(QtDebugMsg, context, message);
0
298}
executed 687 times by 29 tests: end of block
Executed by:
  • tst_Compiler
  • tst_PlatformSocketEngine
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QLogging
  • tst_QMutex
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QReadWriteLock
  • tst_QSharedPointer
  • tst_QSocks5SocketEngine
  • tst_QSql
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_QtConcurrentRun
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • ...
687
299-
300-
301#undef qInfo-
302/*!-
303 Logs an informational message specified with format \a msg. Additional-
304 parameters, specified by \a msg, may be used.-
305-
306 \sa qInfo()-
307 \since 5.5-
308*/-
309void QMessageLogger::info(const char *msg, ...) const-
310{-
311 va_list ap;-
312 va_start(ap, msg); // use variable arg list-
313 const QString message = qt_message(QtInfoMsg, context, msg, ap);-
314 va_end(ap);-
315-
316 if (isFatal(QtInfoMsg))
isFatal(QtInfoMsg)Description
TRUEnever evaluated
FALSEevaluated 95 times by 3 tests
Evaluated by:
  • tst_QLogging
  • tst_qlogging - unknown status
  • tst_selftests - unknown status
0-95
317 qt_message_fatal(QtInfoMsg, context, message);
never executed: qt_message_fatal(QtInfoMsg, context, message);
0
318}
executed 95 times by 3 tests: end of block
Executed by:
  • tst_QLogging
  • tst_qlogging - unknown status
  • tst_selftests - unknown status
95
319-
320/*!-
321 \typedef QMessageLogger::CategoryFunction-
322-
323 This is a typedef for a pointer to a function with the following-
324 signature:-
325-
326 \snippet code/qlogging/qlogging.cpp 2-
327-
328 A function which this signature is generated by Q_DECLARE_LOGGING_CATEGORY,-
329 Q_LOGGING_CATEGORY.-
330-
331 \since 5.3-
332*/-
333-
334/*!-
335 Logs a debug message specified with format \a msg for the context \a cat.-
336 Additional parameters, specified by \a msg, may be used.-
337-
338 \since 5.3-
339 \sa qCDebug()-
340*/-
341void QMessageLogger::debug(const QLoggingCategory &cat, const char *msg, ...) const-
342{-
343 if (!cat.isDebugEnabled())
!cat.isDebugEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
344 return;
never executed: return;
0
345-
346 QMessageLogContext ctxt;-
347 ctxt.copy(context);-
348 ctxt.category = cat.categoryName();-
349-
350 va_list ap;-
351 va_start(ap, msg); // use variable arg list-
352 const QString message = qt_message(QtDebugMsg, ctxt, msg, ap);-
353 va_end(ap);-
354-
355 if (isFatal(QtDebugMsg))
isFatal(QtDebugMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
356 qt_message_fatal(QtDebugMsg, ctxt, message);
never executed: qt_message_fatal(QtDebugMsg, ctxt, message);
0
357}
never executed: end of block
0
358-
359/*!-
360 Logs a debug message specified with format \a msg for the context returned-
361 by \a catFunc. Additional parameters, specified by \a msg, may be used.-
362-
363 \since 5.3-
364 \sa qCDebug()-
365*/-
366void QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc,-
367 const char *msg, ...) const-
368{-
369 const QLoggingCategory &cat = (*catFunc)();-
370 if (!cat.isDebugEnabled())
!cat.isDebugEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
371 return;
never executed: return;
0
372-
373 QMessageLogContext ctxt;-
374 ctxt.copy(context);-
375 ctxt.category = cat.categoryName();-
376-
377 va_list ap;-
378 va_start(ap, msg); // use variable arg list-
379 const QString message = qt_message(QtDebugMsg, ctxt, msg, ap);-
380 va_end(ap);-
381-
382 if (isFatal(QtDebugMsg))
isFatal(QtDebugMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
383 qt_message_fatal(QtDebugMsg, ctxt, message);
never executed: qt_message_fatal(QtDebugMsg, ctxt, message);
0
384}
never executed: end of block
0
385-
386#ifndef QT_NO_DEBUG_STREAM-
387-
388/*!-
389 Logs a debug message using a QDebug stream-
390-
391 \sa qDebug(), QDebug-
392*/-
393QDebug QMessageLogger::debug() const-
394{-
395 QDebug dbg = QDebug(QtDebugMsg);-
396 QMessageLogContext &ctxt = dbg.stream->context;-
397 ctxt.copy(context);-
398 return dbg;
executed 15095 times by 53 tests: return dbg;
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QApplication
  • tst_QBrush
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QLocalSocket
  • tst_QLogging
  • tst_QMdiSubWindow
  • tst_QMetaObject
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QNetworkInterface
  • ...
15095
399}-
400-
401/*!-
402 Logs a debug message into category \a cat using a QDebug stream.-
403-
404 \since 5.3-
405 \sa qCDebug(), QDebug-
406*/-
407QDebug QMessageLogger::debug(const QLoggingCategory &cat) const-
408{-
409 QDebug dbg = QDebug(QtDebugMsg);-
410 if (!cat.isDebugEnabled())
!cat.isDebugEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
411 dbg.stream->message_output = false;
never executed: dbg.stream->message_output = false;
0
412-
413 QMessageLogContext &ctxt = dbg.stream->context;-
414 ctxt.copy(context);-
415 ctxt.category = cat.categoryName();-
416-
417 return dbg;
never executed: return dbg;
0
418}-
419-
420/*!-
421 Logs a debug message into category returned by \a catFunc using a QDebug stream.-
422-
423 \since 5.3-
424 \sa qCDebug(), QDebug-
425*/-
426QDebug QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc) const-
427{-
428 return debug((*catFunc)());
never executed: return debug((*catFunc)());
0
429}-
430-
431/*!-
432 \internal-
433-
434 Returns a QNoDebug object, which is used to ignore debugging output.-
435-
436 \sa QNoDebug, qDebug()-
437*/-
438QNoDebug QMessageLogger::noDebug() const Q_DECL_NOTHROW-
439{-
440 return QNoDebug();
never executed: return QNoDebug();
0
441}-
442-
443#endif-
444-
445/*!-
446 Logs an informational message specified with format \a msg for the context \a cat.-
447 Additional parameters, specified by \a msg, may be used.-
448-
449 \since 5.5-
450 \sa qCInfo()-
451*/-
452void QMessageLogger::info(const QLoggingCategory &cat, const char *msg, ...) const-
453{-
454 if (!cat.isInfoEnabled())
!cat.isInfoEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
455 return;
never executed: return;
0
456-
457 QMessageLogContext ctxt;-
458 ctxt.copy(context);-
459 ctxt.category = cat.categoryName();-
460-
461 va_list ap;-
462 va_start(ap, msg); // use variable arg list-
463 const QString message = qt_message(QtInfoMsg, ctxt, msg, ap);-
464 va_end(ap);-
465-
466 if (isFatal(QtInfoMsg))
isFatal(QtInfoMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
467 qt_message_fatal(QtInfoMsg, ctxt, message);
never executed: qt_message_fatal(QtInfoMsg, ctxt, message);
0
468}
never executed: end of block
0
469-
470/*!-
471 Logs an informational message specified with format \a msg for the context returned-
472 by \a catFunc. Additional parameters, specified by \a msg, may be used.-
473-
474 \since 5.5-
475 \sa qCInfo()-
476*/-
477void QMessageLogger::info(QMessageLogger::CategoryFunction catFunc,-
478 const char *msg, ...) const-
479{-
480 const QLoggingCategory &cat = (*catFunc)();-
481 if (!cat.isInfoEnabled())
!cat.isInfoEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
482 return;
never executed: return;
0
483-
484 QMessageLogContext ctxt;-
485 ctxt.copy(context);-
486 ctxt.category = cat.categoryName();-
487-
488 va_list ap;-
489 va_start(ap, msg); // use variable arg list-
490 const QString message = qt_message(QtInfoMsg, ctxt, msg, ap);-
491 va_end(ap);-
492-
493 if (isFatal(QtInfoMsg))
isFatal(QtInfoMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
494 qt_message_fatal(QtInfoMsg, ctxt, message);
never executed: qt_message_fatal(QtInfoMsg, ctxt, message);
0
495}
never executed: end of block
0
496-
497#ifndef QT_NO_DEBUG_STREAM-
498-
499/*!-
500 Logs an informational message using a QDebug stream.-
501-
502 \since 5.5-
503 \sa qInfo(), QDebug-
504*/-
505QDebug QMessageLogger::info() const-
506{-
507 QDebug dbg = QDebug(QtInfoMsg);-
508 QMessageLogContext &ctxt = dbg.stream->context;-
509 ctxt.copy(context);-
510 return dbg;
executed 14 times by 1 test: return dbg;
Executed by:
  • tst_QLogging
14
511}-
512-
513/*!-
514 Logs an informational message into the category \a cat using a QDebug stream.-
515-
516 \since 5.5-
517 \sa qCInfo(), QDebug-
518*/-
519QDebug QMessageLogger::info(const QLoggingCategory &cat) const-
520{-
521 QDebug dbg = QDebug(QtInfoMsg);-
522 if (!cat.isInfoEnabled())
!cat.isInfoEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
523 dbg.stream->message_output = false;
never executed: dbg.stream->message_output = false;
0
524-
525 QMessageLogContext &ctxt = dbg.stream->context;-
526 ctxt.copy(context);-
527 ctxt.category = cat.categoryName();-
528-
529 return dbg;
never executed: return dbg;
0
530}-
531-
532/*!-
533 Logs an informational message into category returned by \a catFunc using a QDebug stream.-
534-
535 \since 5.5-
536 \sa qCInfo(), QDebug-
537*/-
538QDebug QMessageLogger::info(QMessageLogger::CategoryFunction catFunc) const-
539{-
540 return info((*catFunc)());
never executed: return info((*catFunc)());
0
541}-
542-
543#endif-
544-
545#undef qWarning-
546/*!-
547 Logs a warning message specified with format \a msg. Additional-
548 parameters, specified by \a msg, may be used.-
549-
550 \sa qWarning()-
551*/-
552void QMessageLogger::warning(const char *msg, ...) const-
553{-
554 va_list ap;-
555 va_start(ap, msg); // use variable arg list-
556 const QString message = qt_message(QtWarningMsg, context, msg, ap);-
557 va_end(ap);-
558-
559 if (isFatal(QtWarningMsg))
isFatal(QtWarningMsg)Description
TRUEnever evaluated
FALSEevaluated 251374 times by 126 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDesktopWidget
  • tst_QDialogButtonBox
  • tst_QDir
  • ...
0-251374
560 qt_message_fatal(QtWarningMsg, context, message);
never executed: qt_message_fatal(QtWarningMsg, context, message);
0
561}
executed 251374 times by 126 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDesktopWidget
  • tst_QDialogButtonBox
  • tst_QDir
  • ...
251374
562-
563/*!-
564 Logs a warning message specified with format \a msg for the context \a cat.-
565 Additional parameters, specified by \a msg, may be used.-
566-
567 \since 5.3-
568 \sa qCWarning()-
569*/-
570void QMessageLogger::warning(const QLoggingCategory &cat, const char *msg, ...) const-
571{-
572 if (!cat.isWarningEnabled())
!cat.isWarningEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
573 return;
never executed: return;
0
574-
575 QMessageLogContext ctxt;-
576 ctxt.copy(context);-
577 ctxt.category = cat.categoryName();-
578-
579 va_list ap;-
580 va_start(ap, msg); // use variable arg list-
581 const QString message = qt_message(QtWarningMsg, ctxt, msg, ap);-
582 va_end(ap);-
583-
584 if (isFatal(QtWarningMsg))
isFatal(QtWarningMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
585 qt_message_fatal(QtWarningMsg, ctxt, message);
never executed: qt_message_fatal(QtWarningMsg, ctxt, message);
0
586}
never executed: end of block
0
587-
588/*!-
589 Logs a warning message specified with format \a msg for the context returned-
590 by \a catFunc. Additional parameters, specified by \a msg, may be used.-
591-
592 \since 5.3-
593 \sa qCWarning()-
594*/-
595void QMessageLogger::warning(QMessageLogger::CategoryFunction catFunc,-
596 const char *msg, ...) const-
597{-
598 const QLoggingCategory &cat = (*catFunc)();-
599 if (!cat.isWarningEnabled())
!cat.isWarningEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
600 return;
never executed: return;
0
601-
602 QMessageLogContext ctxt;-
603 ctxt.copy(context);-
604 ctxt.category = cat.categoryName();-
605-
606 va_list ap;-
607 va_start(ap, msg); // use variable arg list-
608 const QString message = qt_message(QtWarningMsg, ctxt, msg, ap);-
609 va_end(ap);-
610-
611 if (isFatal(QtWarningMsg))
isFatal(QtWarningMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
612 qt_message_fatal(QtWarningMsg, ctxt, message);
never executed: qt_message_fatal(QtWarningMsg, ctxt, message);
0
613}
never executed: end of block
0
614-
615#ifndef QT_NO_DEBUG_STREAM-
616/*!-
617 Logs a warning message using a QDebug stream-
618-
619 \sa qWarning(), QDebug-
620*/-
621QDebug QMessageLogger::warning() const-
622{-
623 QDebug dbg = QDebug(QtWarningMsg);-
624 QMessageLogContext &ctxt = dbg.stream->context;-
625 ctxt.copy(context);-
626 return dbg;
executed 222 times by 19 tests: return dbg;
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QDebug
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QLogging
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QNoDebug
  • tst_QObject
  • tst_QProcess
  • tst_QSqlQueryModel
  • tst_QSslSocket
  • tst_QString
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_qlogging - unknown status
222
627}-
628-
629/*!-
630 Logs a warning message into category \a cat using a QDebug stream.-
631-
632 \sa qCWarning(), QDebug-
633*/-
634QDebug QMessageLogger::warning(const QLoggingCategory &cat) const-
635{-
636 QDebug dbg = QDebug(QtWarningMsg);-
637 if (!cat.isWarningEnabled())
!cat.isWarningEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
638 dbg.stream->message_output = false;
never executed: dbg.stream->message_output = false;
0
639-
640 QMessageLogContext &ctxt = dbg.stream->context;-
641 ctxt.copy(context);-
642 ctxt.category = cat.categoryName();-
643-
644 return dbg;
never executed: return dbg;
0
645}-
646-
647/*!-
648 Logs a warning message into category returned by \a catFunc using a QDebug stream.-
649-
650 \since 5.3-
651 \sa qCWarning(), QDebug-
652*/-
653QDebug QMessageLogger::warning(QMessageLogger::CategoryFunction catFunc) const-
654{-
655 return warning((*catFunc)());
never executed: return warning((*catFunc)());
0
656}-
657-
658#endif-
659-
660#undef qCritical-
661-
662/*!-
663 Logs a critical message specified with format \a msg. Additional-
664 parameters, specified by \a msg, may be used.-
665-
666 \sa qCritical()-
667*/-
668void QMessageLogger::critical(const char *msg, ...) const-
669{-
670 va_list ap;-
671 va_start(ap, msg); // use variable arg list-
672 const QString message = qt_message(QtCriticalMsg, context, msg, ap);-
673 va_end(ap);-
674-
675 if (isFatal(QtCriticalMsg))
isFatal(QtCriticalMsg)Description
TRUEnever evaluated
FALSEevaluated 21 times by 3 tests
Evaluated by:
  • tst_QLogging
  • tst_qlogging - unknown status
  • tst_selftests - unknown status
0-21
676 qt_message_fatal(QtCriticalMsg, context, message);
never executed: qt_message_fatal(QtCriticalMsg, context, message);
0
677}
executed 21 times by 3 tests: end of block
Executed by:
  • tst_QLogging
  • tst_qlogging - unknown status
  • tst_selftests - unknown status
21
678-
679/*!-
680 Logs a critical message specified with format \a msg for the context \a cat.-
681 Additional parameters, specified by \a msg, may be used.-
682-
683 \since 5.3-
684 \sa qCCritical()-
685*/-
686void QMessageLogger::critical(const QLoggingCategory &cat, const char *msg, ...) const-
687{-
688 if (!cat.isCriticalEnabled())
!cat.isCriticalEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
689 return;
never executed: return;
0
690-
691 QMessageLogContext ctxt;-
692 ctxt.copy(context);-
693 ctxt.category = cat.categoryName();-
694-
695 va_list ap;-
696 va_start(ap, msg); // use variable arg list-
697 const QString message = qt_message(QtCriticalMsg, ctxt, msg, ap);-
698 va_end(ap);-
699-
700 if (isFatal(QtCriticalMsg))
isFatal(QtCriticalMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
701 qt_message_fatal(QtCriticalMsg, ctxt, message);
never executed: qt_message_fatal(QtCriticalMsg, ctxt, message);
0
702}
never executed: end of block
0
703-
704/*!-
705 Logs a critical message specified with format \a msg for the context returned-
706 by \a catFunc. Additional parameters, specified by \a msg, may be used.-
707-
708 \since 5.3-
709 \sa qCCritical()-
710*/-
711void QMessageLogger::critical(QMessageLogger::CategoryFunction catFunc,-
712 const char *msg, ...) const-
713{-
714 const QLoggingCategory &cat = (*catFunc)();-
715 if (!cat.isCriticalEnabled())
!cat.isCriticalEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
716 return;
never executed: return;
0
717-
718 QMessageLogContext ctxt;-
719 ctxt.copy(context);-
720 ctxt.category = cat.categoryName();-
721-
722 va_list ap;-
723 va_start(ap, msg); // use variable arg list-
724 const QString message = qt_message(QtCriticalMsg, ctxt, msg, ap);-
725 va_end(ap);-
726-
727 if (isFatal(QtCriticalMsg))
isFatal(QtCriticalMsg)Description
TRUEnever evaluated
FALSEnever evaluated
0
728 qt_message_fatal(QtCriticalMsg, ctxt, message);
never executed: qt_message_fatal(QtCriticalMsg, ctxt, message);
0
729}
never executed: end of block
0
730-
731#ifndef QT_NO_DEBUG_STREAM-
732/*!-
733 Logs a critical message using a QDebug stream-
734-
735 \sa qCritical(), QDebug-
736*/-
737QDebug QMessageLogger::critical() const-
738{-
739 QDebug dbg = QDebug(QtCriticalMsg);-
740 QMessageLogContext &ctxt = dbg.stream->context;-
741 ctxt.copy(context);-
742 return dbg;
executed 18 times by 2 tests: return dbg;
Executed by:
  • tst_QDebug
  • tst_QLogging
18
743}-
744-
745/*!-
746 Logs a critical message into category \a cat using a QDebug stream.-
747-
748 \since 5.3-
749 \sa qCCritical(), QDebug-
750*/-
751QDebug QMessageLogger::critical(const QLoggingCategory &cat) const-
752{-
753 QDebug dbg = QDebug(QtCriticalMsg);-
754 if (!cat.isCriticalEnabled())
!cat.isCriticalEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
0
755 dbg.stream->message_output = false;
never executed: dbg.stream->message_output = false;
0
756-
757 QMessageLogContext &ctxt = dbg.stream->context;-
758 ctxt.copy(context);-
759 ctxt.category = cat.categoryName();-
760-
761 return dbg;
never executed: return dbg;
0
762}-
763-
764/*!-
765 Logs a critical message into category returned by \a catFunc using a QDebug stream.-
766-
767 \since 5.3-
768 \sa qCCritical(), QDebug-
769*/-
770QDebug QMessageLogger::critical(QMessageLogger::CategoryFunction catFunc) const-
771{-
772 return critical((*catFunc)());
never executed: return critical((*catFunc)());
0
773}-
774-
775#endif-
776-
777#undef qFatal-
778/*!-
779 Logs a fatal message specified with format \a msg. Additional-
780 parameters, specified by \a msg, may be used.-
781-
782 \sa qFatal()-
783*/-
784void QMessageLogger::fatal(const char *msg, ...) const Q_DECL_NOTHROW-
785{-
786 QString message;-
787-
788 va_list ap;-
789 va_start(ap, msg); // use variable arg list-
790 QT_TERMINATE_ON_EXCEPTION(message = qt_message(QtFatalMsg, context, msg, ap));-
791 va_end(ap);-
792-
793 qt_message_fatal(QtFatalMsg, context, message);-
794}
never executed: end of block
0
795-
796/*!-
797 \internal-
798*/-
799Q_AUTOTEST_EXPORT QByteArray qCleanupFuncinfo(QByteArray info)-
800{-
801 // Strip the function info down to the base function name-
802 // note that this throws away the template definitions,-
803 // the parameter types (overloads) and any const/volatile qualifiers.-
804-
805 if (info.isEmpty())
info.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 161 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
0-161
806 return info;
never executed: return info;
0
807-
808 int pos;-
809-
810 // Skip trailing [with XXX] for templates (gcc), but make-
811 // sure to not affect Objective-C message names.-
812 pos = info.size() - 1;-
813 if (info.endsWith(']') && !(info.startsWith('+') || info.startsWith('-'))) {
info.endsWith(']')Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
info.startsWith('+')Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qmessagehandler
info.startsWith('-')Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qmessagehandler
1-138
814 while (--pos) {
--posDescription
TRUEevaluated 3336 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qmessagehandler
20-3336
815 if (info.at(pos) == '[')
info.at(pos) == '['Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 3316 times by 1 test
Evaluated by:
  • tst_qmessagehandler
20-3316
816 info.truncate(pos);
executed 20 times by 1 test: info.truncate(pos);
Executed by:
  • tst_qmessagehandler
20
817 }
executed 3336 times by 1 test: end of block
Executed by:
  • tst_qmessagehandler
3336
818 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qmessagehandler
20
819-
820 // operator names with '(', ')', '<', '>' in it-
821 static const char operator_call[] = "operator()";-
822 static const char operator_lessThan[] = "operator<";-
823 static const char operator_greaterThan[] = "operator>";-
824 static const char operator_lessThanEqual[] = "operator<=";-
825 static const char operator_greaterThanEqual[] = "operator>=";-
826-
827 // canonize operator names-
828 info.replace("operator ", "operator");-
829-
830 // remove argument list-
831 forever {-
832 int parencount = 0;-
833 pos = info.lastIndexOf(')');-
834 if (pos == -1) {
pos == -1Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 168 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
5-168
835 // Don't know how to parse this function name-
836 return info;
executed 5 times by 1 test: return info;
Executed by:
  • tst_qmessagehandler
5
837 }-
838-
839 // find the beginning of the argument list-
840 --pos;-
841 ++parencount;-
842 while (pos && parencount) {
posDescription
TRUEevaluated 1276 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEnever evaluated
parencountDescription
TRUEevaluated 1108 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 168 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
0-1276
843 if (info.at(pos) == ')')
info.at(pos) == ')'Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 1096 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
12-1096
844 ++parencount;
executed 12 times by 1 test: ++parencount;
Executed by:
  • tst_qmessagehandler
12
845 else if (info.at(pos) == '(')
info.at(pos) == '('Description
TRUEevaluated 180 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 916 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
180-916
846 --parencount;
executed 180 times by 2 tests: --parencount;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
180
847 --pos;-
848 }
executed 1108 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
1108
849 if (parencount != 0)
parencount != 0Description
TRUEnever evaluated
FALSEevaluated 168 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
0-168
850 return info;
never executed: return info;
0
851-
852 info.truncate(++pos);-
853-
854 if (info.at(pos - 1) == ')') {
info.at(pos - 1) == ')'Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 154 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
14-154
855 if (info.indexOf(operator_call) == pos - (int)strlen(operator_call))
info.indexOf(o...operator_call)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qmessagehandler
2-12
856 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qmessagehandler
2
857-
858 // this function returns a pointer to a function-
859 // and we matched the arguments of the return type's parameter list-
860 // try again-
861 info.remove(0, info.indexOf('('));-
862 info.chop(1);-
863 continue;
executed 12 times by 1 test: continue;
Executed by:
  • tst_qmessagehandler
12
864 } else {-
865 break;
executed 154 times by 2 tests: break;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
154
866 }-
867 }-
868-
869 // find the beginning of the function name-
870 int parencount = 0;-
871 int templatecount = 0;-
872 --pos;-
873-
874 // make sure special characters in operator names are kept-
875 if (pos > -1) {
pos > -1Description
TRUEevaluated 156 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEnever evaluated
0-156
876 switch (info.at(pos)) {-
877 case ')':
executed 2 times by 1 test: case ')':
Executed by:
  • tst_qmessagehandler
2
878 if (info.indexOf(operator_call) == pos - (int)strlen(operator_call) + 1)
info.indexOf(o...ator_call) + 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEnever evaluated
0-2
879 pos -= 2;
executed 2 times by 1 test: pos -= 2;
Executed by:
  • tst_qmessagehandler
2
880 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qmessagehandler
2
881 case '<':
executed 2 times by 1 test: case '<':
Executed by:
  • tst_qmessagehandler
2
882 if (info.indexOf(operator_lessThan) == pos - (int)strlen(operator_lessThan) + 1)
info.indexOf(o..._lessThan) + 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEnever evaluated
0-2
883 --pos;
executed 2 times by 1 test: --pos;
Executed by:
  • tst_qmessagehandler
2
884 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qmessagehandler
2
885 case '>':
executed 8 times by 1 test: case '>':
Executed by:
  • tst_qmessagehandler
8
886 if (info.indexOf(operator_greaterThan) == pos - (int)strlen(operator_greaterThan) + 1)
info.indexOf(o...eaterThan) + 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmessagehandler
2-6
887 --pos;
executed 2 times by 1 test: --pos;
Executed by:
  • tst_qmessagehandler
2
888 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qmessagehandler
8
889 case '=': {
executed 3 times by 1 test: case '=':
Executed by:
  • tst_qmessagehandler
3
890 int operatorLength = (int)strlen(operator_lessThanEqual);-
891 if (info.indexOf(operator_lessThanEqual) == pos - operatorLength + 1)
info.indexOf(o...atorLength + 1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmessagehandler
1-2
892 pos -= 2;
executed 1 time by 1 test: pos -= 2;
Executed by:
  • tst_qmessagehandler
1
893 else if (info.indexOf(operator_greaterThanEqual) == pos - operatorLength + 1)
info.indexOf(o...atorLength + 1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
1
894 pos -= 2;
executed 1 time by 1 test: pos -= 2;
Executed by:
  • tst_qmessagehandler
1
895 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_qmessagehandler
3
896 }-
897 default:
executed 141 times by 2 tests: default:
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
141
898 break;
executed 141 times by 2 tests: break;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
141
899 }-
900 }-
901-
902 while (pos > -1) {
pos > -1Description
TRUEevaluated 5144 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
13-5144
903 if (parencount < 0 || templatecount < 0)
parencount < 0Description
TRUEnever evaluated
FALSEevaluated 5144 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
templatecount < 0Description
TRUEnever evaluated
FALSEevaluated 5144 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
0-5144
904 return info;
never executed: return info;
0
905-
906 char c = info.at(pos);-
907 if (c == ')')
c == ')'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 5143 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
1-5143
908 ++parencount;
executed 1 time by 1 test: ++parencount;
Executed by:
  • tst_qmessagehandler
1
909 else if (c == '(')
c == '('Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 5142 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
1-5142
910 --parencount;
executed 1 time by 1 test: --parencount;
Executed by:
  • tst_qmessagehandler
1
911 else if (c == '>')
c == '>'Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 5060 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
82-5060
912 ++templatecount;
executed 82 times by 1 test: ++templatecount;
Executed by:
  • tst_qmessagehandler
82
913 else if (c == '<')
c == '<'Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 4978 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
82-4978
914 --templatecount;
executed 82 times by 1 test: --templatecount;
Executed by:
  • tst_qmessagehandler
82
915 else if (c == ' ' && templatecount == 0 && parencount == 0)
c == ' 'Description
TRUEevaluated 293 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 4685 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
templatecount == 0Description
TRUEevaluated 143 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 150 times by 1 test
Evaluated by:
  • tst_qmessagehandler
parencount == 0Description
TRUEevaluated 143 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEnever evaluated
0-4685
916 break;
executed 143 times by 2 tests: break;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
143
917-
918 --pos;-
919 }
executed 5001 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
5001
920 info = info.mid(pos + 1);-
921-
922 // remove trailing '*', '&' that are part of the return argument-
923 while ((info.at(0) == '*')
(info.at(0) == '*')Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 157 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
1-157
924 || (info.at(0) == '&'))
(info.at(0) == '&')Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 156 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
1-156
925 info = info.mid(1);
executed 2 times by 1 test: info = info.mid(1);
Executed by:
  • tst_qmessagehandler
2
926-
927 // we have the full function name now.-
928 // clean up the templates-
929 while ((pos = info.lastIndexOf('>')) != -1) {
(pos = info.la...Of('>')) != -1Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 153 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
27-153
930 if (!info.contains('<'))
!info.contains('<')Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qmessagehandler
3-24
931 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_qmessagehandler
3
932-
933 // find the matching close-
934 int end = pos;-
935 templatecount = 1;-
936 --pos;-
937 while (pos && templatecount) {
posDescription
TRUEevaluated 1654 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEnever evaluated
templatecountDescription
TRUEevaluated 1630 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qmessagehandler
0-1654
938 char c = info.at(pos);-
939 if (c == '>')
c == '>'Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 1572 times by 1 test
Evaluated by:
  • tst_qmessagehandler
58-1572
940 ++templatecount;
executed 58 times by 1 test: ++templatecount;
Executed by:
  • tst_qmessagehandler
58
941 else if (c == '<')
c == '<'Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 1490 times by 1 test
Evaluated by:
  • tst_qmessagehandler
82-1490
942 --templatecount;
executed 82 times by 1 test: --templatecount;
Executed by:
  • tst_qmessagehandler
82
943 --pos;-
944 }
executed 1630 times by 1 test: end of block
Executed by:
  • tst_qmessagehandler
1630
945 ++pos;-
946 info.remove(pos, end - pos + 1);-
947 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qmessagehandler
24
948-
949 return info;
executed 156 times by 2 tests: return info;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
156
950}-
951-
952// tokens as recognized in QT_MESSAGE_PATTERN-
953static const char categoryTokenC[] = "%{category}";-
954static const char typeTokenC[] = "%{type}";-
955static const char messageTokenC[] = "%{message}";-
956static const char fileTokenC[] = "%{file}";-
957static const char lineTokenC[] = "%{line}";-
958static const char functionTokenC[] = "%{function}";-
959static const char pidTokenC[] = "%{pid}";-
960static const char appnameTokenC[] = "%{appname}";-
961static const char threadidTokenC[] = "%{threadid}";-
962static const char qthreadptrTokenC[] = "%{qthreadptr}";-
963static const char timeTokenC[] = "%{time"; //not a typo: this command has arguments-
964static const char backtraceTokenC[] = "%{backtrace"; //ditto-
965static const char ifCategoryTokenC[] = "%{if-category}";-
966static const char ifDebugTokenC[] = "%{if-debug}";-
967static const char ifInfoTokenC[] = "%{if-info}";-
968static const char ifWarningTokenC[] = "%{if-warning}";-
969static const char ifCriticalTokenC[] = "%{if-critical}";-
970static const char ifFatalTokenC[] = "%{if-fatal}";-
971static const char endifTokenC[] = "%{endif}";-
972static const char emptyTokenC[] = "";-
973-
974static const char defaultPattern[] = "%{if-category}%{category}: %{endif}%{message}";-
975-
976-
977struct QMessagePattern {-
978 QMessagePattern();-
979 ~QMessagePattern();-
980-
981 void setPattern(const QString &pattern);-
982-
983 // 0 terminated arrays of literal tokens / literal or placeholder tokens-
984 const char **literals;-
985 const char **tokens;-
986 QList<QString> timeArgs; // timeFormats in sequence of %{time-
987#ifndef QT_BOOTSTRAPPED-
988 QElapsedTimer timer;-
989#endif-
990#ifdef QLOGGING_HAVE_BACKTRACE-
991 struct BacktraceParams {-
992 QString backtraceSeparator;-
993 int backtraceDepth;-
994 };-
995 QVector<BacktraceParams> backtraceArgs; // backtrace argumens in sequence of %{backtrace-
996#endif-
997-
998 bool fromEnvironment;-
999 static QBasicMutex mutex;-
1000};-
1001#ifdef QLOGGING_HAVE_BACKTRACE-
1002Q_DECLARE_TYPEINFO(QMessagePattern::BacktraceParams, Q_MOVABLE_TYPE);-
1003#endif-
1004-
1005QBasicMutex QMessagePattern::mutex;-
1006-
1007QMessagePattern::QMessagePattern()-
1008 : literals(0)-
1009 , tokens(0)-
1010 , fromEnvironment(false)-
1011{-
1012#ifndef QT_BOOTSTRAPPED-
1013 timer.start();-
1014#endif-
1015 const QString envPattern = QString::fromLocal8Bit(qgetenv("QT_MESSAGE_PATTERN"));-
1016 if (envPattern.isEmpty()) {
envPattern.isEmpty()Description
TRUEevaluated 435 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
13-435
1017 setPattern(QLatin1String(defaultPattern));-
1018 } else {
executed 435 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
435
1019 setPattern(envPattern);-
1020 fromEnvironment = true;-
1021 }
executed 13 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
13
1022}-
1023-
1024QMessagePattern::~QMessagePattern()-
1025{-
1026 for (int i = 0; literals[i]; ++i)
literals[i]Description
TRUEevaluated 387 times by 108 tests
Evaluated by:
  • tst_gestures - 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_qabstractitemview - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qbrush - unknown status
  • tst_qbuffer - unknown status
  • tst_qbytearray - unknown status
  • tst_qcolor - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdatastream - unknown status
  • tst_qdatetime - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdialogbuttonbox - unknown status
  • tst_qdirmodel - unknown status
  • tst_qdrag - unknown status
  • ...
FALSEevaluated 380 times by 108 tests
Evaluated by:
  • tst_gestures - 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_qabstractitemview - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qbrush - unknown status
  • tst_qbuffer - unknown status
  • tst_qbytearray - unknown status
  • tst_qcolor - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdatastream - unknown status
  • tst_qdatetime - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdialogbuttonbox - unknown status
  • tst_qdirmodel - unknown status
  • tst_qdrag - unknown status
  • ...
380-387
1027 delete [] literals[i];
executed 387 times by 108 tests: delete [] literals[i];
Executed by:
  • tst_gestures - 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_qabstractitemview - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qbrush - unknown status
  • tst_qbuffer - unknown status
  • tst_qbytearray - unknown status
  • tst_qcolor - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdatastream - unknown status
  • tst_qdatetime - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdialogbuttonbox - unknown status
  • tst_qdirmodel - unknown status
  • tst_qdrag - unknown status
  • ...
387
1028 delete [] literals;-
1029 literals = 0;-
1030 delete [] tokens;-
1031 tokens = 0;-
1032}
executed 380 times by 108 tests: end of block
Executed by:
  • tst_gestures - 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_qabstractitemview - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qbrush - unknown status
  • tst_qbuffer - unknown status
  • tst_qbytearray - unknown status
  • tst_qcolor - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdatastream - unknown status
  • tst_qdatetime - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdialogbuttonbox - unknown status
  • tst_qdirmodel - unknown status
  • tst_qdrag - unknown status
  • ...
380
1033-
1034void QMessagePattern::setPattern(const QString &pattern)-
1035{-
1036 if (literals) {
literalsDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 448 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
9-448
1037 for (int i = 0; literals[i]; ++i)
literals[i]Description
TRUEevaluated 48 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
9-48
1038 delete [] literals[i];
executed 48 times by 2 tests: delete [] literals[i];
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
48
1039 delete [] literals;-
1040 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
9
1041 delete [] tokens;-
1042 timeArgs.clear();-
1043#ifdef QLOGGING_HAVE_BACKTRACE-
1044 backtraceArgs.clear();-
1045#endif-
1046-
1047 // scanner-
1048 QList<QString> lexemes;-
1049 QString lexeme;-
1050 bool inPlaceholder = false;-
1051 for (int i = 0; i < pattern.size(); ++i) {
i < pattern.size()Description
TRUEevaluated 21226 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 457 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
457-21226
1052 const QChar c = pattern.at(i);-
1053 if ((c == QLatin1Char('%'))
(c == QLatin1Char('%'))Description
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 19346 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1880-19346
1054 && !inPlaceholder) {
!inPlaceholderDescription
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEnever evaluated
0-1880
1055 if ((i + 1 < pattern.size())
(i + 1 < pattern.size())Description
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEnever evaluated
0-1880
1056 && pattern.at(i + 1) == QLatin1Char('{')) {
pattern.at(i +...atin1Char('{')Description
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEnever evaluated
0-1880
1057 // beginning of placeholder-
1058 if (!lexeme.isEmpty()) {
!lexeme.isEmpty()Description
TRUEevaluated 528 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 1352 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
528-1352
1059 lexemes.append(lexeme);-
1060 lexeme.clear();-
1061 }
executed 528 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
528
1062 inPlaceholder = true;-
1063 }
executed 1880 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1880
1064 }
executed 1880 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1880
1065-
1066 lexeme.append(c);-
1067-
1068 if ((c == QLatin1Char('}') && inPlaceholder)) {
c == QLatin1Char('}')Description
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 19346 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
inPlaceholderDescription
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEnever evaluated
0-19346
1069 // end of placeholder-
1070 lexemes.append(lexeme);-
1071 lexeme.clear();-
1072 inPlaceholder = false;-
1073 }
executed 1880 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1880
1074 }
executed 21226 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
21226
1075 if (!lexeme.isEmpty())
!lexeme.isEmpty()Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 444 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
13-444
1076 lexemes.append(lexeme);
executed 13 times by 1 test: lexemes.append(lexeme);
Executed by:
  • tst_qlogging - unknown status
13
1077-
1078 // tokenizer-
1079 QVarLengthArray<const char*> literalsVar;-
1080 tokens = new const char*[lexemes.size() + 1];-
1081 tokens[lexemes.size()] = 0;-
1082-
1083 bool nestedIfError = false;-
1084 bool inIf = false;-
1085 QString error;-
1086-
1087 for (int i = 0; i < lexemes.size(); ++i) {
i < lexemes.size()Description
TRUEevaluated 2421 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 457 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
457-2421
1088 const QString lexeme = lexemes.at(i);-
1089 if (lexeme.startsWith(QLatin1String("%{"))
lexeme.startsW...1String("%{"))Description
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 541 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
541-1880
1090 && lexeme.endsWith(QLatin1Char('}'))) {
lexeme.endsWit...tin1Char('}'))Description
TRUEevaluated 1880 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEnever evaluated
0-1880
1091 // placeholder-
1092 if (lexeme == QLatin1String(typeTokenC)) {
lexeme == QLat...ng(typeTokenC)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 1877 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
3-1877
1093 tokens[i] = typeTokenC;-
1094 } else if (lexeme == QLatin1String(categoryTokenC))
executed 3 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
lexeme == QLat...ategoryTokenC)Description
TRUEevaluated 442 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 1435 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
3-1435
1095 tokens[i] = categoryTokenC;
executed 442 times by 106 tests: tokens[i] = categoryTokenC;
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
442
1096 else if (lexeme == QLatin1String(messageTokenC))
lexeme == QLat...messageTokenC)Description
TRUEevaluated 455 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 980 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
455-980
1097 tokens[i] = messageTokenC;
executed 455 times by 106 tests: tokens[i] = messageTokenC;
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
455
1098 else if (lexeme == QLatin1String(fileTokenC))
lexeme == QLat...ng(fileTokenC)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 979 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-979
1099 tokens[i] = fileTokenC;
executed 1 time by 1 test: tokens[i] = fileTokenC;
Executed by:
  • tst_qmessagehandler
1
1100 else if (lexeme == QLatin1String(lineTokenC))
lexeme == QLat...ng(lineTokenC)Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 977 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
2-977
1101 tokens[i] = lineTokenC;
executed 2 times by 2 tests: tokens[i] = lineTokenC;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
2
1102 else if (lexeme == QLatin1String(functionTokenC))
lexeme == QLat...unctionTokenC)Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 975 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
2-975
1103 tokens[i] = functionTokenC;
executed 2 times by 2 tests: tokens[i] = functionTokenC;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
2
1104 else if (lexeme == QLatin1String(pidTokenC))
lexeme == QLat...ing(pidTokenC)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 974 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-974
1105 tokens[i] = pidTokenC;
executed 1 time by 1 test: tokens[i] = pidTokenC;
Executed by:
  • tst_qlogging - unknown status
1
1106 else if (lexeme == QLatin1String(appnameTokenC))
lexeme == QLat...appnameTokenC)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 973 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-973
1107 tokens[i] = appnameTokenC;
executed 1 time by 1 test: tokens[i] = appnameTokenC;
Executed by:
  • tst_qlogging - unknown status
1
1108 else if (lexeme == QLatin1String(threadidTokenC))
lexeme == QLat...hreadidTokenC)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 972 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-972
1109 tokens[i] = threadidTokenC;
executed 1 time by 1 test: tokens[i] = threadidTokenC;
Executed by:
  • tst_qlogging - unknown status
1
1110 else if (lexeme == QLatin1String(qthreadptrTokenC))
lexeme == QLat...readptrTokenC)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 971 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-971
1111 tokens[i] = qthreadptrTokenC;
executed 1 time by 1 test: tokens[i] = qthreadptrTokenC;
Executed by:
  • tst_qlogging - unknown status
1
1112 else if (lexeme.startsWith(QLatin1String(timeTokenC))) {
lexeme.startsW...g(timeTokenC))Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 965 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
6-965
1113 tokens[i] = timeTokenC;-
1114 int spaceIdx = lexeme.indexOf(QChar::fromLatin1(' '));-
1115 if (spaceIdx > 0)
spaceIdx > 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
0-6
1116 timeArgs.append(lexeme.mid(spaceIdx + 1, lexeme.length() - spaceIdx - 2));
executed 6 times by 1 test: timeArgs.append(lexeme.mid(spaceIdx + 1, lexeme.length() - spaceIdx - 2));
Executed by:
  • tst_qlogging - unknown status
6
1117 else-
1118 timeArgs.append(QString());
never executed: timeArgs.append(QString());
0
1119 } else if (lexeme.startsWith(QLatin1String(backtraceTokenC))) {
lexeme.startsW...ktraceTokenC))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 963 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
2-963
1120#ifdef QLOGGING_HAVE_BACKTRACE-
1121 tokens[i] = backtraceTokenC;-
1122 QString backtraceSeparator = QStringLiteral("|");
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qlogging - unknown status
2
1123 int backtraceDepth = 5;-
1124 QRegularExpression depthRx(QStringLiteral(" depth=(?|\"([^\"]*)\"|([^ }]*))"));
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qlogging - unknown status
2
1125 QRegularExpression separatorRx(QStringLiteral(" separator=(?|\"([^\"]*)\"|([^ }]*))"));
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qlogging - unknown status
2
1126 QRegularExpressionMatch m = depthRx.match(lexeme);-
1127 if (m.hasMatch()) {
m.hasMatch()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
1
1128 int depth = m.capturedRef(1).toInt();-
1129 if (depth <= 0)
depth <= 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
0-1
1130 error += QLatin1String("QT_MESSAGE_PATTERN: %{backtrace} depth must be a number greater than 0\n");
never executed: error += QLatin1String("QT_MESSAGE_PATTERN: %{backtrace} depth must be a number greater than 0\n");
0
1131 else-
1132 backtraceDepth = depth;
executed 1 time by 1 test: backtraceDepth = depth;
Executed by:
  • tst_qlogging - unknown status
1
1133 }-
1134 m = separatorRx.match(lexeme);-
1135 if (m.hasMatch())
m.hasMatch()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
1
1136 backtraceSeparator = m.captured(1);
executed 1 time by 1 test: backtraceSeparator = m.captured(1);
Executed by:
  • tst_qlogging - unknown status
1
1137 BacktraceParams backtraceParams;-
1138 backtraceParams.backtraceDepth = backtraceDepth;-
1139 backtraceParams.backtraceSeparator = backtraceSeparator;-
1140 backtraceArgs.append(backtraceParams);-
1141#else-
1142 error += QLatin1String("QT_MESSAGE_PATTERN: %{backtrace} is not supported by this Qt build\n");-
1143 tokens[i] = "";-
1144#endif-
1145 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
2
1146-
1147#define IF_TOKEN(LEVEL) \-
1148 else if (lexeme == QLatin1String(LEVEL)) { \-
1149 if (inIf) \-
1150 nestedIfError = true; \-
1151 tokens[i] = LEVEL; \-
1152 inIf = true; \-
1153 }-
1154 IF_TOKEN(ifCategoryTokenC)
never executed: nestedIfError = true;
executed 442 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
inIfDescription
TRUEnever evaluated
FALSEevaluated 442 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
lexeme == QLat...ategoryTokenC)Description
TRUEevaluated 442 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 521 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
0-521
1155 IF_TOKEN(ifDebugTokenC)
never executed: nestedIfError = true;
executed 9 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
inIfDescription
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
lexeme == QLat...ifDebugTokenC)Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 512 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
0-512
1156 IF_TOKEN(ifInfoTokenC)
never executed: nestedIfError = true;
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmessagehandler
inIfDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmessagehandler
lexeme == QLat...(ifInfoTokenC)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 506 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
0-506
1157 IF_TOKEN(ifWarningTokenC)
executed 1 time by 1 test: nestedIfError = true;
Executed by:
  • tst_qlogging - unknown status
executed 10 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
inIfDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
lexeme == QLat...WarningTokenC)Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 496 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-496
1158 IF_TOKEN(ifCriticalTokenC)
never executed: nestedIfError = true;
executed 7 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
inIfDescription
TRUEnever evaluated
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
lexeme == QLat...riticalTokenC)Description
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 489 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
0-489
1159 IF_TOKEN(ifFatalTokenC)
never executed: nestedIfError = true;
executed 7 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
inIfDescription
TRUEnever evaluated
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
lexeme == QLat...ifFatalTokenC)Description
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 482 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
0-482
1160#undef IF_TOKEN-
1161 else if (lexeme == QLatin1String(endifTokenC)) {
lexeme == QLat...g(endifTokenC)Description
TRUEevaluated 480 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
2-480
1162 tokens[i] = endifTokenC;-
1163 if (!inIf && !nestedIfError)
!inIfDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 479 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
!nestedIfErrorDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
0-479
1164 error += QLatin1String("QT_MESSAGE_PATTERN: %{endif} without an %{if-*}\n");
executed 1 time by 1 test: error += QLatin1String("QT_MESSAGE_PATTERN: %{endif} without an %{if-*}\n");
Executed by:
  • tst_qlogging - unknown status
1
1165 inIf = false;-
1166 } else {
executed 480 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
480
1167 tokens[i] = emptyTokenC;-
1168 error += QStringLiteral("QT_MESSAGE_PATTERN: Unknown placeholder %1\n")
executed 2 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qlogging - unknown status
2
1169 .arg(lexeme);-
1170 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
2
1171 } else {-
1172 char *literal = new char[lexeme.size() + 1];-
1173 strncpy(literal, lexeme.toLatin1().constData(), lexeme.size());-
1174 literal[lexeme.size()] = '\0';-
1175 literalsVar.append(literal);-
1176 tokens[i] = literal;-
1177 }
executed 541 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
541
1178 }-
1179 if (nestedIfError)
nestedIfErrorDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 456 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-456
1180 error += QLatin1String("QT_MESSAGE_PATTERN: %{if-*} cannot be nested\n");
executed 1 time by 1 test: error += QLatin1String("QT_MESSAGE_PATTERN: %{if-*} cannot be nested\n");
Executed by:
  • tst_qlogging - unknown status
1
1181 else if (inIf)
inIfDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 455 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-455
1182 error += QLatin1String("QT_MESSAGE_PATTERN: missing %{endif}\n");
executed 1 time by 1 test: error += QLatin1String("QT_MESSAGE_PATTERN: missing %{endif}\n");
Executed by:
  • tst_qlogging - unknown status
1
1183 if (!error.isEmpty()) {
!error.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 454 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
3-454
1184#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT)-
1185 OutputDebugString(reinterpret_cast<const wchar_t*>(error.utf16()));-
1186 if (0)-
1187#elif defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB)-
1188 if (!qt_logging_to_console()) {-
1189 OutputDebugString(reinterpret_cast<const wchar_t*>(error.utf16()));-
1190 } else-
1191#endif-
1192 {-
1193 fprintf(stderr, "%s", error.toLocal8Bit().constData());-
1194 fflush(stderr);-
1195 }-
1196 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
3
1197 literals = new const char*[literalsVar.size() + 1];-
1198 literals[literalsVar.size()] = 0;-
1199 memcpy(literals, literalsVar.constData(), literalsVar.size() * sizeof(const char*));-
1200}
executed 457 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
457
1201-
1202#if defined(QLOGGING_HAVE_BACKTRACE) && !defined(QT_BOOTSTRAPPED)-
1203// make sure the function has "Message" in the name so the function is removed-
1204-
1205#if ((defined(Q_CC_GNU) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) || QT_HAS_ATTRIBUTE(optimize)) \-
1206 && !defined(Q_CC_INTEL)-
1207// force skipping the frame pointer, to save the backtrace() function some work-
1208__attribute__((optimize("omit-frame-pointer")))-
1209#endif-
1210static QStringList backtraceFramesForLogMessage(int frameCount)-
1211{-
1212 QStringList result;-
1213 if (frameCount == 0)
frameCount == 0Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
0-16
1214 return result;
never executed: return result;
0
1215-
1216 // The results of backtrace_symbols looks like this:-
1217 // /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]-
1218 // The offset and function name are optional.-
1219 // This regexp tries to extract the library name (without the path) and the function name.-
1220 // This code is protected by QMessagePattern::mutex so it is thread safe on all compilers-
1221 static QRegularExpression rx(QStringLiteral("^(?:[^(]*/)?([^(/]+)\\(([^+]*)(?:[\\+[a-f0-9x]*)?\\) \\[[a-f0-9x]*\\]$"),-
1222 QRegularExpression::OptimizeOnFirstUsageOption);-
1223-
1224 QVarLengthArray<void*, 32> buffer(7 + frameCount);-
1225 int n = backtrace(buffer.data(), buffer.size());-
1226 if (n > 0) {
n > 0Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
0-16
1227 int numberPrinted = 0;-
1228 for (int i = 0; i < n && numberPrinted < frameCount; ++i) {
i < nDescription
TRUEevaluated 156 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
numberPrinted < frameCountDescription
TRUEevaluated 156 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
0-156
1229 QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));-
1230 QString trace = QString::fromLatin1(strings.data()[0]);-
1231 QRegularExpressionMatch m = rx.match(trace);-
1232 if (m.hasMatch()) {
m.hasMatch()Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
0-156
1233 QString library = m.captured(1);-
1234 QString function = m.captured(2);-
1235-
1236 // skip the trace from QtCore that are because of the qDebug itself-
1237 if (!numberPrinted && library.contains(QLatin1String("Qt5Core"))
!numberPrintedDescription
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
library.contai...ng("Qt5Core"))Description
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
16-128
1238 && (function.isEmpty() || function.contains(QLatin1String("Message"), Qt::CaseInsensitive)
function.isEmpty()Description
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
function.conta...seInsensitive)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
4-76
1239 || function.contains(QLatin1String("QDebug")))) {
function.conta...ing("QDebug"))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
0-4
1240 continue;
executed 112 times by 1 test: continue;
Executed by:
  • tst_qlogging - unknown status
112
1241 }-
1242-
1243 if (function.startsWith(QLatin1String("_Z"))) {
function.start...1String("_Z"))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
8-36
1244 QScopedPointer<char, QScopedPointerPodDeleter> demangled(-
1245 abi::__cxa_demangle(function.toUtf8(), 0, 0, 0));-
1246 if (demangled)
demangledDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
0-8
1247 function = QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
executed 8 times by 1 test: function = QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
Executed by:
  • tst_qlogging - unknown status
8
1248 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
8
1249-
1250 if (function.isEmpty()) {
function.isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
10-34
1251 result.append(QLatin1Char('?') + library + QLatin1Char('?'));-
1252 } else {
executed 10 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
10
1253 result.append(function);-
1254 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
34
1255 } else {-
1256 if (numberPrinted == 0) {
numberPrinted == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1257 // innermost, unknown frames are usually the logging framework itself-
1258 continue;
never executed: continue;
0
1259 }-
1260 result.append(QStringLiteral("???"));
never executed: return qstring_literal_temp;
0
1261 }
never executed: end of block
0
1262 numberPrinted++;-
1263 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
44
1264 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
16
1265 return result;
executed 16 times by 1 test: return result;
Executed by:
  • tst_qlogging - unknown status
16
1266}-
1267-
1268static QString formatBacktraceForLogMessage(const QMessagePattern::BacktraceParams backtraceParams,-
1269 const char *function)-
1270{-
1271 QString backtraceSeparator = backtraceParams.backtraceSeparator;-
1272 int backtraceDepth = backtraceParams.backtraceDepth;-
1273-
1274 QStringList frames = backtraceFramesForLogMessage(backtraceDepth);-
1275 if (frames.isEmpty())
frames.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
0-16
1276 return QString();
never executed: return QString();
0
1277-
1278 // if the first frame is unknown, replace it with the context function-
1279 if (function && frames.at(0).startsWith(QLatin1Char('?')))
functionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEnever evaluated
frames.at(0).s...tin1Char('?'))Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
0-16
1280 frames[0] = QString::fromUtf8(qCleanupFuncinfo(function));
never executed: frames[0] = QString::fromUtf8(qCleanupFuncinfo(function));
0
1281-
1282 return frames.join(backtraceSeparator);
executed 16 times by 1 test: return frames.join(backtraceSeparator);
Executed by:
  • tst_qlogging - unknown status
16
1283}-
1284#endif // QLOGGING_HAVE_BACKTRACE && !QT_BOOTSTRAPPED-
1285-
1286#if defined(QT_USE_SLOG2)-
1287#ifndef QT_LOG_CODE-
1288#define QT_LOG_CODE 9000-
1289#endif-
1290-
1291static void slog2_default_handler(QtMsgType msgType, const char *message)-
1292{-
1293 if (slog2_set_default_buffer((slog2_buffer_t)-1) == 0) {-
1294 slog2_buffer_set_config_t buffer_config;-
1295 slog2_buffer_t buffer_handle;-
1296-
1297 buffer_config.buffer_set_name = __progname;-
1298 buffer_config.num_buffers = 1;-
1299 buffer_config.verbosity_level = SLOG2_DEBUG1;-
1300 buffer_config.buffer_config[0].buffer_name = "default";-
1301 buffer_config.buffer_config[0].num_pages = 8;-
1302-
1303 if (slog2_register(&buffer_config, &buffer_handle, 0) == -1) {-
1304 fprintf(stderr, "Error registering slogger2 buffer!\n");-
1305 fprintf(stderr, "%s", message);-
1306 fflush(stderr);-
1307 return;-
1308 }-
1309-
1310 // Set as the default buffer-
1311 slog2_set_default_buffer(buffer_handle);-
1312 }-
1313 int severity;-
1314 //Determines the severity level-
1315 switch (msgType) {-
1316 case QtDebugMsg:-
1317 severity = SLOG2_DEBUG1;-
1318 break;-
1319 case QtInfoMsg:-
1320 severity = SLOG2_INFO;-
1321 break;-
1322 case QtWarningMsg:-
1323 severity = SLOG2_NOTICE;-
1324 break;-
1325 case QtCriticalMsg:-
1326 severity = SLOG2_WARNING;-
1327 break;-
1328 case QtFatalMsg:-
1329 severity = SLOG2_ERROR;-
1330 break;-
1331 }-
1332 //writes to the slog2 buffer-
1333 slog2c(NULL, QT_LOG_CODE, severity, message);-
1334}-
1335#endif // QT_USE_SLOG2-
1336-
1337Q_GLOBAL_STATIC(QMessagePattern, qMessagePattern)
executed 380 times by 108 tests: end of block
Executed by:
  • tst_gestures - 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_qabstractitemview - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qbrush - unknown status
  • tst_qbuffer - unknown status
  • tst_qbytearray - unknown status
  • tst_qcolor - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdatastream - unknown status
  • tst_qdatetime - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdialogbuttonbox - unknown status
  • tst_qdirmodel - unknown status
  • tst_qdrag - unknown status
  • ...
executed 380 times by 108 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_gestures - 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_qabstractitemview - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qbrush - unknown status
  • tst_qbuffer - unknown status
  • tst_qbytearray - unknown status
  • tst_qcolor - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdatastream - unknown status
  • tst_qdatetime - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdialogbuttonbox - unknown status
  • tst_qdirmodel - unknown status
  • tst_qdrag - unknown status
  • ...
executed 254330 times by 106 tests: return &holder.value;
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
guard.load() =...c::InitializedDescription
TRUEevaluated 380 times by 108 tests
Evaluated by:
  • tst_gestures - 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_qabstractitemview - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qbrush - unknown status
  • tst_qbuffer - unknown status
  • tst_qbytearray - unknown status
  • tst_qcolor - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdatastream - unknown status
  • tst_qdatetime - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdialogbuttonbox - unknown status
  • tst_qdirmodel - unknown status
  • tst_qdrag - unknown status
  • ...
FALSEnever evaluated
0-254330
1338-
1339/*!-
1340 \relates <QtGlobal>-
1341 \since 5.4-
1342-
1343 Generates a formatted string out of the \a type, \a context, \a str arguments.-
1344-
1345 qFormatLogMessage returns a QString that is formatted according to the current message pattern.-
1346 It can be used by custom message handlers to format output similar to Qt's default message-
1347 handler.-
1348-
1349 The function is thread-safe.-
1350-
1351 \sa qInstallMessageHandler(), qSetMessagePattern()-
1352 */-
1353QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &str)-
1354{-
1355 QString message;-
1356-
1357 QMutexLocker lock(&QMessagePattern::mutex);-
1358-
1359 QMessagePattern *pattern = qMessagePattern();-
1360 if (!pattern) {
!patternDescription
TRUEnever evaluated
FALSEevaluated 254286 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
0-254286
1361 // after destruction of static QMessagePattern instance-
1362 message.append(str);-
1363 return message;
never executed: return message;
0
1364 }-
1365-
1366 bool skip = false;-
1367-
1368#ifndef QT_BOOTSTRAPPED-
1369 int timeArgsIdx = 0;-
1370#ifdef QLOGGING_HAVE_BACKTRACE-
1371 int backtraceArgsIdx = 0;-
1372#endif-
1373#endif-
1374-
1375 // we do not convert file, function, line literals to local encoding due to overhead-
1376 for (int i = 0; pattern->tokens[i] != 0; ++i) {
pattern->tokens[i] != 0Description
TRUEevaluated 1271809 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 254286 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
254286-1271809
1377 const char *token = pattern->tokens[i];-
1378 if (token == endifTokenC) {
token == endifTokenCDescription
TRUEevaluated 254276 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 1017533 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
254276-1017533
1379 skip = false;-
1380 } else if (skip) {
executed 254276 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
skipDescription
TRUEevaluated 508439 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 509094 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
254276-509094
1381 // we skip adding messages, but we have to iterate over-
1382 // timeArgsIdx and backtraceArgsIdx anyway-
1383#ifndef QT_BOOTSTRAPPED-
1384 if (token == timeTokenC)
token == timeTokenCDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 508429 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
10-508429
1385 timeArgsIdx++;
executed 10 times by 1 test: timeArgsIdx++;
Executed by:
  • tst_qlogging - unknown status
10
1386#ifdef QLOGGING_HAVE_BACKTRACE-
1387 else if (token == backtraceTokenC)
token == backtraceTokenCDescription
TRUEnever evaluated
FALSEevaluated 508429 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
0-508429
1388 backtraceArgsIdx++;
never executed: backtraceArgsIdx++;
0
1389#endif-
1390#endif-
1391 } else if (token == messageTokenC) {
executed 508439 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
token == messageTokenCDescription
TRUEevaluated 254276 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 254818 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
254276-508439
1392 message.append(str);-
1393 } else if (token == categoryTokenC) {
executed 254276 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
token == categoryTokenCDescription
TRUEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 254815 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
3-254815
1394 message.append(QLatin1String(context.category));-
1395 } else if (token == typeTokenC) {
executed 3 times by 3 tests: end of block
Executed by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
token == typeTokenCDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 254801 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
3-254801
1396 switch (type) {-
1397 case QtDebugMsg: message.append(QLatin1String("debug")); break;
executed 6 times by 2 tests: break;
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
executed 6 times by 2 tests: case QtDebugMsg:
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
6
1398 case QtInfoMsg: message.append(QLatin1String("info")); break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qlogging - unknown status
executed 2 times by 1 test: case QtInfoMsg:
Executed by:
  • tst_qlogging - unknown status
2
1399 case QtWarningMsg: message.append(QLatin1String("warning")); break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qlogging - unknown status
executed 4 times by 1 test: case QtWarningMsg:
Executed by:
  • tst_qlogging - unknown status
4
1400 case QtCriticalMsg:message.append(QLatin1String("critical")); break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qlogging - unknown status
executed 2 times by 1 test: case QtCriticalMsg:
Executed by:
  • tst_qlogging - unknown status
2
1401 case QtFatalMsg: message.append(QLatin1String("fatal")); break;
never executed: break;
never executed: case QtFatalMsg:
0
1402 }-
1403 } else if (token == fileTokenC) {
executed 14 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
token == fileTokenCDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 254800 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
1-254800
1404 if (context.file)
context.fileDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEnever evaluated
0-1
1405 message.append(QLatin1String(context.file));
executed 1 time by 1 test: message.append(QLatin1String(context.file));
Executed by:
  • tst_qmessagehandler
1
1406 else-
1407 message.append(QLatin1String("unknown"));
never executed: message.append(QLatin1String("unknown"));
0
1408 } else if (token == lineTokenC) {
token == lineTokenCDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 254791 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
9-254791
1409 message.append(QString::number(context.line));-
1410 } else if (token == functionTokenC) {
executed 9 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
token == functionTokenCDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 254782 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
9-254782
1411 if (context.function)
context.functionDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEnever evaluated
0-9
1412 message.append(QString::fromLatin1(qCleanupFuncinfo(context.function)));
executed 9 times by 2 tests: message.append(QString::fromLatin1(qCleanupFuncinfo(context.function)));
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
9
1413 else-
1414 message.append(QLatin1String("unknown"));
never executed: message.append(QLatin1String("unknown"));
0
1415#ifndef QT_BOOTSTRAPPED-
1416 } else if (token == pidTokenC) {
token == pidTokenCDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 254774 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
8-254774
1417 message.append(QString::number(QCoreApplication::applicationPid()));-
1418 } else if (token == appnameTokenC) {
executed 8 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
token == appnameTokenCDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 254766 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
8-254766
1419 message.append(QCoreApplication::applicationName());-
1420 } else if (token == threadidTokenC) {
executed 8 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
token == threadidTokenCDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 254758 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
8-254758
1421 // print the TID as decimal-
1422 message.append(QString::number(qt_gettid()));-
1423 } else if (token == qthreadptrTokenC) {
executed 8 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
token == qthreadptrTokenCDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 254750 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
8-254750
1424 message.append(QLatin1String("0x"));-
1425 message.append(QString::number(qlonglong(QThread::currentThread()->currentThread()), 16));-
1426#ifdef QLOGGING_HAVE_BACKTRACE-
1427 } else if (token == backtraceTokenC) {
executed 8 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
token == backtraceTokenCDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 254734 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
8-254734
1428 QMessagePattern::BacktraceParams backtraceParams = pattern->backtraceArgs.at(backtraceArgsIdx);-
1429 backtraceArgsIdx++;-
1430 message.append(formatBacktraceForLogMessage(backtraceParams, context.function));-
1431#endif-
1432 } else if (token == timeTokenC) {
executed 16 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
token == timeTokenCDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 254696 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
16-254696
1433 QString timeFormat = pattern->timeArgs.at(timeArgsIdx);-
1434 timeArgsIdx++;-
1435 if (timeFormat == QLatin1String("process")) {
timeFormat == ...ing("process")Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
8-30
1436 quint64 ms = pattern->timer.elapsed();-
1437 message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));-
1438 } else if (timeFormat == QLatin1String("boot")) {
executed 8 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
timeFormat == ...String("boot")Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
0-30
1439 // just print the milliseconds since the elapsed timer reference-
1440 // like the Linux kernel does-
1441 QElapsedTimer now;-
1442 now.start();-
1443 uint ms = now.msecsSinceReference();-
1444 message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));-
1445 } else if (timeFormat.isEmpty()) {
never executed: end of block
timeFormat.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
0-30
1446 message.append(QDateTime::currentDateTime().toString(Qt::ISODate));-
1447 } else {
never executed: end of block
0
1448 message.append(QDateTime::currentDateTime().toString(timeFormat));-
1449 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qlogging - unknown status
30
1450#endif-
1451 } else if (token == ifCategoryTokenC) {
token == ifCategoryTokenCDescription
TRUEevaluated 254182 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 514 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
514-254182
1452 if (!context.category || (strcmp(context.category, "default") == 0))
!context.categoryDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 254177 times by 106 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
(strcmp(contex...efault") == 0)Description
TRUEevaluated 254174 times by 105 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
FALSEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
3-254177
1453 skip = true;
executed 254179 times by 106 tests: skip = true;
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
254179
1454#define HANDLE_IF_TOKEN(LEVEL) \-
1455 } else if (token == if##LEVEL##TokenC) { \-
1456 skip = type != Qt##LEVEL##Msg;-
1457 HANDLE_IF_TOKEN(Debug)
executed 254182 times by 106 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
token == ifDebugTokenCDescription
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 484 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
30-254182
1458 HANDLE_IF_TOKEN(Info)
executed 30 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
token == ifInfoTokenCDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 478 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
6-478
1459 HANDLE_IF_TOKEN(Warning)
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmessagehandler
token == ifWarningTokenCDescription
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 444 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
6-444
1460 HANDLE_IF_TOKEN(Critical)
executed 34 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
token == ifCriticalTokenCDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 430 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
14-430
1461 HANDLE_IF_TOKEN(Fatal)
executed 14 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
token == ifFatalTokenCDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 416 times by 3 tests
Evaluated by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
14-416
1462#undef HANDLE_IF_TOKEN-
1463 } else {
executed 14 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
14
1464 message.append(QLatin1String(token));-
1465 }
executed 416 times by 3 tests: end of block
Executed by:
  • tst_QSslSocket
  • tst_qlogging - unknown status
  • tst_qmessagehandler
416
1466 }-
1467 return message;
executed 254286 times by 106 tests: return message;
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • ...
254286
1468}-
1469-
1470#if !QT_DEPRECATED_SINCE(5, 0)-
1471// make sure they're defined to be exported-
1472typedef void (*QtMsgHandler)(QtMsgType, const char *);-
1473Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler);-
1474#endif-
1475-
1476static void qDefaultMsgHandler(QtMsgType type, const char *buf);-
1477static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &buf);-
1478-
1479// pointer to QtMsgHandler debug handler (without context)-
1480static QBasicAtomicPointer<void (QtMsgType, const char*)> msgHandler = Q_BASIC_ATOMIC_INITIALIZER(qDefaultMsgHandler);-
1481// pointer to QtMessageHandler debug handler (with context)-
1482static QBasicAtomicPointer<void (QtMsgType, const QMessageLogContext &, const QString &)> messageHandler = Q_BASIC_ATOMIC_INITIALIZER(qDefaultMessageHandler);-
1483-
1484#if defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)-
1485static void systemd_default_message_handler(QtMsgType type,-
1486 const QMessageLogContext &context,-
1487 const QString &message)-
1488{-
1489 int priority = LOG_INFO; // Informational-
1490 switch (type) {-
1491 case QtDebugMsg:-
1492 priority = LOG_DEBUG; // Debug-level messages-
1493 break;-
1494 case QtInfoMsg:-
1495 priority = LOG_INFO; // Informational conditions-
1496 break;-
1497 case QtWarningMsg:-
1498 priority = LOG_WARNING; // Warning conditions-
1499 break;-
1500 case QtCriticalMsg:-
1501 priority = LOG_CRIT; // Critical conditions-
1502 break;-
1503 case QtFatalMsg:-
1504 priority = LOG_ALERT; // Action must be taken immediately-
1505 break;-
1506 }-
1507-
1508 sd_journal_send("MESSAGE=%s", message.toUtf8().constData(),-
1509 "PRIORITY=%i", priority,-
1510 "CODE_FUNC=%s", context.function ? context.function : "unknown",-
1511 "CODE_LINE=%d", context.line,-
1512 "CODE_FILE=%s", context.file ? context.file : "unknown",-
1513 "QT_CATEGORY=%s", context.category ? context.category : "unknown",-
1514 NULL);-
1515}-
1516#endif-
1517-
1518#ifdef QT_USE_SYSLOG-
1519static void syslog_default_message_handler(QtMsgType type, const char *message)-
1520{-
1521 int priority = LOG_INFO; // Informational-
1522 switch (type) {-
1523 case QtDebugMsg:-
1524 priority = LOG_DEBUG; // Debug-level messages-
1525 break;-
1526 case QtInfoMsg:-
1527 priority = LOG_INFO; // Informational conditions-
1528 break;-
1529 case QtWarningMsg:-
1530 priority = LOG_WARNING; // Warning conditions-
1531 break;-
1532 case QtCriticalMsg:-
1533 priority = LOG_CRIT; // Critical conditions-
1534 break;-
1535 case QtFatalMsg:-
1536 priority = LOG_ALERT; // Action must be taken immediately-
1537 break;-
1538 }-
1539-
1540 syslog(priority, "%s", message);-
1541}-
1542#endif-
1543-
1544#ifdef Q_OS_ANDROID-
1545static void android_default_message_handler(QtMsgType type,-
1546 const QMessageLogContext &context,-
1547 const QString &message)-
1548{-
1549 android_LogPriority priority = ANDROID_LOG_DEBUG;-
1550 switch (type) {-
1551 case QtDebugMsg: priority = ANDROID_LOG_DEBUG; break;-
1552 case QtInfoMsg: priority = ANDROID_LOG_INFO; break;-
1553 case QtWarningMsg: priority = ANDROID_LOG_WARN; break;-
1554 case QtCriticalMsg: priority = ANDROID_LOG_ERROR; break;-
1555 case QtFatalMsg: priority = ANDROID_LOG_FATAL; break;-
1556 };-
1557-
1558 __android_log_print(priority, qPrintable(QCoreApplication::applicationName()),-
1559 "%s:%d (%s): %s\n", context.file, context.line,-
1560 context.function, qPrintable(message));-
1561}-
1562#endif //Q_OS_ANDROID-
1563-
1564/*!-
1565 \internal-
1566*/-
1567static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context,-
1568 const QString &buf)-
1569{-
1570 QString logMessage = qFormatLogMessage(type, context, buf);-
1571-
1572 // print nothing if message pattern didn't apply / was empty.-
1573 // (still print empty lines, e.g. because message itself was empty)-
1574 if (logMessage.isNull())
logMessage.isNull()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
FALSEevaluated 120 times by 4 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qlogging - unknown status
  • tst_qprocess - unknown status
  • tst_qsystemsemaphore - unknown status
2-120
1575 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qlogging - unknown status
2
1576-
1577 if (!qt_logging_to_console()) {
!qt_logging_to_console()Description
TRUEnever evaluated
FALSEevaluated 120 times by 4 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qlogging - unknown status
  • tst_qprocess - unknown status
  • tst_qsystemsemaphore - unknown status
0-120
1578#if defined(Q_OS_WIN)-
1579 logMessage.append(QLatin1Char('\n'));-
1580 OutputDebugString(reinterpret_cast<const wchar_t *>(logMessage.utf16()));-
1581 return;-
1582#elif defined(QT_USE_SLOG2)-
1583 logMessage.append(QLatin1Char('\n'));-
1584 slog2_default_handler(type, logMessage.toLocal8Bit().constData());-
1585 return;-
1586#elif defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)-
1587 systemd_default_message_handler(type, context, logMessage);-
1588 return;-
1589#elif defined(QT_USE_SYSLOG) && !defined(QT_BOOTSTRAPPED)-
1590 syslog_default_message_handler(type, logMessage.toUtf8().constData());-
1591 return;-
1592#elif defined(Q_OS_ANDROID)-
1593 android_default_message_handler(type, context, logMessage);-
1594 return;-
1595#endif-
1596 }
never executed: end of block
0
1597 fprintf(stderr, "%s\n", logMessage.toLocal8Bit().constData());-
1598 fflush(stderr);-
1599}
executed 120 times by 4 tests: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qlogging - unknown status
  • tst_qprocess - unknown status
  • tst_qsystemsemaphore - unknown status
120
1600-
1601/*!-
1602 \internal-
1603*/-
1604static void qDefaultMsgHandler(QtMsgType type, const char *buf)-
1605{-
1606 QMessageLogContext emptyContext;-
1607 qDefaultMessageHandler(type, emptyContext, QString::fromLocal8Bit(buf));-
1608}
never executed: end of block
0
1609-
1610#if defined(Q_COMPILER_THREAD_LOCAL)-
1611-
1612static thread_local bool msgHandlerGrabbed = false;-
1613-
1614static bool grabMessageHandler()-
1615{-
1616 if (msgHandlerGrabbed)
msgHandlerGrabbedDescription
TRUEnever evaluated
FALSEevaluated 267571 times by 161 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-267571
1617 return false;
never executed: return false;
0
1618-
1619 msgHandlerGrabbed = true;-
1620 return true;
executed 267571 times by 161 tests: return true;
Executed 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
  • ...
267571
1621}-
1622-
1623static void ungrabMessageHandler()-
1624{-
1625 msgHandlerGrabbed = false;-
1626}
executed 267571 times by 162 tests: end of block
Executed 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
  • ...
267571
1627-
1628#else-
1629static bool grabMessageHandler() { return true; }-
1630static void ungrabMessageHandler() { }-
1631#endif // (Q_COMPILER_THREAD_LOCAL)-
1632-
1633static void qt_message_print(QtMsgType msgType, const QMessageLogContext &context, const QString &message)-
1634{-
1635#ifndef QT_BOOTSTRAPPED-
1636 // qDebug, qWarning, ... macros do not check whether category is enabled-
1637 if (!context.category || (strcmp(context.category, "default") == 0)) {
!context.categoryDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDebug
FALSEevaluated 267581 times by 161 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
  • ...
(strcmp(contex...efault") == 0)Description
TRUEevaluated 255497 times by 159 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
  • ...
FALSEevaluated 12084 times by 6 tests
Evaluated by:
  • tst_QLogging
  • tst_QLoggingRegistry
  • tst_QNoDebug
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_qlogging - unknown status
2-267581
1638 if (QLoggingCategory *defaultCategory = QLoggingCategory::defaultCategory()) {
QLoggingCatego...aultCategory()Description
TRUEevaluated 255499 times by 159 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
  • ...
FALSEnever evaluated
0-255499
1639 if (!defaultCategory->isEnabled(msgType))
!defaultCatego...abled(msgType)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QLogging
FALSEevaluated 255487 times by 159 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
  • ...
12-255487
1640 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_QLogging
12
1641 }
executed 255487 times by 159 tests: end of block
Executed 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
  • ...
255487
1642 }
executed 255487 times by 159 tests: end of block
Executed 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
  • ...
255487
1643#endif-
1644-
1645 // prevent recursion in case the message handler generates messages-
1646 // itself, e.g. by using Qt API-
1647 if (grabMessageHandler()) {
grabMessageHandler()Description
TRUEevaluated 267571 times by 161 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
  • ...
FALSEnever evaluated
0-267571
1648 // prefer new message handler over the old one-
1649 if (msgHandler.load() == qDefaultMsgHandler
msgHandler.loa...aultMsgHandlerDescription
TRUEevaluated 267569 times by 161 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
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmessagehandler
2-267569
1650 || messageHandler.load() != qDefaultMessageHandler) {
messageHandler...MessageHandlerDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmessagehandler
1
1651 (*messageHandler.load())(msgType, context, message);-
1652 } else {
executed 267570 times by 162 tests: end of block
Executed 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
  • ...
267570
1653 (*msgHandler.load())(msgType, message.toLocal8Bit().constData());-
1654 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qmessagehandler
1
1655 ungrabMessageHandler();-
1656 } else {
executed 267571 times by 162 tests: end of block
Executed 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
  • ...
267571
1657 fprintf(stderr, "%s\n", message.toLocal8Bit().constData());-
1658 }
never executed: end of block
0
1659}-
1660-
1661static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message)-
1662{-
1663#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)-
1664 wchar_t contextFileL[256];-
1665 // we probably should let the compiler do this for us, by declaring QMessageLogContext::file to-
1666 // be const wchar_t * in the first place, but the #ifdefery above is very complex and we-
1667 // wouldn't be able to change it later on...-
1668 convert_to_wchar_t_elided(contextFileL, sizeof contextFileL / sizeof *contextFileL,-
1669 context.file);-
1670 // get the current report mode-
1671 int reportMode = _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW);-
1672 _CrtSetReportMode(_CRT_ERROR, reportMode);-
1673-
1674 int ret = _CrtDbgReportW(_CRT_ERROR, contextFileL, context.line, _CRT_WIDE(QT_VERSION_STR),-
1675 reinterpret_cast<const wchar_t *>(message.utf16()));-
1676 if ((ret == 0) && (reportMode & _CRTDBG_MODE_WNDW))-
1677 return; // ignore-
1678 else if (ret == 1)-
1679 _CrtDbgBreak();-
1680#else-
1681 Q_UNUSED(context);-
1682 Q_UNUSED(message);-
1683#endif-
1684-
1685#if (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))-
1686 abort(); // trap; generates core dump
executed 55 times by 2 tests: abort();
Executed by:
  • tst_qnetworkreply - unknown status
  • tst_selftests - unknown status
55
1687#else-
1688 exit(1); // goodbye cruel world-
1689#endif-
1690}-
1691-
1692-
1693/*!-
1694 \internal-
1695*/-
1696void qt_message_output(QtMsgType msgType, const QMessageLogContext &context, const QString &message)-
1697{-
1698 qt_message_print(msgType, context, message);-
1699 if (isFatal(msgType))
isFatal(msgType)Description
TRUEnever evaluated
FALSEevaluated 15351 times by 64 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QLogging
  • tst_QMdiSubWindow
  • ...
0-15351
1700 qt_message_fatal(msgType, context, message);
never executed: qt_message_fatal(msgType, context, message);
0
1701}
executed 15351 times by 64 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QLogging
  • tst_QMdiSubWindow
  • ...
15351
1702-
1703void qErrnoWarning(const char *msg, ...)-
1704{-
1705 // qt_error_string() will allocate anyway, so we don't have-
1706 // to be careful here (like we do in plain qWarning())-
1707 va_list ap;-
1708 va_start(ap, msg);-
1709 QString buf = QString::vasprintf(msg, ap);-
1710 va_end(ap);-
1711-
1712 buf += QLatin1String(" (") + qt_error_string(-1) + QLatin1Char(')');-
1713 QMessageLogContext context;-
1714 qt_message_output(QtCriticalMsg, context, buf);-
1715}
never executed: end of block
0
1716-
1717void qErrnoWarning(int code, const char *msg, ...)-
1718{-
1719 // qt_error_string() will allocate anyway, so we don't have-
1720 // to be careful here (like we do in plain qWarning())-
1721 va_list ap;-
1722 va_start(ap, msg);-
1723 QString buf = QString::vasprintf(msg, ap);-
1724 va_end(ap);-
1725-
1726 buf += QLatin1String(" (") + qt_error_string(code) + QLatin1Char(')');-
1727 QMessageLogContext context;-
1728 qt_message_output(QtCriticalMsg, context, buf);-
1729}
never executed: end of block
0
1730-
1731/*!-
1732 \typedef QtMsgHandler-
1733 \relates <QtGlobal>-
1734 \deprecated-
1735-
1736 This is a typedef for a pointer to a function with the following-
1737 signature:-
1738-
1739 \snippet code/src_corelib_global_qglobal.cpp 7-
1740-
1741 This typedef is deprecated, you should use QtMessageHandler instead.-
1742 \sa QtMsgType, QtMessageHandler, qInstallMsgHandler(), qInstallMessageHandler()-
1743*/-
1744-
1745/*!-
1746 \typedef QtMessageHandler-
1747 \relates <QtGlobal>-
1748 \since 5.0-
1749-
1750 This is a typedef for a pointer to a function with the following-
1751 signature:-
1752-
1753 \snippet code/src_corelib_global_qglobal.cpp 49-
1754-
1755 \sa QtMsgType, qInstallMessageHandler()-
1756*/-
1757-
1758/*!-
1759 \fn QtMessageHandler qInstallMessageHandler(QtMessageHandler handler)-
1760 \relates <QtGlobal>-
1761 \since 5.0-
1762-
1763 Installs a Qt message \a handler which has been defined-
1764 previously. Returns a pointer to the previous message handler.-
1765-
1766 The message handler is a function that prints out debug messages,-
1767 warnings, critical and fatal error messages. The Qt library (debug-
1768 mode) contains hundreds of warning messages that are printed-
1769 when internal errors (usually invalid function arguments)-
1770 occur. Qt built in release mode also contains such warnings unless-
1771 QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during-
1772 compilation. If you implement your own message handler, you get total-
1773 control of these messages.-
1774-
1775 The default message handler prints the message to the standard-
1776 output under X11 or to the debugger under Windows. If it is a-
1777 fatal message, the application aborts immediately.-
1778-
1779 Only one message handler can be defined, since this is usually-
1780 done on an application-wide basis to control debug output.-
1781-
1782 To restore the message handler, call \c qInstallMessageHandler(0).-
1783-
1784 Example:-
1785-
1786 \snippet code/src_corelib_global_qglobal.cpp 23-
1787-
1788 \sa QtMessageHandler, QtMsgType, qDebug(), qInfo(), qWarning(), qCritical(), qFatal(),-
1789 {Debugging Techniques}-
1790*/-
1791-
1792/*!-
1793 \fn QtMsgHandler qInstallMsgHandler(QtMsgHandler handler)-
1794 \relates <QtGlobal>-
1795 \deprecated-
1796-
1797 Installs a Qt message \a handler which has been defined-
1798 previously. This method is deprecated, use qInstallMessageHandler-
1799 instead.-
1800 \sa QtMsgHandler, qInstallMessageHandler()-
1801*/-
1802/*!-
1803 \fn void qSetMessagePattern(const QString &pattern)-
1804 \relates <QtGlobal>-
1805 \since 5.0-
1806-
1807 \brief Changes the output of the default message handler.-
1808-
1809 Allows to tweak the output of qDebug(), qInfo(), qWarning(), qCritical(),-
1810 and qFatal(). The category logging output of qCDebug(), qCInfo(),-
1811 qCWarning(), and qCCritical() is formatted, too.-
1812-
1813 Following placeholders are supported:-
1814-
1815 \table-
1816 \header \li Placeholder \li Description-
1817 \row \li \c %{appname} \li QCoreApplication::applicationName()-
1818 \row \li \c %{category} \li Logging category-
1819 \row \li \c %{file} \li Path to source file-
1820 \row \li \c %{function} \li Function-
1821 \row \li \c %{line} \li Line in source file-
1822 \row \li \c %{message} \li The actual message-
1823 \row \li \c %{pid} \li QCoreApplication::applicationPid()-
1824 \row \li \c %{threadid} \li The system-wide ID of current thread (if it can be obtained)-
1825 \row \li \c %{qthreadptr} \li A pointer to the current QThread (result of QThread::currentThread())-
1826 \row \li \c %{type} \li "debug", "warning", "critical" or "fatal"-
1827 \row \li \c %{time process} \li time of the message, in seconds since the process started (the token "process" is literal)-
1828 \row \li \c %{time boot} \li the time of the message, in seconds since the system boot if that-
1829 can be determined (the token "boot" is literal). If the time since boot could not be obtained,-
1830 the output is indeterminate (see QElapsedTimer::msecsSinceReference()).-
1831 \row \li \c %{time [format]} \li system time when the message occurred, formatted by-
1832 passing the \c format to \l QDateTime::toString(). If the format is-
1833 not specified, the format of Qt::ISODate is used.-
1834 \row \li \c{%{backtrace [depth=N] [separator="..."]}} \li A backtrace with the number of frames-
1835 specified by the optional \c depth parameter (defaults to 5), and separated by the optional-
1836 \c separator parameter (defaults to "|").-
1837 This expansion is available only on some platforms (currently only platfoms using glibc).-
1838 Names are only known for exported functions. If you want to see the name of every function-
1839 in your application, use \c{QMAKE_LFLAGS += -rdynamic}.-
1840 When reading backtraces, take into account that frames might be missing due to inlining or-
1841 tail call optimization.-
1842 \endtable-
1843-
1844 You can also use conditionals on the type of the message using \c %{if-debug}, \c %{if-info}-
1845 \c %{if-warning}, \c %{if-critical} or \c %{if-fatal} followed by an \c %{endif}.-
1846 What is inside the \c %{if-*} and \c %{endif} will only be printed if the type matches.-
1847-
1848 Finally, text inside \c %{if-category} ... \c %{endif} is only printed if the category-
1849 is not the default one.-
1850-
1851 Example:-
1852 \code-
1853 QT_MESSAGE_PATTERN="[%{time yyyyMMdd h:mm:ss.zzz t} %{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}"-
1854 \endcode-
1855-
1856 The default \a pattern is "%{if-category}%{category}: %{endif}%{message}".-
1857-
1858 The \a pattern can also be changed at runtime by setting the QT_MESSAGE_PATTERN-
1859 environment variable; if both \l qSetMessagePattern() is called and QT_MESSAGE_PATTERN is-
1860 set, the environment variable takes precedence.-
1861-
1862 Custom message handlers can use qFormatLogMessage() to take \a pattern into account.-
1863-
1864 \sa qInstallMessageHandler(), {Debugging Techniques}, {QLoggingCategory}-
1865 */-
1866-
1867QtMessageHandler qInstallMessageHandler(QtMessageHandler h)-
1868{-
1869 if (!h)
!hDescription
TRUEevaluated 172 times by 2 tests
Evaluated by:
  • tst_QDebug
  • tst_qmessagehandler
FALSEevaluated 2953 times by 507 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
172-2953
1870 h = qDefaultMessageHandler;
executed 172 times by 2 tests: h = qDefaultMessageHandler;
Executed by:
  • tst_QDebug
  • tst_qmessagehandler
172
1871 //set 'h' and return old message handler-
1872 return messageHandler.fetchAndStoreRelaxed(h);
executed 3125 times by 507 tests: return messageHandler.fetchAndStoreRelaxed(h);
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
3125
1873}-
1874-
1875QtMsgHandler qInstallMsgHandler(QtMsgHandler h)-
1876{-
1877 if (!h)
!hDescription
TRUEevaluated 169 times by 1 test
Evaluated by:
  • tst_qmessagehandler
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmessagehandler
3-169
1878 h = qDefaultMsgHandler;
executed 169 times by 1 test: h = qDefaultMsgHandler;
Executed by:
  • tst_qmessagehandler
169
1879 //set 'h' and return old message handler-
1880 return msgHandler.fetchAndStoreRelaxed(h);
executed 172 times by 1 test: return msgHandler.fetchAndStoreRelaxed(h);
Executed by:
  • tst_qmessagehandler
172
1881}-
1882-
1883void qSetMessagePattern(const QString &pattern)-
1884{-
1885 QMutexLocker lock(&QMessagePattern::mutex);-
1886-
1887 if (!qMessagePattern()->fromEnvironment)
!qMessagePatte...romEnvironmentDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qlogging - unknown status
9-26
1888 qMessagePattern()->setPattern(pattern);
executed 9 times by 2 tests: qMessagePattern()->setPattern(pattern);
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
9
1889}
executed 35 times by 2 tests: end of block
Executed by:
  • tst_qlogging - unknown status
  • tst_qmessagehandler
35
1890-
1891-
1892/*!-
1893 Copies context information from \a logContext into this QMessageLogContext-
1894 \internal-
1895*/-
1896void QMessageLogContext::copy(const QMessageLogContext &logContext)-
1897{-
1898 this->category = logContext.category;-
1899 this->file = logContext.file;-
1900 this->line = logContext.line;-
1901 this->function = logContext.function;-
1902}
executed 15349 times by 64 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QLogging
  • tst_QMdiSubWindow
  • ...
15349
1903-
1904/*!-
1905 \fn QMessageLogger::QMessageLogger()-
1906-
1907 Constructs a default QMessageLogger. See the other constructors to specify-
1908 context information.-
1909*/-
1910-
1911/*!-
1912 \fn QMessageLogger::QMessageLogger(const char *file, int line, const char *function)-
1913-
1914 Constructs a QMessageLogger to record log messages for \a file at \a line-
1915 in \a function. The is equivalent to QMessageLogger(file, line, function, "default")-
1916*/-
1917/*!-
1918 \fn QMessageLogger::QMessageLogger(const char *file, int line, const char *function, const char *category)-
1919-
1920 Constructs a QMessageLogger to record \a category messages for \a file at \a line-
1921 in \a function.-
1922*/-
1923-
1924/*!-
1925 \fn void QMessageLogger::noDebug(const char *, ...) const-
1926 \internal-
1927-
1928 Ignores logging output-
1929-
1930 \sa QNoDebug, qDebug()-
1931*/-
1932-
1933/*!-
1934 \fn QMessageLogContext::QMessageLogContext()-
1935 \internal-
1936-
1937 Constructs a QMessageLogContext-
1938*/-
1939-
1940/*!-
1941 \fn QMessageLogContext::QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName)-
1942 \internal-
1943-
1944 Constructs a QMessageLogContext with for file \a fileName at line-
1945 \a lineNumber, in function \a functionName, and category \a categoryName.-
1946*/-
1947-
1948QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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