OpenCoverage

qlocale_tools.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qlocale_tools.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Copyright (C) 2016 Intel Corporation.-
5** Contact: https://www.qt.io/licensing/-
6**-
7** This file is part of the QtCore module of the Qt Toolkit.-
8**-
9** $QT_BEGIN_LICENSE:LGPL$-
10** Commercial License Usage-
11** Licensees holding valid commercial Qt licenses may use this file in-
12** accordance with the commercial license agreement provided with the-
13** Software or, alternatively, in accordance with the terms contained in-
14** a written agreement between you and The Qt Company. For licensing terms-
15** and conditions see https://www.qt.io/terms-conditions. For further-
16** information use the contact form at https://www.qt.io/contact-us.-
17**-
18** GNU Lesser General Public License Usage-
19** Alternatively, this file may be used under the terms of the GNU Lesser-
20** General Public License version 3 as published by the Free Software-
21** Foundation and appearing in the file LICENSE.LGPL3 included in the-
22** packaging of this file. Please review the following information to-
23** ensure the GNU Lesser General Public License version 3 requirements-
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
25**-
26** GNU General Public License Usage-
27** Alternatively, this file may be used under the terms of the GNU-
28** General Public License version 2.0 or (at your option) the GNU General-
29** Public license version 3 or any later version approved by the KDE Free-
30** Qt Foundation. The licenses are as published by the Free Software-
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
32** included in the packaging of this file. Please review the following-
33** information to ensure the GNU General Public License requirements will-
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
35** https://www.gnu.org/licenses/gpl-3.0.html.-
36**-
37** $QT_END_LICENSE$-
38**-
39****************************************************************************/-
40-
41#include "qlocale_tools_p.h"-
42#include "qdoublescanprint_p.h"-
43#include "qlocale_p.h"-
44#include "qstring.h"-
45-
46#include <private/qnumeric_p.h>-
47-
48#include <ctype.h>-
49#include <errno.h>-
50#include <float.h>-
51#include <limits.h>-
52#include <math.h>-
53#include <stdlib.h>-
54#include <time.h>-
55-
56#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)-
57# include <fenv.h>-
58#endif-
59-
60// Sizes as defined by the ISO C99 standard - fallback-
61#ifndef LLONG_MAX-
62# define LLONG_MAX Q_INT64_C(0x7fffffffffffffff)-
63#endif-
64#ifndef LLONG_MIN-
65# define LLONG_MIN (-LLONG_MAX - Q_INT64_C(1))-
66#endif-
67#ifndef ULLONG_MAX-
68# define ULLONG_MAX Q_UINT64_C(0xffffffffffffffff)-
69#endif-
70-
71QT_BEGIN_NAMESPACE-
72-
73#include "../../3rdparty/freebsd/strtoull.c"-
74#include "../../3rdparty/freebsd/strtoll.c"-
75-
76QT_CLOCALE_HOLDER-
77-
78void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, int bufSize,-
79 bool &sign, int &length, int &decpt)-
80{-
81 if (bufSize == 0) {
bufSize == 0Description
TRUEnever evaluated
FALSEevaluated 110646 times by 55 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
0-110646
82 decpt = 0;-
83 sign = d < 0;-
84 length = 0;-
85 return;
never executed: return;
0
86 }-
87-
88 // Detect special numbers (nan, +/-inf)-
89 // We cannot use the high-level API of libdouble-conversion as we need to apply locale-specific-
90 // formatting, such as decimal points, thousands-separators, etc. Because of this, we have to-
91 // check for infinity and NaN before calling DoubleToAscii.-
92 if (qt_is_inf(d)) {
qt_is_inf(d)Description
TRUEevaluated 550 times by 4 tests
Evaluated by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
  • tst_QVariant
FALSEevaluated 110096 times by 55 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
550-110096
93 sign = d < 0;-
94 if (bufSize >= 3) {
bufSize >= 3Description
TRUEevaluated 550 times by 4 tests
Evaluated by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
  • tst_QVariant
FALSEnever evaluated
0-550
95 buf[0] = 'i';-
96 buf[1] = 'n';-
97 buf[2] = 'f';-
98 length = 3;-
99 } else {
executed 550 times by 4 tests: end of block
Executed by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
  • tst_QVariant
550
100 length = 0;-
101 }
never executed: end of block
0
102 return;
executed 550 times by 4 tests: return;
Executed by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
  • tst_QVariant
550
103 } else if (qt_is_nan(d)) {
qt_is_nan(d)Description
TRUEevaluated 262 times by 3 tests
Evaluated by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
FALSEevaluated 109834 times by 55 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
262-109834
104 if (bufSize >= 3) {
bufSize >= 3Description
TRUEevaluated 262 times by 3 tests
Evaluated by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
FALSEnever evaluated
0-262
105 buf[0] = 'n';-
106 buf[1] = 'a';-
107 buf[2] = 'n';-
108 length = 3;-
109 } else {
executed 262 times by 3 tests: end of block
Executed by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
262
110 length = 0;-
111 }
never executed: end of block
0
112 return;
executed 262 times by 3 tests: return;
Executed by:
  • tst_QDBusMarshall
  • tst_QString
  • tst_QTextStream
262
113 }-
114-
115 if (form == QLocaleData::DFSignificantDigits && precision == 0)
form == QLocal...nificantDigitsDescription
TRUEevaluated 107580 times by 42 tests
Evaluated by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • ...
FALSEevaluated 2254 times by 21 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QStringRef
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
precision == 0Description
TRUEevaluated 1729 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QTextStream
FALSEevaluated 105851 times by 42 tests
Evaluated by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • ...
1729-107580
116 precision = 1; // 0 significant digits is silently converted to 1
executed 1729 times by 2 tests: precision = 1;
Executed by:
  • tst_QString
  • tst_QTextStream
1729
117-
118#if !defined(QT_NO_DOUBLECONVERSION) && !defined(QT_BOOTSTRAPPED)-
119 // one digit before the decimal dot, counts as significant digit for DoubleToStringConverter-
120 if (form == QLocaleData::DFExponent && precision >= 0)
form == QLocal...ta::DFExponentDescription
TRUEevaluated 17 times by 3 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
FALSEevaluated 109817 times by 54 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
precision >= 0Description
TRUEevaluated 17 times by 3 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
FALSEnever evaluated
0-109817
121 ++precision;
executed 17 times by 3 tests: ++precision;
Executed by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
17
122-
123 double_conversion::DoubleToStringConverter::DtoaMode mode;-
124 if (precision == QLocale::FloatingPointShortest) {
precision == Q...gPointShortestDescription
TRUEevaluated 144 times by 13 tests
Evaluated by:
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QGraphicsItem
  • tst_QItemDelegate
  • tst_QMetaType
  • tst_QPropertyAnimation
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextList
  • tst_QTreeWidget
  • tst_QVariant
FALSEevaluated 109690 times by 48 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLCDNumber
  • tst_QLabel
  • ...
144-109690
125 mode = double_conversion::DoubleToStringConverter::SHORTEST;-
126 } else if (form == QLocaleData::DFSignificantDigits || form == QLocaleData::DFExponent) {
executed 144 times by 13 tests: end of block
Executed by:
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QGraphicsItem
  • tst_QItemDelegate
  • tst_QMetaType
  • tst_QPropertyAnimation
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextList
  • tst_QTreeWidget
  • tst_QVariant
form == QLocal...nificantDigitsDescription
TRUEevaluated 107436 times by 35 tests
Evaluated by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • tst_QString
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • ...
FALSEevaluated 2254 times by 21 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QStringRef
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
form == QLocal...ta::DFExponentDescription
TRUEevaluated 17 times by 3 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
FALSEevaluated 2237 times by 20 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
17-107436
127 mode = double_conversion::DoubleToStringConverter::PRECISION;-
128 } else {
executed 107453 times by 36 tests: end of block
Executed by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • ...
107453
129 mode = double_conversion::DoubleToStringConverter::FIXED;-
130 }
executed 2237 times by 20 tests: end of block
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
2237
131 double_conversion::DoubleToStringConverter::DoubleToAscii(d, mode, precision, buf, bufSize,-
132 &sign, &length, &decpt);-
133#else // QT_NO_DOUBLECONVERSION || QT_BOOTSTRAPPED-
134-
135 // Cut the precision at 999, to fit it into the format string. We can't get more than 17-
136 // significant digits, so anything after that is mostly noise. You do get closer to the "middle"-
137 // of the range covered by the given double with more digits, so to a degree it does make sense-
138 // to honor higher precisions. We define that at more than 999 digits that is not the case.-
139 if (precision > 999)-
140 precision = 999;-
141 else if (precision == QLocale::FloatingPointShortest)-
142 precision = QLocaleData::DoubleMaxSignificant; // "shortest" mode not supported by snprintf-
143-
144 if (isZero(d)) {-
145 // Negative zero is expected as simple "0", not "-0". We cannot do d < 0, though.-
146 sign = false;-
147 buf[0] = '0';-
148 length = 1;-
149 decpt = 1;-
150 return;-
151 } else if (d < 0) {-
152 sign = true;-
153 d = -d;-
154 } else {-
155 sign = false;-
156 }-
157-
158 const int formatLength = 7; // '%', '.', 3 digits precision, 'f', '\0'-
159 char format[formatLength];-
160 format[formatLength - 1] = '\0';-
161 format[0] = '%';-
162 format[1] = '.';-
163 format[2] = char((precision / 100) % 10) + '0';-
164 format[3] = char((precision / 10) % 10) + '0';-
165 format[4] = char(precision % 10) + '0';-
166 int extraChars;-
167 switch (form) {-
168 case QLocaleData::DFDecimal:-
169 format[formatLength - 2] = 'f';-
170 // <anything> '.' <precision> '\0' - optimize for numbers smaller than 512k-
171 extraChars = (d > (1 << 19) ? QLocaleData::DoubleMaxDigitsBeforeDecimal : 6) + 2;-
172 break;-
173 case QLocaleData::DFExponent:-
174 format[formatLength - 2] = 'e';-
175 // '.', 'e', '-', <exponent> '\0'-
176 extraChars = 7;-
177 break;-
178 case QLocaleData::DFSignificantDigits:-
179 format[formatLength - 2] = 'g';-
180-
181 // either the same as in the 'e' case, or '.' and '\0'-
182 // precision covers part before '.'-
183 extraChars = 7;-
184 break;-
185 default:-
186 Q_UNREACHABLE();-
187 }-
188-
189 QVarLengthArray<char> target(precision + extraChars);-
190-
191 length = qDoubleSnprintf(target.data(), target.size(), QT_CLOCALE, format, d);-
192 int firstSignificant = 0;-
193 int decptInTarget = length;-
194-
195 // Find the first significant digit (not 0), and note any '.' we encounter.-
196 // There is no '-' at the front of target because we made sure d > 0 above.-
197 while (firstSignificant < length) {-
198 if (target[firstSignificant] == '.')-
199 decptInTarget = firstSignificant;-
200 else if (target[firstSignificant] != '0')-
201 break;-
202 ++firstSignificant;-
203 }-
204-
205 // If no '.' found so far, search the rest of the target buffer for it.-
206 if (decptInTarget == length)-
207 decptInTarget = std::find(target.data() + firstSignificant, target.data() + length, '.') --
208 target.data();-
209-
210 int eSign = length;-
211 if (form != QLocaleData::DFDecimal) {-
212 // In 'e' or 'g' form, look for the 'e'.-
213 eSign = std::find(target.data() + firstSignificant, target.data() + length, 'e') --
214 target.data();-
215-
216 if (eSign < length) {-
217 // If 'e' is found, the final decimal point is determined by the number after 'e'.-
218 // Mind that the final decimal point, decpt, is the offset of the decimal point from the-
219 // start of the resulting string in buf. It may be negative or larger than bufSize, in-
220 // which case the missing digits are zeroes. In the 'e' case decptInTarget is always 1,-
221 // as variants of snprintf always generate numbers with one digit before the '.' then.-
222 // This is why the final decimal point is offset by 1, relative to the number after 'e'.-
223 bool ok;-
224 const char *endptr;-
225 decpt = qstrtoll(target.data() + eSign + 1, &endptr, 10, &ok) + 1;-
226 Q_ASSERT(ok);-
227 Q_ASSERT(endptr - target.data() <= length);-
228 } else {-
229 // No 'e' found, so it's the 'f' form. Variants of snprintf generate numbers with-
230 // potentially multiple digits before the '.', but without decimal exponent then. So we-
231 // get the final decimal point from the position of the '.'. The '.' itself takes up one-
232 // character. We adjust by 1 below if that gets in the way.-
233 decpt = decptInTarget - firstSignificant;-
234 }-
235 } else {-
236 // In 'f' form, there can not be an 'e', so it's enough to look for the '.'-
237 // (and possibly adjust by 1 below)-
238 decpt = decptInTarget - firstSignificant;-
239 }-
240-
241 // Move the actual digits from the snprintf target to the actual buffer.-
242 if (decptInTarget > firstSignificant) {-
243 // First move the digits before the '.', if any-
244 int lengthBeforeDecpt = decptInTarget - firstSignificant;-
245 memcpy(buf, target.data() + firstSignificant, qMin(lengthBeforeDecpt, bufSize));-
246 if (eSign > decptInTarget && lengthBeforeDecpt < bufSize) {-
247 // Then move any remaining digits, until 'e'-
248 memcpy(buf + lengthBeforeDecpt, target.data() + decptInTarget + 1,-
249 qMin(eSign - decptInTarget - 1, bufSize - lengthBeforeDecpt));-
250 // The final length of the output is the distance between the first significant digit-
251 // and 'e' minus 1, for the '.', except if the buffer is smaller.-
252 length = qMin(eSign - firstSignificant - 1, bufSize);-
253 } else {-
254 // 'e' was before the decpt or things didn't fit. Don't subtract the '.' from the length.-
255 length = qMin(eSign - firstSignificant, bufSize);-
256 }-
257 } else {-
258 if (eSign > firstSignificant) {-
259 // If there are any significant digits at all, they are all after the '.' now.-
260 // Just copy them straight away.-
261 memcpy(buf, target.data() + firstSignificant, qMin(eSign - firstSignificant, bufSize));-
262-
263 // The decimal point was before the first significant digit, so we were one off above.-
264 // Consider 0.1 - buf will be just '1', and decpt should be 0. But-
265 // "decptInTarget - firstSignificant" will yield -1.-
266 ++decpt;-
267 length = qMin(eSign - firstSignificant, bufSize);-
268 } else {-
269 // No significant digits means the number is just 0.-
270 buf[0] = '0';-
271 length = 1;-
272 decpt = 1;-
273 }-
274 }-
275#endif // QT_NO_DOUBLECONVERSION || QT_BOOTSTRAPPED-
276 while (length > 1 && buf[length - 1] == '0') // drop trailing zeroes
length > 1Description
TRUEevaluated 159154 times by 50 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLabel
  • tst_QMetaType
  • ...
FALSEevaluated 61145 times by 46 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLCDNumber
  • tst_QOpenGlConfig
  • ...
buf[length - 1] == '0'Description
TRUEevaluated 110465 times by 35 tests
Evaluated by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • ...
FALSEevaluated 48689 times by 43 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • ...
48689-159154
277 --length;
executed 110465 times by 35 tests: --length;
Executed by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • ...
110465
278}
executed 109834 times by 55 tests: end of block
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
109834
279-
280double asciiToDouble(const char *num, int numLen, bool &ok, int &processed,-
281 TrailingJunkMode trailingJunkMode)-
282{-
283 if (*num == '\0') {
*num == '\0'Description
TRUEnever evaluated
FALSEevaluated 4198 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
0-4198
284 ok = false;-
285 processed = 0;-
286 return 0.0;
never executed: return 0.0;
0
287 }-
288-
289 ok = true;-
290-
291 // We have to catch NaN before because we need NaN as marker for "garbage" in the-
292 // libdouble-conversion case and, in contrast to libdouble-conversion or sscanf, we don't allow-
293 // "-nan" or "+nan"-
294 if (qstrcmp(num, "nan") == 0) {
qstrcmp(num, "nan") == 0Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 4191 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
7-4191
295 processed = 3;-
296 return qt_snan();
executed 7 times by 1 test: return qt_snan();
Executed by:
  • tst_QString
7
297 } else if ((num[0] == '-' || num[0] == '+') && qstrcmp(num + 1, "nan") == 0) {
num[0] == '-'Description
TRUEevaluated 404 times by 9 tests
Evaluated by:
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QSpinBox
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
FALSEevaluated 3787 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
num[0] == '+'Description
TRUEevaluated 10 times by 3 tests
Evaluated by:
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QString
FALSEevaluated 3777 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
qstrcmp(num + 1, "nan") == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 412 times by 9 tests
Evaluated by:
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QSpinBox
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
2-3787
298 processed = 0;-
299 ok = false;-
300 return 0.0;
executed 2 times by 1 test: return 0.0;
Executed by:
  • tst_QString
2
301 }-
302-
303 // Infinity values are implementation defined in the sscanf case. In the libdouble-conversion-
304 // case we need infinity as overflow marker.-
305 if (qstrcmp(num, "+inf") == 0) {
qstrcmp(num, "+inf") == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 4186 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
3-4186
306 processed = 4;-
307 return qt_inf();
executed 3 times by 1 test: return qt_inf();
Executed by:
  • tst_QString
3
308 } else if (qstrcmp(num, "inf") == 0) {
qstrcmp(num, "inf") == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 4180 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
6-4180
309 processed = 3;-
310 return qt_inf();
executed 6 times by 1 test: return qt_inf();
Executed by:
  • tst_QString
6
311 } else if (qstrcmp(num, "-inf") == 0) {
qstrcmp(num, "-inf") == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 4178 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
2-4178
312 processed = 4;-
313 return -qt_inf();
executed 2 times by 1 test: return -qt_inf();
Executed by:
  • tst_QString
2
314 }-
315-
316 double d = 0.0;-
317#if !defined(QT_NO_DOUBLECONVERSION) && !defined(QT_BOOTSTRAPPED)-
318 int conv_flags = (trailingJunkMode == TrailingJunkAllowed) ?
(trailingJunkM...ngJunkAllowed)Description
TRUEnever evaluated
FALSEevaluated 4178 times by 28 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • ...
0-4178
319 double_conversion::StringToDoubleConverter::ALLOW_TRAILING_JUNK :-
320 double_conversion::StringToDoubleConverter::NO_FLAGS;-
321 double_conversion::StringToDoubleConverter conv(conv_flags, 0.0, qt_snan(), 0, 0);-
322 d = conv.StringToDouble(num, numLen, &processed);-
323-
324 if (!qIsFinite(d)) {
!qIsFinite(d)Description
TRUEevaluated 328 times by 11 tests
Evaluated by:
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QInputDialog
  • tst_QMetaType
  • tst_QObject
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QVariant
FALSEevaluated 3850 times by 26 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • tst_QVariant
  • tst_QWidget
  • ...
328-3850
325 ok = false;-
326 if (qIsNaN(d)) {
qIsNaN(d)Description
TRUEevaluated 328 times by 11 tests
Evaluated by:
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QInputDialog
  • tst_QMetaType
  • tst_QObject
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QVariant
FALSEnever evaluated
0-328
327 // Garbage found. We don't accept it and return 0.-
328 processed = 0;-
329 return 0.0;
executed 328 times by 11 tests: return 0.0;
Executed by:
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QInputDialog
  • tst_QMetaType
  • tst_QObject
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QVariant
328
330 } else {-
331 // Overflow. That's not OK, but we still return infinity.-
332 return d;
never executed: return d;
0
333 }-
334 }-
335#else-
336 if (qDoubleSscanf(num, QT_CLOCALE, "%lf%n", &d, &processed) < 1)-
337 processed = 0;-
338-
339 if ((trailingJunkMode == TrailingJunkProhibited && processed != numLen) || qIsNaN(d)) {-
340 // Implementation defined nan symbol or garbage found. We don't accept it.-
341 processed = 0;-
342 ok = false;-
343 return 0.0;-
344 }-
345-
346 if (!qIsFinite(d)) {-
347 // Overflow. Check for implementation-defined infinity symbols and reject them.-
348 // We assume that any infinity symbol has to contain a character that cannot be part of a-
349 // "normal" number (that is 0-9, ., -, +, e).-
350 ok = false;-
351 for (int i = 0; i < processed; ++i) {-
352 char c = num[i];-
353 if ((c < '0' || c > '9') && c != '.' && c != '-' && c != '+' && c != 'e') {-
354 // Garbage found-
355 processed = 0;-
356 return 0.0;-
357 }-
358 }-
359 return d;-
360 }-
361#endif // !defined(QT_NO_DOUBLECONVERSION) && !defined(QT_BOOTSTRAPPED)-
362-
363 // Otherwise we would have gotten NaN or sorted it out above.-
364 Q_ASSERT(trailingJunkMode == TrailingJunkAllowed || processed == numLen);-
365-
366 // Check if underflow has occurred.-
367 if (isZero(d)) {
isZero(d)Description
TRUEevaluated 1182 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_Selftests
FALSEevaluated 2668 times by 26 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • tst_QVariant
  • tst_QWidget
  • ...
1182-2668
368 for (int i = 0; i < processed; ++i) {
i < processedDescription
TRUEevaluated 4553 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_Selftests
FALSEevaluated 1182 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_Selftests
1182-4553
369 if (num[i] >= '1' && num[i] <= '9') {
num[i] >= '1'Description
TRUEnever evaluated
FALSEevaluated 4553 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_Selftests
num[i] <= '9'Description
TRUEnever evaluated
FALSEnever evaluated
0-4553
370 // if a digit before any 'e' is not 0, then a non-zero number was intended.-
371 ok = false;-
372 return 0.0;
never executed: return 0.0;
0
373 } else if (num[i] == 'e') {
num[i] == 'e'Description
TRUEnever evaluated
FALSEevaluated 4553 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_Selftests
0-4553
374 break;
never executed: break;
0
375 }-
376 }
executed 4553 times by 18 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_Selftests
4553
377 }
executed 1182 times by 18 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_Selftests
1182
378 return d;
executed 3850 times by 26 tests: return d;
Executed by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QTextStream
  • tst_QVariant
  • tst_QWidget
  • ...
3850
379}-
380-
381unsigned long long-
382qstrtoull(const char * nptr, const char **endptr, int base, bool *ok)-
383{-
384 // strtoull accepts negative numbers. We don't.-
385 // Use a different variable so we pass the original nptr to strtoul-
386 // (we need that so endptr may be nptr in case of failure)-
387 const char *begin = nptr;-
388 while (ascii_isspace(*begin))
ascii_isspace(*begin)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QUrl
  • tst_QVersionNumber
FALSEevaluated 108198 times by 84 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDataUrl
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSelector
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • ...
3-108198
389 ++begin;
executed 3 times by 2 tests: ++begin;
Executed by:
  • tst_QUrl
  • tst_QVersionNumber
3
390 if (*begin == '-') {
*begin == '-'Description
TRUEevaluated 77 times by 10 tests
Evaluated by:
  • tst_QDate
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QIpAddress
  • tst_QString
  • tst_QStringRef
  • tst_QUrl
  • tst_QUrlInternal
  • tst_QVariant
  • tst_QVersionNumber
FALSEevaluated 108121 times by 84 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDataUrl
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSelector
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • ...
77-108121
391 *ok = false;-
392 return 0;
executed 77 times by 10 tests: return 0;
Executed by:
  • tst_QDate
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QIpAddress
  • tst_QString
  • tst_QStringRef
  • tst_QUrl
  • tst_QUrlInternal
  • tst_QVariant
  • tst_QVersionNumber
77
393 }-
394-
395 *ok = true;-
396 errno = 0;-
397 char *endptr2 = 0;-
398 unsigned long long result = qt_strtoull(nptr, &endptr2, base);-
399 if (endptr)
endptrDescription
TRUEevaluated 108121 times by 84 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDataUrl
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSelector
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • ...
FALSEnever evaluated
0-108121
400 *endptr = endptr2;
executed 108121 times by 84 tests: *endptr = endptr2;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDataUrl
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSelector
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • ...
108121
401 if ((result == 0 || result == std::numeric_limits<unsigned long long>::max())
result == 0Description
TRUEevaluated 46394 times by 65 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QDataUrl
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFileSelector
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QIpAddress
  • tst_QItemDelegate
  • tst_QMetaType
  • ...
FALSEevaluated 61727 times by 70 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFile
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
result == std:...g long>::max()Description
TRUEevaluated 18 times by 4 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
  • tst_QVariant
  • tst_QVersionNumber
FALSEevaluated 61709 times by 70 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFile
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
18-61727
402 && (errno || endptr2 == nptr)) {
(*__errno_location ())Description
TRUEevaluated 36779 times by 48 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QDataUrl
  • tst_QFileSelector
  • tst_QFtp
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIpAddress
  • tst_QMetaType
  • tst_QMimeData
  • tst_QMimeDatabase
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkCookieJar
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • ...
FALSEevaluated 9633 times by 43 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QImageReader
  • tst_QIpAddress
  • tst_QItemDelegate
  • tst_QMimeDatabase
  • tst_QNetworkAddressEntry
  • tst_QNetworkCookieJar
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QObject
  • ...
endptr2 == nptrDescription
TRUEnever evaluated
FALSEevaluated 9633 times by 43 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QImageReader
  • tst_QIpAddress
  • tst_QItemDelegate
  • tst_QMimeDatabase
  • tst_QNetworkAddressEntry
  • tst_QNetworkCookieJar
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QObject
  • ...
0-36779
403 *ok = false;-
404 return 0;
executed 36779 times by 48 tests: return 0;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QDataUrl
  • tst_QFileSelector
  • tst_QFtp
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIpAddress
  • tst_QMetaType
  • tst_QMimeData
  • tst_QMimeDatabase
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkCookieJar
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • ...
36779
405 }-
406 return result;
executed 71342 times by 70 tests: return result;
Executed by:
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDnsLookup
  • tst_QEventLoop
  • tst_QFile
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHostAddress
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
71342
407}-
408-
409long long-
410qstrtoll(const char * nptr, const char **endptr, int base, bool *ok)-
411{-
412 *ok = true;-
413 errno = 0;-
414 char *endptr2 = 0;-
415 long long result = qt_strtoll(nptr, &endptr2, base);-
416 if (endptr)
endptrDescription
TRUEevaluated 355844 times by 105 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • ...
FALSEevaluated 43 times by 2 tests
Evaluated by:
  • tst_QGestureRecognizer
  • tst_QGetPutEnv
43-355844
417 *endptr = endptr2;
executed 355844 times by 105 tests: *endptr = endptr2;
Executed by:
  • tst_Collections
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • ...
355844
418 if ((result == 0 || result == std::numeric_limits<long long>::min()
result == 0Description
TRUEevaluated 9959 times by 49 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGLThreads
  • tst_QGetPutEnv
  • tst_QGraphicsView
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QInputDialog
  • tst_QIntValidator
  • tst_QItemDelegate
  • tst_QLayout
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • ...
FALSEevaluated 345928 times by 104 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGLBuffer
  • ...
result == std:...g long>::min()Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
FALSEevaluated 345922 times by 104 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGLBuffer
  • ...
6-345928
419 || result == std::numeric_limits<long long>::max())
result == std:...g long>::max()Description
TRUEevaluated 13 times by 3 tests
Evaluated by:
  • tst_QIntValidator
  • tst_QString
  • tst_QStringRef
FALSEevaluated 345909 times by 104 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGLBuffer
  • ...
13-345909
420 && (errno || nptr == endptr2)) {
(*__errno_location ())Description
TRUEevaluated 201 times by 19 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QGetPutEnv
  • tst_QInputDialog
  • tst_QIntValidator
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QPlugin
  • tst_QSettings
  • tst_QSpinBox
  • tst_QSqlError
  • tst_QSqlRelationalTableModel
  • tst_QString
  • tst_QStringRef
  • tst_QTime
  • tst_QTreeWidget
  • tst_QVariant
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 9777 times by 42 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGLThreads
  • tst_QGetPutEnv
  • tst_QGraphicsView
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QInputDialog
  • tst_QIntValidator
  • tst_QItemDelegate
  • tst_QLayout
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • ...
nptr == endptr2Description
TRUEnever evaluated
FALSEevaluated 9777 times by 42 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGLBuffer
  • tst_QGLFunctions
  • tst_QGLThreads
  • tst_QGetPutEnv
  • tst_QGraphicsView
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QInputDialog
  • tst_QIntValidator
  • tst_QItemDelegate
  • tst_QLayout
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • ...
0-9777
421 *ok = false;-
422 return 0;
executed 201 times by 19 tests: return 0;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QGetPutEnv
  • tst_QInputDialog
  • tst_QIntValidator
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QPlugin
  • tst_QSettings
  • tst_QSpinBox
  • tst_QSqlError
  • tst_QSqlRelationalTableModel
  • tst_QString
  • tst_QStringRef
  • tst_QTime
  • tst_QTreeWidget
  • tst_QVariant
  • tst_qmakelib
  • tst_selftests - unknown status
201
423 }-
424 return result;
executed 355686 times by 105 tests: return result;
Executed by:
  • tst_Collections
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • ...
355686
425}-
426-
427QString qulltoa(qulonglong l, int base, const QChar _zero)-
428{-
429 ushort buff[65]; // length of MAX_ULLONG in base 2-
430 ushort *p = buff + 65;-
431-
432 if (base != 10 || _zero.unicode() == '0') {
base != 10Description
TRUEevaluated 26388 times by 96 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBrush
  • tst_QChar
  • tst_QColor
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDebug
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • ...
FALSEevaluated 4981420 times by 456 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • ...
_zero.unicode() == '0'Description
TRUEevaluated 4981409 times by 456 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • ...
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QProgressBar
  • tst_QString
11-4981420
433 while (l != 0) {
l != 0Description
TRUEevaluated 10051446 times by 319 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
FALSEevaluated 5007797 times by 467 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
5007797-10051446
434 int c = l % base;-
435-
436 --p;-
437-
438 if (c < 10)
c < 10Description
TRUEevaluated 9991798 times by 319 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
FALSEevaluated 59648 times by 90 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBrush
  • tst_QChar
  • tst_QColor
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDebug
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • ...
59648-9991798
439 *p = '0' + c;
executed 9991798 times by 319 tests: *p = '0' + c;
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
9991798
440 else-
441 *p = c - 10 + 'a';
executed 59648 times by 90 tests: *p = c - 10 + 'a';
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBrush
  • tst_QChar
  • tst_QColor
  • tst_QColorDialog
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDebug
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • ...
59648
442-
443 l /= base;-
444 }
executed 10051446 times by 319 tests: end of block
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
10051446
445 }
executed 5007797 times by 467 tests: end of block
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
5007797
446 else {-
447 while (l != 0) {
l != 0Description
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QProgressBar
  • tst_QString
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QProgressBar
  • tst_QString
11-32
448 int c = l % base;-
449-
450 *(--p) = _zero.unicode() + c;-
451-
452 l /= base;-
453 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_QProgressBar
  • tst_QString
32
454 }
executed 11 times by 2 tests: end of block
Executed by:
  • tst_QProgressBar
  • tst_QString
11
455-
456 return QString(reinterpret_cast<QChar *>(p), 65 - (p - buff));
executed 5007808 times by 467 tests: return QString(reinterpret_cast<QChar *>(p), 65 - (p - buff));
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
5007808
457}-
458-
459QString qlltoa(qlonglong l, int base, const QChar zero)-
460{-
461 return qulltoa(l < 0 ? -l : l, base, zero);
executed 4942476 times by 439 tests: return qulltoa(l < 0 ? -l : l, base, zero);
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • ...
4942476
462}-
463-
464QString &decimalForm(QChar zero, QChar decimal, QChar group,-
465 QString &digits, int decpt, int precision,-
466 PrecisionMode pm,-
467 bool always_show_decpt,-
468 bool thousands_group)-
469{-
470 if (decpt < 0) {
decpt < 0Description
TRUEevaluated 18518 times by 5 tests
Evaluated by:
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QInputDialog
  • tst_QString
  • tst_QTextStream
FALSEevaluated 84964 times by 54 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
18518-84964
471 for (int i = 0; i < -decpt; ++i)
i < -decptDescription
TRUEevaluated 46372 times by 5 tests
Evaluated by:
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QInputDialog
  • tst_QString
  • tst_QTextStream
FALSEevaluated 18518 times by 5 tests
Evaluated by:
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QInputDialog
  • tst_QString
  • tst_QTextStream
18518-46372
472 digits.prepend(zero);
executed 46372 times by 5 tests: digits.prepend(zero);
Executed by:
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QInputDialog
  • tst_QString
  • tst_QTextStream
46372
473 decpt = 0;-
474 }
executed 18518 times by 5 tests: end of block
Executed by:
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QInputDialog
  • tst_QString
  • tst_QTextStream
18518
475 else if (decpt > digits.length()) {
decpt > digits.length()Description
TRUEevaluated 983 times by 20 tests
Evaluated by:
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPrinter
  • tst_QPropertyAnimation
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextList
  • tst_selftests - unknown status
FALSEevaluated 83981 times by 54 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
983-83981
476 for (int i = digits.length(); i < decpt; ++i)
i < decptDescription
TRUEevaluated 2314 times by 20 tests
Evaluated by:
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPrinter
  • tst_QPropertyAnimation
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextList
  • tst_selftests - unknown status
FALSEevaluated 983 times by 20 tests
Evaluated by:
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPrinter
  • tst_QPropertyAnimation
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextList
  • tst_selftests - unknown status
983-2314
477 digits.append(zero);
executed 2314 times by 20 tests: digits.append(zero);
Executed by:
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPrinter
  • tst_QPropertyAnimation
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextList
  • tst_selftests - unknown status
2314
478 }
executed 983 times by 20 tests: end of block
Executed by:
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPrinter
  • tst_QPropertyAnimation
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextList
  • tst_selftests - unknown status
983
479-
480 if (pm == PMDecimalDigits) {
pm == PMDecimalDigitsDescription
TRUEevaluated 2237 times by 20 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
FALSEevaluated 101245 times by 42 tests
Evaluated by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • ...
2237-101245
481 uint decimal_digits = digits.length() - decpt;-
482 for (int i = decimal_digits; i < precision; ++i)
i < precisionDescription
TRUEevaluated 9836 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
FALSEevaluated 2237 times by 20 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
2237-9836
483 digits.append(zero);
executed 9836 times by 18 tests: digits.append(zero);
Executed by:
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
9836
484 }
executed 2237 times by 20 tests: end of block
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteDataBuffer
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItemAnimation
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QUdpSocket
  • tst_selftests - unknown status
2237
485 else if (pm == PMSignificantDigits) {
pm == PMSignificantDigitsDescription
TRUEevaluated 2386 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QTextStream
FALSEevaluated 98859 times by 42 tests
Evaluated by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • ...
2386-98859
486 for (int i = digits.length(); i < precision; ++i)
i < precisionDescription
TRUEevaluated 7938 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QTextStream
FALSEevaluated 2386 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QTextStream
2386-7938
487 digits.append(zero);
executed 7938 times by 2 tests: digits.append(zero);
Executed by:
  • tst_QString
  • tst_QTextStream
7938
488 }
executed 2386 times by 2 tests: end of block
Executed by:
  • tst_QString
  • tst_QTextStream
2386
489 else { // pm == PMChopTrailingZeros-
490 }
executed 98859 times by 42 tests: end of block
Executed by:
  • tst_QBrush
  • tst_QByteArray
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • ...
98859
491-
492 if (always_show_decpt || decpt < digits.length())
always_show_decptDescription
TRUEevaluated 2388 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QTextStream
FALSEevaluated 101094 times by 54 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
decpt < digits.length()Description
TRUEevaluated 47695 times by 34 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDriver
  • ...
FALSEevaluated 53399 times by 37 tests
Evaluated by:
  • tst_QBrush
  • tst_QByteDataBuffer
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPainter
  • tst_QPdfWriter
  • tst_QPlainTextEdit
  • tst_QPrinter
  • tst_QPropertyAnimation
  • tst_QSpinBox
  • tst_QString
  • ...
2388-101094
493 digits.insert(decpt, decimal);
executed 50083 times by 34 tests: digits.insert(decpt, decimal);
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDriver
  • ...
50083
494-
495 if (thousands_group) {
thousands_groupDescription
TRUEevaluated 5369 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QString
  • tst_QTextStream
FALSEevaluated 98113 times by 49 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_QPageSize
  • ...
5369-98113
496 for (int i = decpt - 3; i > 0; i -= 3)
i > 0Description
TRUEevaluated 2234 times by 3 tests
Evaluated by:
  • tst_QDoubleSpinBox
  • tst_QString
  • tst_QTextStream
FALSEevaluated 5369 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QString
  • tst_QTextStream
2234-5369
497 digits.insert(i, group);
executed 2234 times by 3 tests: digits.insert(i, group);
Executed by:
  • tst_QDoubleSpinBox
  • tst_QString
  • tst_QTextStream
2234
498 }
executed 5369 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QPrinter
  • tst_QString
  • tst_QTextStream
5369
499-
500 if (decpt == 0)
decpt == 0Description
TRUEevaluated 45893 times by 13 tests
Evaluated by:
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDoubleSpinBox
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QPrinter
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QTreeWidget
FALSEevaluated 57589 times by 53 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
45893-57589
501 digits.prepend(zero);
executed 45893 times by 13 tests: digits.prepend(zero);
Executed by:
  • tst_QColor
  • tst_QDBusMarshall
  • tst_QDoubleSpinBox
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QPrinter
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextDocument
  • tst_QTextStream
  • tst_QTreeWidget
45893
502-
503 return digits;
executed 103482 times by 54 tests: return digits;
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QBrush
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDebug
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • ...
103482
504}-
505-
506QString &exponentForm(QChar zero, QChar decimal, QChar exponential,-
507 QChar group, QChar plus, QChar minus,-
508 QString &digits, int decpt, int precision,-
509 PrecisionMode pm,-
510 bool always_show_decpt,-
511 bool leading_zero_in_exponent)-
512{-
513 int exp = decpt - 1;-
514-
515 if (pm == PMDecimalDigits) {
pm == PMDecimalDigitsDescription
TRUEevaluated 17 times by 3 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
FALSEevaluated 6335 times by 5 tests
Evaluated by:
  • tst_QByteArray
  • tst_QDoubleSpinBox
  • tst_QGraphicsTransform
  • tst_QString
  • tst_QTextStream
17-6335
516 for (int i = digits.length(); i < precision + 1; ++i)
i < precision + 1Description
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
FALSEevaluated 17 times by 3 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
16-17
517 digits.append(zero);
executed 16 times by 3 tests: digits.append(zero);
Executed by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
16
518 }
executed 17 times by 3 tests: end of block
Executed by:
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
17
519 else if (pm == PMSignificantDigits) {
pm == PMSignificantDigitsDescription
TRUEevaluated 2224 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 4111 times by 5 tests
Evaluated by:
  • tst_QByteArray
  • tst_QDoubleSpinBox
  • tst_QGraphicsTransform
  • tst_QString
  • tst_QTextStream
2224-4111
520 for (int i = digits.length(); i < precision; ++i)
i < precisionDescription
TRUEevaluated 1920 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 2224 times by 1 test
Evaluated by:
  • tst_QString
1920-2224
521 digits.append(zero);
executed 1920 times by 1 test: digits.append(zero);
Executed by:
  • tst_QString
1920
522 }
executed 2224 times by 1 test: end of block
Executed by:
  • tst_QString
2224
523 else { // pm == PMChopTrailingZeros-
524 }
executed 4111 times by 5 tests: end of block
Executed by:
  • tst_QByteArray
  • tst_QDoubleSpinBox
  • tst_QGraphicsTransform
  • tst_QString
  • tst_QTextStream
4111
525-
526 if (always_show_decpt || digits.length() > 1)
always_show_decptDescription
TRUEevaluated 2226 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QTextStream
FALSEevaluated 4126 times by 6 tests
Evaluated by:
  • tst_QByteArray
  • tst_QDoubleSpinBox
  • tst_QGraphicsTransform
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
digits.length() > 1Description
TRUEevaluated 2805 times by 5 tests
Evaluated by:
  • tst_QByteArray
  • tst_QGraphicsTransform
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
FALSEevaluated 1321 times by 2 tests
Evaluated by:
  • tst_QDoubleSpinBox
  • tst_QString
1321-4126
527 digits.insert(1, decimal);
executed 5031 times by 5 tests: digits.insert(1, decimal);
Executed by:
  • tst_QByteArray
  • tst_QGraphicsTransform
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
5031
528-
529 digits.append(exponential);-
530 digits.append(QLocaleData::longLongToString(zero, group, plus, minus,-
531 exp, leading_zero_in_exponent ? 2 : 1, 10, -1, QLocaleData::AlwaysShowSign));-
532-
533 return digits;
executed 6352 times by 6 tests: return digits;
Executed by:
  • tst_QByteArray
  • tst_QDoubleSpinBox
  • tst_QGraphicsTransform
  • tst_QString
  • tst_QStringRef
  • tst_QTextStream
6352
534}-
535-
536double qstrtod(const char *s00, const char **se, bool *ok)-
537{-
538 const int len = static_cast<int>(strlen(s00));-
539 Q_ASSERT(len >= 0);-
540 return qstrntod(s00, len, se, ok);
never executed: return qstrntod(s00, len, se, ok);
0
541}-
542-
543/*!-
544 \internal-
545-
546 Converts the initial portion of the string pointed to by \a s00 to a double, using the 'C' locale.-
547 */-
548double qstrntod(const char *s00, int len, const char **se, bool *ok)-
549{-
550 int processed = 0;-
551 bool nonNullOk = false;-
552 double d = asciiToDouble(s00, len, nonNullOk, processed, TrailingJunkAllowed);-
553 if (se)
seDescription
TRUEnever evaluated
FALSEnever evaluated
0
554 *se = s00 + processed;
never executed: *se = s00 + processed;
0
555 if (ok)
okDescription
TRUEnever evaluated
FALSEnever evaluated
0
556 *ok = nonNullOk;
never executed: *ok = nonNullOk;
0
557 return d;
never executed: return d;
0
558}-
559-
560QString qdtoa(qreal d, int *decpt, int *sign)-
561{-
562 bool nonNullSign = false;-
563 int nonNullDecpt = 0;-
564 int length = 0;-
565-
566 // Some versions of libdouble-conversion like an extra digit, probably for '\0'-
567 char result[QLocaleData::DoubleMaxSignificant + 1];-
568 doubleToAscii(d, QLocaleData::DFSignificantDigits, QLocale::FloatingPointShortest, result,-
569 QLocaleData::DoubleMaxSignificant + 1, nonNullSign, length, nonNullDecpt);-
570-
571 if (sign)
signDescription
TRUEnever evaluated
FALSEnever evaluated
0
572 *sign = nonNullSign ? 1 : 0;
never executed: *sign = nonNullSign ? 1 : 0;
nonNullSignDescription
TRUEnever evaluated
FALSEnever evaluated
0
573 if (decpt)
decptDescription
TRUEnever evaluated
FALSEnever evaluated
0
574 *decpt = nonNullDecpt;
never executed: *decpt = nonNullDecpt;
0
575-
576 return QLatin1String(result, length);
never executed: return QLatin1String(result, length);
0
577}-
578-
579QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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