qplaintestlogger.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/testlib/qplaintestlogger.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtTest module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include <QtTest/private/qtestresult_p.h>-
35#include <QtTest/qtestassert.h>-
36#include <QtTest/private/qtestlog_p.h>-
37#include <QtTest/private/qplaintestlogger_p.h>-
38#include <QtTest/private/qbenchmark_p.h>-
39#include <QtTest/private/qbenchmarkmetric_p.h>-
40-
41#include <stdarg.h>-
42#include <stdio.h>-
43#include <stdlib.h>-
44#include <string.h>-
45-
46#ifdef Q_OS_WINCE-
47#include <QtCore/QString>-
48#endif-
49-
50#ifdef min // windows.h without NOMINMAX is included by the benchmark headers.-
51# undef min-
52#endif-
53#ifdef max-
54# undef max-
55#endif-
56-
57#include <QtCore/QByteArray>-
58#include <QtCore/qmath.h>-
59#include <QtCore/QLibraryInfo>-
60-
61#ifdef Q_OS_ANDROID-
62# include <android/log.h>-
63#endif-
64-
65#ifdef Q_OS_WIN-
66# include <qt_windows.h>-
67#endif-
68-
69QT_BEGIN_NAMESPACE-
70-
71namespace QTest {-
72-
73 static const char *incidentType2String(QAbstractTestLogger::IncidentTypes type)-
74 {-
75 switch (type) {-
76 case QAbstractTestLogger::Pass:
executed 126704 times by 540 tests: case QAbstractTestLogger::Pass:
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
  • ...
126704
77 return "PASS ";
executed 126704 times by 540 tests: return "PASS ";
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
  • ...
126704
78 case QAbstractTestLogger::XFail:
executed 285 times by 38 tests: case QAbstractTestLogger::XFail:
Executed by:
  • tst_LargeFile
  • tst_QAbstractPrintDialog
  • tst_QAuthenticator
  • tst_QColumnView
  • tst_QDBusAbstractInterface
  • tst_QDateTime
  • tst_QEventLoop
  • tst_QFile
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsLayoutItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QLatin1String
  • tst_QLineEdit
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QRect
  • tst_QSequentialAnimationGroup
  • tst_QShortcut
  • tst_QSqlDatabase
  • tst_QSqlTableModel
  • ...
285
79 return "XFAIL ";
executed 285 times by 38 tests: return "XFAIL ";
Executed by:
  • tst_LargeFile
  • tst_QAbstractPrintDialog
  • tst_QAuthenticator
  • tst_QColumnView
  • tst_QDBusAbstractInterface
  • tst_QDateTime
  • tst_QEventLoop
  • tst_QFile
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsLayoutItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QLatin1String
  • tst_QLineEdit
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QRect
  • tst_QSequentialAnimationGroup
  • tst_QShortcut
  • tst_QSqlDatabase
  • tst_QSqlTableModel
  • ...
285
80 case QAbstractTestLogger::Fail:
executed 1032 times by 21 tests: case QAbstractTestLogger::Fail:
Executed by:
  • tst_Gestures
  • tst_QCommandLineParser
  • tst_QFile
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QLocalSocket
  • tst_QLocale
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QOpenGLWidget
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QThreadStorage
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_qmake
  • tst_selftests - unknown status
1032
81 return "FAIL! ";
executed 1032 times by 21 tests: return "FAIL! ";
Executed by:
  • tst_Gestures
  • tst_QCommandLineParser
  • tst_QFile
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QLocalSocket
  • tst_QLocale
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QOpenGLWidget
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextStream
  • tst_QThreadStorage
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_qmake
  • tst_selftests - unknown status
1032
82 case QAbstractTestLogger::XPass:
executed 44 times by 1 test: case QAbstractTestLogger::XPass:
Executed by:
  • tst_selftests - unknown status
44
83 return "XPASS ";
executed 44 times by 1 test: return "XPASS ";
Executed by:
  • tst_selftests - unknown status
44
84 case QAbstractTestLogger::BlacklistedPass:
executed 528 times by 18 tests: case QAbstractTestLogger::BlacklistedPass:
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QUdpSocket
  • tst_Spdy
  • tst_selftests - unknown status
528
85 return "BPASS ";
executed 528 times by 18 tests: return "BPASS ";
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QUdpSocket
  • tst_Spdy
  • tst_selftests - unknown status
528
86 case QAbstractTestLogger::BlacklistedFail:
executed 17 times by 8 tests: case QAbstractTestLogger::BlacklistedFail:
Executed by:
  • tst_QAction
  • tst_QCompleter
  • tst_QFtp
  • tst_QSocks5SocketEngine
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTouchEvent
  • tst_QWidget
  • tst_selftests - unknown status
17
87 return "BFAIL ";
executed 17 times by 8 tests: return "BFAIL ";
Executed by:
  • tst_QAction
  • tst_QCompleter
  • tst_QFtp
  • tst_QSocks5SocketEngine
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTouchEvent
  • tst_QWidget
  • tst_selftests - unknown status
17
88 }-
89 return "??????";
never executed: return "??????";
0
90 }-
91-
92 static const char *benchmarkResult2String()-
93 {-
94 return "RESULT ";
executed 94 times by 2 tests: return "RESULT ";
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
94
95 }-
96-
97 static const char *messageType2String(QAbstractTestLogger::MessageTypes type)-
98 {-
99 switch (type) {-
100 case QAbstractTestLogger::Skip:
executed 935 times by 56 tests: case QAbstractTestLogger::Skip:
Executed by:
  • tst_Compiler
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QCssParser
  • tst_QDBusConnection_NoApplication
  • tst_QDBusLocalCalls
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDialog
  • tst_QDir
  • tst_QDockWidget
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontDatabase
  • tst_QFtp
  • tst_QGLThreads
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsView
  • tst_QIODevice
  • tst_QImageReader
  • tst_QItemView
  • tst_QLockFile
  • ...
935
101 return "SKIP ";
executed 935 times by 56 tests: return "SKIP ";
Executed by:
  • tst_Compiler
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QCssParser
  • tst_QDBusConnection_NoApplication
  • tst_QDBusLocalCalls
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDialog
  • tst_QDir
  • tst_QDockWidget
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontDatabase
  • tst_QFtp
  • tst_QGLThreads
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsView
  • tst_QIODevice
  • tst_QImageReader
  • tst_QItemView
  • tst_QLockFile
  • ...
935
102 case QAbstractTestLogger::Warn:
executed 108 times by 13 tests: case QAbstractTestLogger::Warn:
Executed by:
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QMouseEvent
  • tst_QPluginLoader
  • tst_QSqlQuery
  • tst_QString_NoCastFromByteArray
  • tst_QTreeView
  • tst_QWidget
  • tst_selftests - unknown status
108
103 return "WARNING";
executed 108 times by 13 tests: return "WARNING";
Executed by:
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QMouseEvent
  • tst_QPluginLoader
  • tst_QSqlQuery
  • tst_QString_NoCastFromByteArray
  • tst_QTreeView
  • tst_QWidget
  • tst_selftests - unknown status
108
104 case QAbstractTestLogger::QWarning:
executed 20632 times by 68 tests: case QAbstractTestLogger::QWarning:
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • tst_QGLBuffer
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsProxyWidget
  • ...
20632
105 return "QWARN ";
executed 20632 times by 68 tests: return "QWARN ";
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialogButtonBox
  • tst_QDirModel
  • tst_QDrag
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFormLayout
  • tst_QGLBuffer
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsProxyWidget
  • ...
20632
106 case QAbstractTestLogger::QDebug:
executed 1949 times by 55 tests: case QAbstractTestLogger::QDebug:
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QBrush
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDateTime
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMdiSubWindow
  • tst_QMimeDatabase
  • tst_QMutex
  • tst_QNetworkConfigurationManager
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • ...
1949
107 return "QDEBUG ";
executed 1949 times by 55 tests: return "QDEBUG ";
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QApplication
  • tst_QBrush
  • tst_QColumnView
  • tst_QDBusInterface
  • tst_QDateTime
  • tst_QElapsedTimer
  • tst_QEventLoop
  • tst_QFileSystemWatcher
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QGuiEventLoop
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMdiSubWindow
  • tst_QMimeDatabase
  • tst_QMutex
  • tst_QNetworkConfigurationManager
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • ...
1949
108 case QAbstractTestLogger::QInfo:
executed 22 times by 1 test: case QAbstractTestLogger::QInfo:
Executed by:
  • tst_selftests - unknown status
22
109 return "QINFO ";
executed 22 times by 1 test: return "QINFO ";
Executed by:
  • tst_selftests - unknown status
22
110 case QAbstractTestLogger::QSystem:
executed 12 times by 1 test: case QAbstractTestLogger::QSystem:
Executed by:
  • tst_selftests - unknown status
12
111 return "QSYSTEM";
executed 12 times by 1 test: return "QSYSTEM";
Executed by:
  • tst_selftests - unknown status
12
112 case QAbstractTestLogger::QFatal:
executed 25 times by 2 tests: case QAbstractTestLogger::QFatal:
Executed by:
  • tst_QNetworkReply
  • tst_selftests - unknown status
25
113 return "QFATAL ";
executed 25 times by 2 tests: return "QFATAL ";
Executed by:
  • tst_QNetworkReply
  • tst_selftests - unknown status
25
114 case QAbstractTestLogger::Info:
executed 652 times by 1 test: case QAbstractTestLogger::Info:
Executed by:
  • tst_selftests - unknown status
652
115 return "INFO ";
executed 652 times by 1 test: return "INFO ";
Executed by:
  • tst_selftests - unknown status
652
116 }-
117 return "??????";
never executed: return "??????";
0
118 }-
119-
120 template <typename T>-
121 static int countSignificantDigits(T num)-
122 {-
123 if (num <= 0)
num <= 0Description
TRUEevaluated 50 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
50-138
124 return 0;
executed 50 times by 2 tests: return 0;
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
50
125-
126 int digits = 0;-
127 qreal divisor = 1;-
128-
129 while (num / divisor >= 1) {
num / divisor >= 1Description
TRUEevaluated 410 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
138-410
130 divisor *= 10;-
131 ++digits;-
132 }
executed 410 times by 2 tests: end of block
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
410
133-
134 return digits;
executed 138 times by 2 tests: return digits;
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
138
135 }-
136-
137 // Pretty-prints a benchmark result using the given number of digits.-
138 template <typename T> QString formatResult(T number, int significantDigits)-
139 {-
140 if (number < T(0))
number < T(0)Description
TRUEnever evaluated
FALSEevaluated 188 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
0-188
141 return QLatin1String("NAN");
never executed: return QLatin1String("NAN");
0
142 if (number == T(0))
number == T(0)Description
TRUEevaluated 50 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
50-138
143 return QLatin1String("0");
executed 50 times by 2 tests: return QLatin1String("0");
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
50
144-
145 QString beforeDecimalPoint = QString::number(qint64(number), 'f', 0);-
146 QString afterDecimalPoint = QString::number(number, 'f', 20);-
147 afterDecimalPoint.remove(0, beforeDecimalPoint.count() + 1);-
148-
149 int beforeUse = qMin(beforeDecimalPoint.count(), significantDigits);-
150 int beforeRemove = beforeDecimalPoint.count() - beforeUse;-
151-
152 // Replace insignificant digits before the decimal point with zeros.-
153 beforeDecimalPoint.chop(beforeRemove);-
154 for (int i = 0; i < beforeRemove; ++i) {
i < beforeRemoveDescription
TRUEnever evaluated
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
0-138
155 beforeDecimalPoint.append(QLatin1Char('0'));-
156 }
never executed: end of block
0
157-
158 int afterUse = significantDigits - beforeUse;-
159-
160 // leading zeroes after the decimal point does not count towards the digit use.-
161 if (beforeDecimalPoint == QLatin1String("0") && afterDecimalPoint.isEmpty() == false) {
beforeDecimalP...in1String("0")Description
TRUEnever evaluated
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
afterDecimalPo...pty() == falseDescription
TRUEnever evaluated
FALSEnever evaluated
0-138
162 ++afterUse;-
163-
164 int i = 0;-
165 while (i < afterDecimalPoint.count() && afterDecimalPoint.at(i) == QLatin1Char('0')) {
i < afterDecimalPoint.count()Description
TRUEnever evaluated
FALSEnever evaluated
afterDecimalPo...atin1Char('0')Description
TRUEnever evaluated
FALSEnever evaluated
0
166 ++i;-
167 }
never executed: end of block
0
168-
169 afterUse += i;-
170 }
never executed: end of block
0
171-
172 int afterRemove = afterDecimalPoint.count() - afterUse;-
173 afterDecimalPoint.chop(afterRemove);-
174-
175 QChar separator = QLatin1Char(',');-
176 QChar decimalPoint = QLatin1Char('.');-
177-
178 // insert thousands separators-
179 int length = beforeDecimalPoint.length();-
180 for (int i = beforeDecimalPoint.length() -1; i >= 1; --i) {
i >= 1Description
TRUEevaluated 266 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 138 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
138-266
181 if ((length - i) % 3 == 0)
(length - i) % 3 == 0Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 226 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
40-226
182 beforeDecimalPoint.insert(i, separator);
executed 40 times by 1 test: beforeDecimalPoint.insert(i, separator);
Executed by:
  • tst_selftests - unknown status
40
183 }
executed 266 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
266
184-
185 QString print;-
186 print = beforeDecimalPoint;-
187 if (afterUse > 0)
afterUse > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 134 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
4-134
188 print.append(decimalPoint);
executed 4 times by 1 test: print.append(decimalPoint);
Executed by:
  • tst_selftests - unknown status
4
189-
190 print += afterDecimalPoint;-
191-
192-
193 return print;
executed 138 times by 2 tests: return print;
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
138
194 }-
195-
196 template <typename T>-
197 int formatResult(char * buffer, int bufferSize, T number, int significantDigits)-
198 {-
199 QString result = formatResult(number, significantDigits);-
200 qstrncpy(buffer, result.toLatin1().constData(), bufferSize);-
201 int size = result.count();-
202 return size;
executed 188 times by 2 tests: return size;
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
188
203 }-
204}-
205-
206#if defined(Q_OS_WIN)-
207Q_CORE_EXPORT bool qt_logging_to_console(); // defined in qlogging.cpp-
208#endif-
209-
210void QPlainTestLogger::outputMessage(const char *str)-
211{-
212#if defined(Q_OS_WINCE)-
213 QString strUtf16 = QString::fromLocal8Bit(str);-
214 const int maxOutputLength = 255;-
215 do {-
216 QString tmp = strUtf16.left(maxOutputLength);-
217 OutputDebugString((wchar_t*)tmp.utf16());-
218 strUtf16.remove(0, maxOutputLength);-
219 } while (!strUtf16.isEmpty());-
220 if (stream != stdout)-
221#elif defined(Q_OS_WIN)-
222 // log to system log only if output is not redirected, and no console is attached-
223 if (!qt_logging_to_console() && stream == stdout) {-
224 OutputDebugStringA(str);-
225 return;-
226 }-
227#elif defined(Q_OS_ANDROID)-
228 __android_log_write(ANDROID_LOG_INFO, "QTestLib", str);-
229#endif-
230 outputString(str);-
231}
executed 154809 times by 540 tests: end of block
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
  • ...
154809
232-
233void QPlainTestLogger::printMessage(const char *type, const char *msg, const char *file, int line)-
234{-
235 QTEST_ASSERT(type);
never executed: qt_assert("type",__FILE__,235);
!(type)Description
TRUEnever evaluated
FALSEevaluated 152945 times by 540 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
  • ...
0-152945
236 QTEST_ASSERT(msg);
never executed: qt_assert("msg",__FILE__,236);
!(msg)Description
TRUEnever evaluated
FALSEevaluated 152945 times by 540 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
  • ...
0-152945
237-
238 QTestCharBuffer buf;-
239-
240 const char *fn = QTestResult::currentTestFunction() ? QTestResult::currentTestFunction()
QTestResult::c...TestFunction()Description
TRUEevaluated 152945 times by 540 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
  • ...
FALSEnever evaluated
0-152945
241 : "UnknownTestFunc";-
242 const char *tag = QTestResult::currentDataTag() ? QTestResult::currentDataTag() : "";
QTestResult::currentDataTag()Description
TRUEevaluated 120707 times by 361 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAccessibility
  • tst_QAction
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QAtomicInt
  • tst_QAtomicInteger_Gcc_char
  • tst_QAtomicInteger_Gcc_char16_t
  • tst_QAtomicInteger_Gcc_char32_t
  • tst_QAtomicInteger_Gcc_int
  • tst_QAtomicInteger_Gcc_long
  • ...
FALSEevaluated 32238 times by 540 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
  • ...
32238-120707
243 const char *gtag = QTestResult::currentGlobalDataTag()
QTestResult::c...lobalDataTag()Description
TRUEevaluated 3005 times by 15 tests
Evaluated by:
  • tst_QDBusLocalCalls
  • tst_QDnsLookup
  • tst_QFtp
  • tst_QHostInfo
  • tst_QSqlDriver
  • tst_QSqlRelationalTableModel
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_Utf8
  • tst_qdbusxml2cpp
  • tst_selftests - unknown status
FALSEevaluated 149940 times by 540 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
  • ...
3005-149940
244 ? QTestResult::currentGlobalDataTag()-
245 : "";-
246 const char *filler = (tag[0] && gtag[0]) ? ":" : "";
tag[0]Description
TRUEevaluated 120690 times by 361 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAccessibility
  • tst_QAction
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QAtomicInt
  • tst_QAtomicInteger_Gcc_char
  • tst_QAtomicInteger_Gcc_char16_t
  • tst_QAtomicInteger_Gcc_char32_t
  • tst_QAtomicInteger_Gcc_int
  • tst_QAtomicInteger_Gcc_long
  • ...
FALSEevaluated 32255 times by 540 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
  • ...
gtag[0]Description
TRUEevaluated 2082 times by 11 tests
Evaluated by:
  • tst_QDBusLocalCalls
  • tst_QDnsLookup
  • tst_QFtp
  • tst_QHostInfo
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_Utf8
  • tst_qdbusxml2cpp
  • tst_selftests - unknown status
FALSEevaluated 118608 times by 351 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAccessibility
  • tst_QAction
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QAtomicInt
  • tst_QAtomicInteger_Gcc_char
  • tst_QAtomicInteger_Gcc_char16_t
  • tst_QAtomicInteger_Gcc_char32_t
  • tst_QAtomicInteger_Gcc_int
  • tst_QAtomicInteger_Gcc_long
  • ...
2082-120690
247 if (file) {
fileDescription
TRUEevaluated 2527 times by 102 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAction
  • tst_QAuthenticator
  • tst_QByteArray
  • tst_QColumnView
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection_NoApplication
  • tst_QDBusLocalCalls
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDialog
  • tst_QDir
  • tst_QDockWidget
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileInfo
  • ...
FALSEevaluated 150418 times by 540 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
  • ...
2527-150418
248 QTest::qt_asprintf(&buf, "%s: %s::%s(%s%s%s)%s%s\n"-
249#ifdef Q_OS_WIN-
250 "%s(%d) : failure location\n"-
251#else-
252 " Loc: [%s(%d)]\n"-
253#endif-
254 , type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,-
255 msg[0] ? " " : "", msg, file, line);-
256 } else {
executed 2527 times by 102 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAction
  • tst_QAuthenticator
  • tst_QByteArray
  • tst_QColumnView
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection_NoApplication
  • tst_QDBusLocalCalls
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDialog
  • tst_QDir
  • tst_QDockWidget
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileInfo
  • ...
2527
257 QTest::qt_asprintf(&buf, "%s: %s::%s(%s%s%s)%s%s\n",-
258 type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,-
259 msg[0] ? " " : "", msg);-
260 }
executed 150418 times by 540 tests: end of block
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
  • ...
150418
261 // In colored mode, printf above stripped our nonprintable control characters.-
262 // Put them back.-
263 memcpy(buf.data(), type, strlen(type));-
264 outputMessage(buf.data());-
265}
executed 152945 times by 540 tests: end of block
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
  • ...
152945
266-
267void QPlainTestLogger::printBenchmarkResult(const QBenchmarkResult &result)-
268{-
269 const char *bmtag = QTest::benchmarkResult2String();-
270-
271 char buf1[1024];-
272 qsnprintf(-
273 buf1, sizeof(buf1), "%s: %s::%s",-
274 bmtag,-
275 QTestResult::currentTestObjectName(),-
276 result.context.slotName.toLatin1().data());-
277-
278 char bufTag[1024];-
279 bufTag[0] = 0;-
280 QByteArray tag = result.context.tag.toLocal8Bit();-
281 if (tag.isEmpty() == false) {
tag.isEmpty() == falseDescription
TRUEevaluated 78 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
16-78
282 qsnprintf(bufTag, sizeof(bufTag), ":\"%s\"", tag.data());-
283 }
executed 78 times by 2 tests: end of block
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
78
284-
285-
286 char fillFormat[8];-
287 int fillLength = 5;-
288 qsnprintf(fillFormat, sizeof(fillFormat), ":\n%%%ds", fillLength);-
289 char fill[1024];-
290 qsnprintf(fill, sizeof(fill), fillFormat, "");-
291-
292 const char * unitText = QTest::benchmarkMetricUnit(result.metric);-
293-
294 qreal valuePerIteration = qreal(result.value) / qreal(result.iterations);-
295 char resultBuffer[100] = "";-
296 QTest::formatResult(resultBuffer, 100, valuePerIteration, QTest::countSignificantDigits(result.value));-
297-
298 char buf2[1024];-
299 qsnprintf(buf2, sizeof(buf2), "%s %s", resultBuffer, unitText);-
300-
301 char buf2_[1024];-
302 QByteArray iterationText = " per iteration";-
303 Q_ASSERT(result.iterations > 0);-
304 qsnprintf(buf2_, sizeof(buf2_), "%s", iterationText.data());-
305-
306 char buf3[1024];-
307 Q_ASSERT(result.iterations > 0);-
308 QTest::formatResult(resultBuffer, 100, result.value, QTest::countSignificantDigits(result.value));-
309 qsnprintf(buf3, sizeof(buf3), " (total: %s, iterations: %d)", resultBuffer, result.iterations);-
310-
311 char buf[1024];-
312-
313 if (result.setByMacro) {
result.setByMacroDescription
TRUEevaluated 94 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
FALSEnever evaluated
0-94
314 qsnprintf(buf, sizeof(buf), "%s%s%s%s%s%s\n", buf1, bufTag, fill, buf2, buf2_, buf3);-
315 } else {
executed 94 times by 2 tests: end of block
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
94
316 qsnprintf(buf, sizeof(buf), "%s%s%s%s\n", buf1, bufTag, fill, buf2);-
317 }
never executed: end of block
0
318-
319 memcpy(buf, bmtag, strlen(bmtag));-
320 outputMessage(buf);-
321}
executed 94 times by 2 tests: end of block
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
94
322-
323QPlainTestLogger::QPlainTestLogger(const char *filename)-
324 : QAbstractTestLogger(filename)-
325{-
326}
executed 888 times by 539 tests: end of block
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
  • ...
888
327-
328QPlainTestLogger::~QPlainTestLogger()-
329{-
330}-
331-
332void QPlainTestLogger::startLogging()-
333{-
334 QAbstractTestLogger::startLogging();-
335-
336 char buf[1024];-
337 if (QTestLog::verboseLevel() < 0) {
QTestLog::verboseLevel() < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 884 times by 539 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
  • ...
2-884
338 qsnprintf(buf, sizeof(buf), "Testing %s\n", QTestResult::currentTestObjectName());-
339 } else {
executed 2 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
2
340 qsnprintf(buf, sizeof(buf),-
341 "********* Start testing of %s *********\n"-
342 "Config: Using QtTest library " QTEST_VERSION_STR-
343 ", %s\n", QTestResult::currentTestObjectName(), QLibraryInfo::build());-
344 }
executed 884 times by 539 tests: end of block
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
  • ...
884
345 outputMessage(buf);-
346}
executed 886 times by 539 tests: end of block
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
  • ...
886
347-
348void QPlainTestLogger::stopLogging()-
349{-
350 char buf[1024];-
351 if (QTestLog::verboseLevel() < 0) {
QTestLog::verboseLevel() < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 882 times by 539 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
  • ...
2-882
352 qsnprintf(buf, sizeof(buf), "Totals: %d passed, %d failed, %d skipped, %d blacklisted\n",-
353 QTestLog::passCount(), QTestLog::failCount(),-
354 QTestLog::skipCount(), QTestLog::blacklistCount());-
355 } else {
executed 2 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
2
356 qsnprintf(buf, sizeof(buf),-
357 "Totals: %d passed, %d failed, %d skipped, %d blacklisted\n"-
358 "********* Finished testing of %s *********\n",-
359 QTestLog::passCount(), QTestLog::failCount(),-
360 QTestLog::skipCount(), QTestLog::blacklistCount(),-
361 QTestResult::currentTestObjectName());-
362 }
executed 882 times by 539 tests: end of block
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
  • ...
882
363 outputMessage(buf);-
364-
365 QAbstractTestLogger::stopLogging();-
366}
executed 884 times by 539 tests: end of block
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
  • ...
884
367-
368-
369void QPlainTestLogger::enterTestFunction(const char * /*function*/)-
370{-
371 if (QTestLog::verboseLevel() >= 1)
QTestLog::verboseLevel() >= 1Description
TRUEevaluated 340 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 13022 times by 540 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
  • ...
340-13022
372 printMessage(QTest::messageType2String(Info), "entering");
executed 340 times by 1 test: printMessage(QTest::messageType2String(Info), "entering");
Executed by:
  • tst_selftests - unknown status
340
373}
executed 13362 times by 540 tests: end of block
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
  • ...
13362
374-
375void QPlainTestLogger::leaveTestFunction()-
376{-
377}-
378-
379void QPlainTestLogger::addIncident(IncidentTypes type, const char *description,-
380 const char *file, int line)-
381{-
382 // suppress PASS and XFAIL in silent mode-
383 if ((type == QAbstractTestLogger::Pass || type == QAbstractTestLogger::XFail)
type == QAbstr...stLogger::PassDescription
TRUEevaluated 126710 times by 540 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
  • ...
FALSEevaluated 1908 times by 71 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_QAbstractPrintDialog
  • tst_QAction
  • tst_QAuthenticator
  • tst_QColumnView
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDateTime
  • tst_QEventLoop
  • tst_QFile
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsLayoutItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QLatin1String
  • tst_QLineEdit
  • ...
type == QAbstr...tLogger::XFailDescription
TRUEevaluated 287 times by 38 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractPrintDialog
  • tst_QAuthenticator
  • tst_QColumnView
  • tst_QDBusAbstractInterface
  • tst_QDateTime
  • tst_QEventLoop
  • tst_QFile
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsLayoutItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QLatin1String
  • tst_QLineEdit
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QRect
  • tst_QSequentialAnimationGroup
  • tst_QShortcut
  • tst_QSqlDatabase
  • tst_QSqlTableModel
  • ...
FALSEevaluated 1621 times by 39 tests
Evaluated by:
  • tst_Gestures
  • tst_QAction
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFile
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QLocalSocket
  • tst_QLocale
  • tst_QLockFile
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QOpenGLWidget
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • ...
287-126710
384 && QTestLog::verboseLevel() < 0)
QTestLog::verboseLevel() < 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 126989 times by 540 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
  • ...
8-126989
385 return;
executed 8 times by 1 test: return;
Executed by:
  • tst_selftests - unknown status
8
386-
387 printMessage(QTest::incidentType2String(type), description, file, line);-
388}
executed 128610 times by 540 tests: end of block
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
  • ...
128610
389-
390void QPlainTestLogger::addBenchmarkResult(const QBenchmarkResult &result)-
391{-
392 // suppress benchmark results in silent mode-
393 if (QTestLog::verboseLevel() < 0)
QTestLog::verboseLevel() < 0Description
TRUEnever evaluated
FALSEevaluated 94 times by 2 tests
Evaluated by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
0-94
394 return;
never executed: return;
0
395-
396 printBenchmarkResult(result);-
397}
executed 94 times by 2 tests: end of block
Executed by:
  • tst_QByteDataBuffer
  • tst_selftests - unknown status
94
398-
399void QPlainTestLogger::addMessage(MessageTypes type, const QString &message,-
400 const char *file, int line)-
401{-
402 // suppress non-fatal messages in silent mode-
403 if (type != QAbstractTestLogger::QFatal && QTestLog::verboseLevel() < 0)
type != QAbstr...Logger::QFatalDescription
TRUEevaluated 23984 times by 135 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QCssParser
  • tst_QDBusConnection_NoApplication
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_selftests - unknown status
QTestLog::verboseLevel() < 0Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 23970 times by 135 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QCssParser
  • tst_QDBusConnection_NoApplication
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
14-23984
404 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_selftests - unknown status
14
405-
406 printMessage(QTest::messageType2String(type), qPrintable(message), file, line);-
407}
executed 23995 times by 135 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QColor
  • tst_QColumnView
  • tst_QCssParser
  • tst_QDBusConnection_NoApplication
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
23995
408-
409QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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