OpenCoverage

qstring.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qstring.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 "qstringlist.h"-
42#include "qregexp.h"-
43#include "qregularexpression.h"-
44#include "qunicodetables_p.h"-
45#ifndef QT_NO_TEXTCODEC-
46#include <qtextcodec.h>-
47#endif-
48#include <private/qutfcodec_p.h>-
49#include <private/qlocale_tools_p.h>-
50#include "qsimd_p.h"-
51#include <qnumeric.h>-
52#include <qdatastream.h>-
53#include <qlist.h>-
54#include "qlocale.h"-
55#include "qlocale_p.h"-
56#include "qstringbuilder.h"-
57#include "qstringmatcher.h"-
58#include "qvarlengtharray.h"-
59#include "qtools_p.h"-
60#include "qdebug.h"-
61#include "qendian.h"-
62#include "qcollator.h"-
63-
64#ifdef Q_OS_MAC-
65#include <private/qcore_mac_p.h>-
66#endif-
67-
68#include <private/qfunctions_p.h>-
69-
70#include <limits.h>-
71#include <string.h>-
72#include <stdlib.h>-
73#include <stdio.h>-
74#include <stdarg.h>-
75-
76#include "qchar.cpp"-
77#include "qstringmatcher.cpp"-
78#include "qstringiterator_p.h"-
79#include "qstringalgorithms_p.h"-
80#include "qthreadstorage.h"-
81-
82#ifdef Q_OS_WIN-
83# include <qt_windows.h>-
84# ifdef Q_OS_WINCE-
85# include <winnls.h>-
86# endif-
87#endif-
88-
89#ifdef truncate-
90# undef truncate-
91#endif-
92-
93#ifndef LLONG_MAX-
94#define LLONG_MAX qint64_C(9223372036854775807)-
95#endif-
96#ifndef LLONG_MIN-
97#define LLONG_MIN (-LLONG_MAX - qint64_C(1))-
98#endif-
99#ifndef ULLONG_MAX-
100#define ULLONG_MAX quint64_C(18446744073709551615)-
101#endif-
102-
103#define IS_RAW_DATA(d) ((d)->offset != sizeof(QStringData))-
104-
105QT_BEGIN_NAMESPACE-
106-
107/*-
108 * Note on the use of SIMD in qstring.cpp:-
109 *-
110 * Several operations with strings are improved with the use of SIMD code,-
111 * since they are repetitive. For MIPS, we have hand-written assembly code-
112 * outside of qstring.cpp targeting MIPS DSP and MIPS DSPr2. For ARM and for-
113 * x86, we can only use intrinsics and therefore everything is contained in-
114 * qstring.cpp. We need to use intrinsics only for those platforms due to the-
115 * different compilers and toolchains used, which have different syntax for-
116 * assembly sources.-
117 *-
118 * ** SSE notes: **-
119 *-
120 * Whenever multiple alternatives are equivalent or near so, we prefer the one-
121 * using instructions from SSE2, since SSE2 is guaranteed to be enabled for all-
122 * 64-bit builds and we enable it for 32-bit builds by default. Use of higher-
123 * SSE versions should be done when there's a clear performance benefit and-
124 * requires fallback code to SSE2, if it exists.-
125 *-
126 * Performance measurement in the past shows that most strings are short in-
127 * size and, therefore, do not benefit from alignment prologues. That is,-
128 * trying to find a 16-byte-aligned boundary to operate on is often more-
129 * expensive than executing the unaligned operation directly. In addition, note-
130 * that the QString private data is designed so that the data is stored on-
131 * 16-byte boundaries if the system malloc() returns 16-byte aligned pointers-
132 * on its own (64-bit glibc on Linux does; 32-bit glibc on Linux returns them-
133 * 50% of the time), so skipping the alignment prologue is actually optimizing-
134 * for the common case.-
135 */-
136-
137#if defined(__mips_dsp)-
138// From qstring_mips_dsp_asm.S-
139extern "C" void qt_fromlatin1_mips_asm_unroll4 (ushort*, const char*, uint);-
140extern "C" void qt_fromlatin1_mips_asm_unroll8 (ushort*, const char*, uint);-
141extern "C" void qt_toLatin1_mips_dsp_asm(uchar *dst, const ushort *src, int length);-
142#endif-
143-
144// internal-
145int qFindString(const QChar *haystack, int haystackLen, int from,-
146 const QChar *needle, int needleLen, Qt::CaseSensitivity cs);-
147int qFindStringBoyerMoore(const QChar *haystack, int haystackLen, int from,-
148 const QChar *needle, int needleLen, Qt::CaseSensitivity cs);-
149static inline int qt_last_index_of(const QChar *haystack, int haystackLen, QChar needle,-
150 int from, Qt::CaseSensitivity cs);-
151static inline int qt_string_count(const QChar *haystack, int haystackLen,-
152 const QChar *needle, int needleLen,-
153 Qt::CaseSensitivity cs);-
154static inline int qt_string_count(const QChar *haystack, int haystackLen,-
155 QChar needle, Qt::CaseSensitivity cs);-
156static inline int qt_find_latin1_string(const QChar *hay, int size, QLatin1String needle,-
157 int from, Qt::CaseSensitivity cs);-
158static inline bool qt_starts_with(const QChar *haystack, int haystackLen,-
159 const QChar *needle, int needleLen, Qt::CaseSensitivity cs);-
160static inline bool qt_starts_with(const QChar *haystack, int haystackLen,-
161 QLatin1String needle, Qt::CaseSensitivity cs);-
162static inline bool qt_ends_with(const QChar *haystack, int haystackLen,-
163 const QChar *needle, int needleLen, Qt::CaseSensitivity cs);-
164static inline bool qt_ends_with(const QChar *haystack, int haystackLen,-
165 QLatin1String needle, Qt::CaseSensitivity cs);-
166-
167#if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)-
168namespace {-
169template <uint MaxCount> struct UnrollTailLoop-
170{-
171 template <typename RetType, typename Functor1, typename Functor2>-
172 static inline RetType exec(int count, RetType returnIfExited, Functor1 loopCheck, Functor2 returnIfFailed, int i = 0)-
173 {-
174 /* equivalent to:-
175 * while (count--) {-
176 * if (loopCheck(i))-
177 * return returnIfFailed(i);-
178 * }-
179 * return returnIfExited;-
180 */-
181-
182 if (!count)
!countDescription
TRUEevaluated 6730103 times by 686 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 35953269 times by 773 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
  • ...
6730103-35953269
183 return returnIfExited;
executed 6730106 times by 686 tests: return returnIfExited;
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
  • ...
6730106
184-
185 bool check = loopCheck(i);-
186 if (check) {
checkDescription
TRUEevaluated 1370215 times by 552 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • ...
FALSEevaluated 34583054 times by 773 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
  • ...
1370215-34583054
187 const RetType &retval = returnIfFailed(i);-
188 return retval;
executed 1370215 times by 552 tests: return retval;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • ...
1370215
189 }-
190-
191 return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
executed 34583054 times by 773 tests: return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
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
  • ...
34583054
192 }-
193-
194 template <typename Functor>-
195 static inline void exec(int count, Functor code)-
196 {-
197 /* equivalent to:-
198 * for (int i = 0; i < count; ++i)-
199 * code(i);-
200 */-
201 exec(count, 0, [=](int i) -> bool { code(i); return false; }, [](int) { return 0; });
executed 17278209 times by 686 tests: return false;
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
  • ...
never executed: return 0;
0-17278209
202 }
executed 2644017 times by 686 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
  • ...
2644017
203};-
204template <> template <typename RetType, typename Functor1, typename Functor2>-
205inline RetType UnrollTailLoop<0>::exec(int, RetType returnIfExited, Functor1, Functor2, int)-
206{-
207 return returnIfExited;
executed 778568 times by 446 tests: return returnIfExited;
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_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • ...
778568
208}-
209}-
210#endif-
211-
212// conversion between Latin 1 and UTF-16-
213void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW-
214{-
215 /* SIMD:-
216 * Unpacking with SSE has been shown to improve performance on recent CPUs-
217 * The same method gives no improvement with NEON.-
218 */-
219#if defined(__SSE2__)-
220 const char *e = str + size;-
221 qptrdiff offset = 0;-
222-
223 // we're going to read str[offset..offset+15] (16 bytes)-
224 for ( ; str + offset + 15 < e; offset += 16) {
str + offset + 15 < eDescription
TRUEevaluated 1702045 times by 504 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_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • ...
FALSEevaluated 2360203 times by 686 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
  • ...
1702045-2360203
225 const __m128i chunk = _mm_loadu_si128((const __m128i*)(str + offset)); // load-
226#ifdef __AVX2__-
227 // zero extend to an YMM register-
228 const __m256i extended = _mm256_cvtepu8_epi16(chunk);-
229-
230 // store-
231 _mm256_storeu_si256((__m256i*)(dst + offset), extended);-
232#else-
233 const __m128i nullMask = _mm_set1_epi32(0);-
234-
235 // unpack the first 8 bytes, padding with zeros-
236 const __m128i firstHalf = _mm_unpacklo_epi8(chunk, nullMask);-
237 _mm_storeu_si128((__m128i*)(dst + offset), firstHalf); // store-
238-
239 // unpack the last 8 bytes, padding with zeros-
240 const __m128i secondHalf = _mm_unpackhi_epi8 (chunk, nullMask);-
241 _mm_storeu_si128((__m128i*)(dst + offset + 8), secondHalf); // store-
242#endif-
243 }
executed 1702045 times by 504 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_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • ...
1702045
244-
245 size = size % 16;-
246 dst += offset;-
247 str += offset;-
248# if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)-
249 return UnrollTailLoop<15>::exec(int(size), [=](int i) { dst[i] = (uchar)str[i]; });
executed 15853376 times by 686 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
  • ...
executed 2360203 times by 686 tests: return UnrollTailLoop<15>::exec(int(size), [=](int i) { dst[i] = (uchar)str[i]; });
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
  • ...
2360203-15853376
250# endif-
251#endif-
252#if defined(__mips_dsp)-
253 if (size > 20)-
254 qt_fromlatin1_mips_asm_unroll8(dst, str, size);-
255 else-
256 qt_fromlatin1_mips_asm_unroll4(dst, str, size);-
257#else-
258 while (size--)
dead code: while (size--) *dst++ = (uchar)*str++;
-
259 *dst++ = (uchar)*str++;
dead code: while (size--) *dst++ = (uchar)*str++;
-
260#endif-
261}-
262-
263#if defined(__SSE2__)-
264static inline __m128i mergeQuestionMarks(__m128i chunk)-
265{-
266 const __m128i questionMark = _mm_set1_epi16('?');-
267-
268# ifdef __SSE4_2__-
269 // compare the unsigned shorts for the range 0x0100-0xFFFF-
270 // note on the use of _mm_cmpestrm:-
271 // The MSDN documentation online (http://technet.microsoft.com/en-us/library/bb514080.aspx)-
272 // says for range search the following:-
273 // For each character c in a, determine whether b0 <= c <= b1 or b2 <= c <= b3-
274 //-
275 // However, all examples on the Internet, including from Intel-
276 // (see http://software.intel.com/en-us/articles/xml-parsing-accelerator-with-intel-streaming-simd-extensions-4-intel-sse4/)-
277 // put the range to be searched first-
278 //-
279 // Disassembly and instruction-level debugging with GCC and ICC show-
280 // that they are doing the right thing. Inverting the arguments in the-
281 // instruction does cause a bunch of test failures.-
282-
283 const __m128i rangeMatch = _mm_cvtsi32_si128(0xffff0100);-
284 const __m128i offLimitMask = _mm_cmpestrm(rangeMatch, 2, chunk, 8,-
285 _SIDD_UWORD_OPS | _SIDD_CMP_RANGES | _SIDD_UNIT_MASK);-
286-
287 // replace the non-Latin 1 characters in the chunk with question marks-
288 chunk = _mm_blendv_epi8(chunk, questionMark, offLimitMask);-
289# else-
290 // SSE has no compare instruction for unsigned comparison.-
291 // The variables must be shiffted + 0x8000 to be compared-
292 const __m128i signedBitOffset = _mm_set1_epi16(short(0x8000));-
293 const __m128i thresholdMask = _mm_set1_epi16(short(0xff + 0x8000));-
294-
295 const __m128i signedChunk = _mm_add_epi16(chunk, signedBitOffset);-
296 const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask);-
297-
298# ifdef __SSE4_1__-
299 // replace the non-Latin 1 characters in the chunk with question marks-
300 chunk = _mm_blendv_epi8(chunk, questionMark, offLimitMask);-
301# else-
302 // offLimitQuestionMark contains '?' for each 16 bits that was off-limit-
303 // the 16 bits that were correct contains zeros-
304 const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark);-
305-
306 // correctBytes contains the bytes that were in limit-
307 // the 16 bits that were off limits contains zeros-
308 const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk);-
309-
310 // merge offLimitQuestionMark and correctBytes to have the result-
311 chunk = _mm_or_si128(correctBytes, offLimitQuestionMark);-
312# endif-
313# endif-
314 return chunk;
executed 804590 times by 383 tests: return chunk;
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • ...
804590
315}-
316#endif-
317-
318static void qt_to_latin1(uchar *dst, const ushort *src, int length)-
319{-
320#if defined(__SSE2__)-
321 uchar *e = dst + length;-
322 qptrdiff offset = 0;-
323-
324 // we're going to write to dst[offset..offset+15] (16 bytes)-
325 for ( ; dst + offset + 15 < e; offset += 16) {
dst + offset + 15 < eDescription
TRUEevaluated 402295 times by 383 tests
Evaluated by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • ...
FALSEevaluated 283814 times by 445 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
283814-402295
326 __m128i chunk1 = _mm_loadu_si128((const __m128i*)(src + offset)); // load-
327 chunk1 = mergeQuestionMarks(chunk1);-
328-
329 __m128i chunk2 = _mm_loadu_si128((const __m128i*)(src + offset + 8)); // load-
330 chunk2 = mergeQuestionMarks(chunk2);-
331-
332 // pack the two vector to 16 x 8bits elements-
333 const __m128i result = _mm_packus_epi16(chunk1, chunk2);-
334 _mm_storeu_si128((__m128i*)(dst + offset), result); // store-
335 }
executed 402295 times by 383 tests: end of block
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QByteDataBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • ...
402295
336-
337 length = length % 16;-
338 dst += offset;-
339 src += offset;-
340-
341# if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)-
342 return UnrollTailLoop<15>::exec(length, [=](int i) { dst[i] = (src[i]>0xff) ? '?' : (uchar) src[i]; });
executed 1424833 times by 444 tests: end of block
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
executed 283814 times by 445 tests: return UnrollTailLoop<15>::exec(length, [=](int i) { dst[i] = (src[i]>0xff) ? '?' : (uchar) src[i]; });
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
(src[i]>0xff)Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QUrl
FALSEevaluated 1424822 times by 444 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
11-1424833
343# endif-
344#elif defined(__ARM_NEON__)-
345 // Refer to the documentation of the SSE2 implementation-
346 // this use eactly the same method as for SSE except:-
347 // 1) neon has unsigned comparison-
348 // 2) packing is done to 64 bits (8 x 8bits component).-
349 if (length >= 16) {-
350 const int chunkCount = length >> 3; // divided by 8-
351 const uint16x8_t questionMark = vdupq_n_u16('?'); // set-
352 const uint16x8_t thresholdMask = vdupq_n_u16(0xff); // set-
353 for (int i = 0; i < chunkCount; ++i) {-
354 uint16x8_t chunk = vld1q_u16((uint16_t *)src); // load-
355 src += 8;-
356-
357 const uint16x8_t offLimitMask = vcgtq_u16(chunk, thresholdMask); // chunk > thresholdMask-
358 const uint16x8_t offLimitQuestionMark = vandq_u16(offLimitMask, questionMark); // offLimitMask & questionMark-
359 const uint16x8_t correctBytes = vbicq_u16(chunk, offLimitMask); // !offLimitMask & chunk-
360 chunk = vorrq_u16(correctBytes, offLimitQuestionMark); // correctBytes | offLimitQuestionMark-
361 const uint8x8_t result = vmovn_u16(chunk); // narrowing move->packing-
362 vst1_u8(dst, result); // store-
363 dst += 8;-
364 }-
365 length = length % 8;-
366 }-
367#endif-
368#if defined(__mips_dsp)-
369 qt_toLatin1_mips_dsp_asm(dst, src, length);-
370#else-
371 while (length--) {
dead code: while (length--) { *dst++ = (*src>0xff) ? '?' : (uchar) *src; ++src; }
-
372 *dst++ = (*src>0xff) ? '?' : (uchar) *src;
dead code: while (length--) { *dst++ = (*src>0xff) ? '?' : (uchar) *src; ++src; }
-
373 ++src;
dead code: while (length--) { *dst++ = (*src>0xff) ? '?' : (uchar) *src; ++src; }
-
374 }
dead code: while (length--) { *dst++ = (*src>0xff) ? '?' : (uchar) *src; ++src; }
-
375#endif-
376}-
377-
378// Unicode case-insensitive comparison-
379static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const ushort *be)-
380{-
381 if (a == b)
a == bDescription
TRUEevaluated 4330 times by 125 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
FALSEevaluated 513417 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
4330-513417
382 return (ae - be);
executed 4330 times by 125 tests: return (ae - be);
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
4330
383 if (a == 0)
a == 0Description
TRUEnever evaluated
FALSEevaluated 513417 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
0-513417
384 return 1;
never executed: return 1;
0
385 if (b == 0)
b == 0Description
TRUEnever evaluated
FALSEevaluated 513417 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
0-513417
386 return -1;
never executed: return -1;
0
387-
388 const ushort *e = ae;-
389 if (be - b < ae - a)
be - b < ae - aDescription
TRUEevaluated 254847 times by 134 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFile
  • ...
FALSEevaluated 258570 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
254847-258570
390 e = a + (be - b);
executed 254847 times by 134 tests: e = a + (be - b);
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFile
  • ...
254847
391-
392 uint alast = 0;-
393 uint blast = 0;-
394 while (a < e) {
a < eDescription
TRUEevaluated 1726112 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
FALSEevaluated 75123 times by 165 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
75123-1726112
395// qDebug() << hex << alast << blast;-
396// qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast);-
397// qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast);-
398 int diff = foldCase(*a, alast) - foldCase(*b, blast);-
399 if ((diff))
(diff)Description
TRUEevaluated 438294 times by 155 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
FALSEevaluated 1287818 times by 166 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
438294-1287818
400 return diff;
executed 438294 times by 155 tests: return diff;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
438294
401 ++a;-
402 ++b;-
403 }
executed 1287818 times by 166 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
1287818
404 if (a == ae) {
a == aeDescription
TRUEevaluated 69364 times by 165 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
FALSEevaluated 5759 times by 126 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
5759-69364
405 if (b == be)
b == beDescription
TRUEevaluated 59683 times by 165 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
FALSEevaluated 9681 times by 126 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
9681-59683
406 return 0;
executed 59683 times by 165 tests: return 0;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
59683
407 return -1;
executed 9681 times by 126 tests: return -1;
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
9681
408 }-
409 return 1;
executed 5759 times by 126 tests: return 1;
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
5759
410}-
411-
412// Case-insensitive comparison between a Unicode string and a QLatin1String-
413static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b, const uchar *be)-
414{-
415 if (a == 0) {
a == 0Description
TRUEnever evaluated
FALSEevaluated 17633 times by 48 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDialog
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • ...
0-17633
416 if (b == 0)
b == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
417 return 0;
never executed: return 0;
0
418 return 1;
never executed: return 1;
0
419 }-
420 if (b == 0)
b == 0Description
TRUEnever evaluated
FALSEevaluated 17633 times by 48 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDialog
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • ...
0-17633
421 return -1;
never executed: return -1;
0
422-
423 const ushort *e = ae;-
424 if (be - b < ae - a)
be - b < ae - aDescription
TRUEevaluated 4341 times by 25 tests
Evaluated by:
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMenu
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTabBar
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QToolTip
  • tst_QWidget
  • tst_QXmlStream
  • tst_qmakelib
FALSEevaluated 13292 times by 48 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDialog
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • ...
4341-13292
425 e = a + (be - b);
executed 4341 times by 25 tests: e = a + (be - b);
Executed by:
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMenu
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTabBar
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QToolTip
  • tst_QWidget
  • tst_QXmlStream
  • tst_qmakelib
4341
426-
427 while (a < e) {
a < eDescription
TRUEevaluated 69971 times by 48 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDialog
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • ...
FALSEevaluated 4645 times by 41 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDockWidget
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • ...
4645-69971
428 int diff = foldCase(*a) - foldCase(*b);-
429 if ((diff))
(diff)Description
TRUEevaluated 12988 times by 35 tests
Evaluated by:
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDialog
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMenu
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPrinter
  • tst_QStaticText
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTabBar
  • tst_QTextBrowser
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • ...
FALSEevaluated 56983 times by 41 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDockWidget
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • ...
12988-56983
430 return diff;
executed 12988 times by 35 tests: return diff;
Executed by:
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDialog
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMenu
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPrinter
  • tst_QStaticText
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTabBar
  • tst_QTextBrowser
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • ...
12988
431 ++a;-
432 ++b;-
433 }
executed 56983 times by 41 tests: end of block
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDockWidget
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • ...
56983
434 if (a == ae) {
a == aeDescription
TRUEevaluated 4294 times by 41 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDockWidget
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • ...
FALSEevaluated 351 times by 15 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QToolTip
  • tst_QXmlStream
351-4294
435 if (b == be)
b == beDescription
TRUEevaluated 3894 times by 41 tests
Evaluated by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDockWidget
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • ...
FALSEevaluated 400 times by 14 tests
Evaluated by:
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrinter
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
  • tst_QWidget
400-3894
436 return 0;
executed 3894 times by 41 tests: return 0;
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDockWidget
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrintDevice
  • tst_QPrinter
  • tst_QPrinterInfo
  • tst_QStaticText
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • ...
3894
437 return -1;
executed 400 times by 14 tests: return -1;
Executed by:
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QPrinter
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
  • tst_QWidget
400
438 }-
439 return 1;
executed 351 times by 15 tests: return 1;
Executed by:
  • tst_QAccessibility
  • tst_QCssParser
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • tst_QToolTip
  • tst_QXmlStream
351
440}-
441-
442#if defined(__mips_dsp)-
443// From qstring_mips_dsp_asm.S-
444extern "C" int qt_ucstrncmp_mips_dsp_asm(const ushort *a,-
445 const ushort *b,-
446 unsigned len);-
447#endif-
448-
449// Unicode case-sensitive compare two same-sized strings-
450static int ucstrncmp(const QChar *a, const QChar *b, int l)-
451{-
452#if defined(__mips_dsp)-
453 if (l >= 8) {-
454 return qt_ucstrncmp_mips_dsp_asm(reinterpret_cast<const ushort*>(a),-
455 reinterpret_cast<const ushort*>(b),-
456 l);-
457 }-
458#endif // __mips_dsp-
459#ifdef __SSE2__-
460 const char *ptr = reinterpret_cast<const char*>(a);-
461 qptrdiff distance = reinterpret_cast<const char*>(b) - ptr;-
462 a += l & ~7;-
463 b += l & ~7;-
464 l &= 7;-
465-
466 // we're going to read ptr[0..15] (16 bytes)-
467 for ( ; ptr + 15 < reinterpret_cast<const char *>(a); ptr += 16) {
ptr + 15 < rei...nst char *>(a)Description
TRUEevaluated 6295678 times by 598 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • ...
FALSEevaluated 4168074 times by 613 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
4168074-6295678
468 __m128i a_data = _mm_loadu_si128((const __m128i*)ptr);-
469 __m128i b_data = _mm_loadu_si128((const __m128i*)(ptr + distance));-
470 __m128i result = _mm_cmpeq_epi16(a_data, b_data);-
471 uint mask = ~_mm_movemask_epi8(result);-
472 if (ushort(mask)) {
ushort(mask)Description
TRUEevaluated 1562574 times by 466 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • ...
FALSEevaluated 4733104 times by 597 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QAuthenticator
  • ...
1562574-4733104
473 // found a different byte-
474 uint idx = uint(_bit_scan_forward(mask));-
475 return reinterpret_cast<const QChar *>(ptr + idx)->unicode()
executed 1562574 times by 466 tests: return reinterpret_cast<const QChar *>(ptr + idx)->unicode() - reinterpret_cast<const QChar *>(ptr + distance + idx)->unicode();
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • ...
1562574
476 - reinterpret_cast<const QChar *>(ptr + distance + idx)->unicode();
executed 1562574 times by 466 tests: return reinterpret_cast<const QChar *>(ptr + idx)->unicode() - reinterpret_cast<const QChar *>(ptr + distance + idx)->unicode();
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • ...
1562574
477 }-
478 }
executed 4733104 times by 597 tests: end of block
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QAsn1Element
  • tst_QAuthenticator
  • ...
4733104
479# if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)-
480 const auto &lambda = [=](int i) -> int {-
481 return reinterpret_cast<const QChar *>(ptr)[i].unicode()
executed 14175902 times by 612 tests: return reinterpret_cast<const QChar *>(ptr)[i].unicode() - reinterpret_cast<const QChar *>(ptr + distance)[i].unicode();
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
14175902
482 - reinterpret_cast<const QChar *>(ptr + distance)[i].unicode();
executed 14175902 times by 612 tests: return reinterpret_cast<const QChar *>(ptr)[i].unicode() - reinterpret_cast<const QChar *>(ptr + distance)[i].unicode();
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
14175902
483 };-
484 return UnrollTailLoop<7>::exec(l, 0, lambda, lambda);
executed 4168074 times by 613 tests: return UnrollTailLoop<7>::exec(l, 0, lambda, lambda);
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
4168074
485# endif-
486#endif-
487 if (!l)
dead code: if (!l) return 0;
-
488 return 0;
dead code: if (!l) return 0;
-
489-
490 // check alignment-
491 if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) {
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
492 // both addresses have the same alignment
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
493 if (reinterpret_cast<quintptr>(a) & 2) {
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
494 // both addresses are not aligned to 4-bytes boundaries
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
495 // compare the first character
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
496 if (*a != *b)
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
497 return a->unicode() - b->unicode();
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
498 --l;
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
499 ++a;
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
500 ++b;
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
501-
502 // now both addresses are 4-bytes aligned
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
503 }
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
504-
505 // both addresses are 4-bytes aligned
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
506 // do a fast 32-bit comparison
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
507 const quint32 *da = reinterpret_cast<const quint32 *>(a);
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
508 const quint32 *db = reinterpret_cast<const quint32 *>(b);
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
509 const quint32 *e = da + (l >> 1);
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
510 for ( ; da != e; ++da, ++db) {
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
511 if (*da != *db) {
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
512 a = reinterpret_cast<const QChar *>(da);
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
513 b = reinterpret_cast<const QChar *>(db);
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
514 if (*a != *b)
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
515 return a->unicode() - b->unicode();
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
516 return a[1].unicode() - b[1].unicode();
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
517 }
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
518 }
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
519-
520 // do we have a tail?
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
521 a = reinterpret_cast<const QChar *>(da);
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
522 b = reinterpret_cast<const QChar *>(db);
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
523 return (l & 1) ? a->unicode() - b->unicode() : 0;
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
524 } else {
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
525 // one of the addresses isn't 4-byte aligned but the other is
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
526 const QChar *e = a + l;
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
527 for ( ; a != e; ++a, ++b) {
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
528 if (*a != *b)
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
529 return a->unicode() - b->unicode();
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
530 }
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
531 }
dead code: if ((reinterpret_cast<quintptr>(a) & 2) == (reinterpret_cast<quintptr>(b) & 2)) { if (reinterpret_cast<quintptr>(a) & 2) { if (*a != *b) return a->unicode() - b->unicode(); --l; ++a; ++b; } const quint32 *da = reinterpret_cast<const quint32 *>(a); const q...e(); } } a = reinterpret_cast<const QChar *>(da); b = reinterpret_cast<const QChar *>(db); return (l & 1) ? a->unicode() - b->unicode() : 0; } else { const QChar *e = a + l; for ( ; a != e; ++a, ++b) { if (*a != *b) return a->unicode() - b->unicode(); } }
-
532 return 0;
dead code: return 0;
-
533}-
534-
535static int ucstrncmp(const QChar *a, const uchar *c, int l)-
536{-
537 const ushort *uc = reinterpret_cast<const ushort *>(a);-
538 const ushort *e = uc + l;-
539-
540#ifdef __SSE2__-
541 __m128i nullmask = _mm_setzero_si128();-
542 qptrdiff offset = 0;-
543-
544 // we're going to read uc[offset..offset+15] (32 bytes)-
545 // and c[offset..offset+15] (16 bytes)-
546 for ( ; uc + offset + 15 < e; offset += 16) {
uc + offset + 15 < eDescription
TRUEevaluated 51214 times by 342 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
FALSEevaluated 1029669 times by 463 tests
Evaluated by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
51214-1029669
547 // similar to fromLatin1_helper:-
548 // load 16 bytes of Latin 1 data-
549 __m128i chunk = _mm_loadu_si128((const __m128i*)(c + offset));-
550-
551# ifdef __AVX2__-
552 // expand Latin 1 data via zero extension-
553 __m256i ldata = _mm256_cvtepu8_epi16(chunk);-
554-
555 // load UTF-16 data and compare-
556 __m256i ucdata = _mm256_loadu_si256((const __m256i*)(uc + offset));-
557 __m256i result = _mm256_cmpeq_epi16(ldata, ucdata);-
558-
559 uint mask = ~_mm256_movemask_epi8(result);-
560# else-
561 // expand via unpacking-
562 __m128i firstHalf = _mm_unpacklo_epi8(chunk, nullmask);-
563 __m128i secondHalf = _mm_unpackhi_epi8(chunk, nullmask);-
564-
565 // load UTF-16 data and compare-
566 __m128i ucdata1 = _mm_loadu_si128((const __m128i*)(uc + offset));-
567 __m128i ucdata2 = _mm_loadu_si128((const __m128i*)(uc + offset + 8));-
568 __m128i result1 = _mm_cmpeq_epi16(firstHalf, ucdata1);-
569 __m128i result2 = _mm_cmpeq_epi16(secondHalf, ucdata2);-
570-
571 uint mask = ~(_mm_movemask_epi8(result1) | _mm_movemask_epi8(result2) << 16);-
572# endif-
573 if (mask) {
maskDescription
TRUEevaluated 21005 times by 60 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusPendingCall
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsEffect
  • tst_QGraphicsEffectSource
  • tst_QGraphicsGridLayout
  • tst_QGraphicsItem
  • tst_QGraphicsLayout
  • tst_QGraphicsLinearLayout
  • ...
FALSEevaluated 30209 times by 341 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
21005-30209
574 // found a different character-
575 uint idx = uint(_bit_scan_forward(mask));-
576 return uc[offset + idx / 2] - c[offset + idx / 2];
executed 21005 times by 60 tests: return uc[offset + idx / 2] - c[offset + idx / 2];
Executed by:
  • tst_Gestures
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusPendingCall
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsEffect
  • tst_QGraphicsEffectSource
  • tst_QGraphicsGridLayout
  • tst_QGraphicsItem
  • tst_QGraphicsLayout
  • tst_QGraphicsLinearLayout
  • ...
21005
577 }-
578 }
executed 30209 times by 341 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
30209
579-
580# ifdef Q_PROCESSOR_X86_64-
581 enum { MaxTailLength = 7 };-
582 // we'll read uc[offset..offset+7] (16 bytes) and c[offset..offset+7] (8 bytes)-
583 if (uc + offset + 7 < e) {
uc + offset + 7 < eDescription
TRUEevaluated 355489 times by 249 tests
Evaluated by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
FALSEevaluated 674180 times by 458 tests
Evaluated by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
355489-674180
584 // same, but we're using an 8-byte load-
585 __m128i chunk = _mm_cvtsi64_si128(qFromUnaligned<long long>(c + offset));-
586 __m128i secondHalf = _mm_unpacklo_epi8(chunk, nullmask);-
587-
588 __m128i ucdata = _mm_loadu_si128((const __m128i*)(uc + offset));-
589 __m128i result = _mm_cmpeq_epi16(secondHalf, ucdata);-
590 uint mask = ~_mm_movemask_epi8(result);-
591 if (ushort(mask)) {
ushort(mask)Description
TRUEevaluated 39170 times by 211 tests
Evaluated by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColor
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • ...
FALSEevaluated 316319 times by 237 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColor
  • ...
39170-316319
592 // found a different character-
593 uint idx = uint(_bit_scan_forward(mask));-
594 return uc[offset + idx / 2] - c[offset + idx / 2];
executed 39170 times by 211 tests: return uc[offset + idx / 2] - c[offset + idx / 2];
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColor
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • ...
39170
595 }-
596-
597 // still matched-
598 offset += 8;-
599 }
executed 316319 times by 237 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColor
  • ...
316319
600# else-
601 // 32-bit, we can't do MOVQ to load 8 bytes-
602 Q_UNUSED(nullmask);-
603 enum { MaxTailLength = 15 };-
604# endif-
605-
606 // reset uc and c-
607 uc += offset;-
608 c += offset;-
609-
610# if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)-
611 const auto &lambda = [=](int i) { return uc[i] - ushort(c[i]); };
executed 3238334 times by 462 tests: return uc[i] - ushort(c[i]);
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
3238334
612 return UnrollTailLoop<MaxTailLength>::exec(e - uc, 0, lambda, lambda);
executed 990499 times by 462 tests: return UnrollTailLoop<MaxTailLength>::exec(e - uc, 0, lambda, lambda);
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
990499
613# endif-
614#endif-
615-
616 while (uc < e) {
dead code: while (uc < e) { int diff = *uc - *c; if (diff) return diff; uc++, c++; }
-
617 int diff = *uc - *c;
dead code: while (uc < e) { int diff = *uc - *c; if (diff) return diff; uc++, c++; }
-
618 if (diff)
dead code: while (uc < e) { int diff = *uc - *c; if (diff) return diff; uc++, c++; }
-
619 return diff;
dead code: while (uc < e) { int diff = *uc - *c; if (diff) return diff; uc++, c++; }
-
620 uc++, c++;
dead code: while (uc < e) { int diff = *uc - *c; if (diff) return diff; uc++, c++; }
-
621 }
dead code: while (uc < e) { int diff = *uc - *c; if (diff) return diff; uc++, c++; }
-
622-
623 return 0;
dead code: return 0;
-
624}-
625-
626// Unicode case-sensitive comparison-
627static int ucstrcmp(const QChar *a, int alen, const QChar *b, int blen)-
628{-
629 if (a == b && alen == blen)
a == bDescription
TRUEevaluated 80138 times by 430 tests
Evaluated by:
  • tst_Collections
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • ...
FALSEevaluated 2435359 times by 457 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCoreApplication
  • ...
alen == blenDescription
TRUEevaluated 80137 times by 430 tests
Evaluated by:
  • tst_Collections
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QString
1-2435359
630 return 0;
executed 80137 times by 430 tests: return 0;
Executed by:
  • tst_Collections
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • ...
80137
631 int l = qMin(alen, blen);-
632 int cmp = ucstrncmp(a, b, l);-
633 return cmp ? cmp : (alen-blen);
executed 2435360 times by 457 tests: return cmp ? cmp : (alen-blen);
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCoreApplication
  • ...
2435360
634}-
635-
636// Unicode case-insensitive compare two same-sized strings-
637static int ucstrnicmp(const ushort *a, const ushort *b, int l)-
638{-
639 return ucstricmp(a, a + l, b, b + l);
executed 1171 times by 13 tests: return ucstricmp(a, a + l, b, b + l);
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QItemDelegate
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_QTime
  • tst_qlogging - unknown status
1171
640}-
641-
642static bool qMemEquals(const quint16 *a, const quint16 *b, int length)-
643{-
644 if (a == b || !length)
a == bDescription
TRUEevaluated 931815 times by 465 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • ...
FALSEevaluated 3343386 times by 400 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
!lengthDescription
TRUEevaluated 339741 times by 135 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • tst_QDBusServiceWatcher
  • tst_QDataStream
  • tst_QDataWidgetMapper
  • tst_QDate
  • ...
FALSEevaluated 3003645 times by 399 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
339741-3343386
645 return true;
executed 1271556 times by 476 tests: return true;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • ...
1271556
646-
647 return ucstrncmp(reinterpret_cast<const QChar *>(a), reinterpret_cast<const QChar *>(b), length) == 0;
executed 3003645 times by 399 tests: return ucstrncmp(reinterpret_cast<const QChar *>(a), reinterpret_cast<const QChar *>(b), length) == 0;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
3003645
648}-
649-
650static int ucstrcmp(const QChar *a, int alen, const uchar *b, int blen)-
651{-
652 int l = qMin(alen, blen);-
653 int cmp = ucstrncmp(a, b, l);-
654 return cmp ? cmp : (alen-blen);
executed 217591 times by 445 tests: return cmp ? cmp : (alen-blen);
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • ...
217591
655}-
656-
657/*!-
658 \internal-
659-
660 Returns the index position of the first occurrence of the-
661 character \a ch in the string given by \a str and \a len,-
662 searching forward from index-
663 position \a from. Returns -1 if \a ch could not be found.-
664*/-
665static int findChar(const QChar *str, int len, QChar ch, int from,-
666 Qt::CaseSensitivity cs)-
667{-
668 const ushort *s = (const ushort *)str;-
669 ushort c = ch.unicode();-
670 if (from < 0)
from < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_Collections
FALSEevaluated 1483189 times by 325 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
1-1483189
671 from = qMax(from + len, 0);
executed 1 time by 1 test: from = qMax(from + len, 0);
Executed by:
  • tst_Collections
1
672 if (from < len) {
from < lenDescription
TRUEevaluated 1479302 times by 322 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QCollator
  • ...
FALSEevaluated 3888 times by 70 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBrush
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDir
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsGridLayout
  • tst_QGraphicsItem
  • tst_QGraphicsLayout
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsView
  • ...
3888-1479302
673 const ushort *n = s + from;-
674 const ushort *e = s + len;-
675 if (cs == Qt::CaseSensitive) {
cs == Qt::CaseSensitiveDescription
TRUEevaluated 1478841 times by 321 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • ...
FALSEevaluated 461 times by 6 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QLabel
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_qmakelib
461-1478841
676#ifdef __SSE2__-
677 __m128i mch = _mm_set1_epi32(c | (c << 16));-
678-
679 // we're going to read n[0..7] (16 bytes)-
680 for (const ushort *next = n + 8; next <= e; n = next, next += 8) {
next <= eDescription
TRUEevaluated 1107407 times by 313 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • ...
FALSEevaluated 1076299 times by 310 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • ...
1076299-1107407
681 __m128i data = _mm_loadu_si128((const __m128i*)n);-
682 __m128i result = _mm_cmpeq_epi16(data, mch);-
683 uint mask = _mm_movemask_epi8(result);-
684 if (ushort(mask)) {
ushort(mask)Description
TRUEevaluated 402542 times by 273 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
FALSEevaluated 704865 times by 299 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • ...
402542-704865
685 // found a match-
686 // same as: return n - s + _bit_scan_forward(mask) / 2-
687 return (reinterpret_cast<const char *>(n) - reinterpret_cast<const char *>(s)
executed 402542 times by 273 tests: return (reinterpret_cast<const char *>(n) - reinterpret_cast<const char *>(s) + __bsfd(mask)) >> 1;
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
402542
688 + _bit_scan_forward(mask)) >> 1;
executed 402542 times by 273 tests: return (reinterpret_cast<const char *>(n) - reinterpret_cast<const char *>(s) + __bsfd(mask)) >> 1;
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
402542
689 }-
690 }
executed 704865 times by 299 tests: end of block
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • ...
704865
691-
692# if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)-
693 return UnrollTailLoop<7>::exec(e - n, -1,
executed 1076299 times by 310 tests: return UnrollTailLoop<7>::exec(e - n, -1, [=](int i) { return n[i] == c; }, [=](int i) { return n - s + i; });
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • ...
1076299
694 [=](int i) { return n[i] == c; },
executed 1076299 times by 310 tests: return UnrollTailLoop<7>::exec(e - n, -1, [=](int i) { return n[i] == c; }, [=](int i) { return n - s + i; });
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • ...
executed 2552540 times by 308 tests: return n[i] == c;
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • ...
1076299-2552540
695 [=](int i) { return n - s + i; });
executed 1076299 times by 310 tests: return UnrollTailLoop<7>::exec(e - n, -1, [=](int i) { return n[i] == c; }, [=](int i) { return n - s + i; });
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • ...
executed 73549 times by 135 tests: return n - s + i;
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QCollator
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaObject
  • ...
73549-1076299
696# endif-
697#endif-
698 --n;
dead code: --n;
-
699 while (++n != e)
dead code: while (++n != e) if (*n == c) return n - s;
-
700 if (*n == c)
dead code: while (++n != e) if (*n == c) return n - s;
-
701 return n - s;
dead code: while (++n != e) if (*n == c) return n - s;
-
702 } else {-
703 c = foldCase(c);-
704 --n;-
705 while (++n != e)
++n != eDescription
TRUEevaluated 800 times by 6 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QLabel
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_qmakelib
FALSEevaluated 125 times by 4 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QLabel
  • tst_QString
  • tst_QStringRef
125-800
706 if (foldCase(*n) == c)
foldCase(*n) == cDescription
TRUEevaluated 336 times by 6 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QLabel
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_qmakelib
FALSEevaluated 464 times by 5 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QLabel
  • tst_QString
  • tst_QStringRef
  • tst_qmakelib
336-464
707 return n - s;
executed 336 times by 6 tests: return n - s;
Executed by:
  • tst_QAbstractItemModel
  • tst_QLabel
  • tst_QString
  • tst_QStringRef
  • tst_QTextDocument
  • tst_qmakelib
336
708 }
executed 125 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemModel
  • tst_QLabel
  • tst_QString
  • tst_QStringRef
125
709 }-
710 return -1;
executed 4013 times by 73 tests: return -1;
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBrush
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDir
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsGridLayout
  • tst_QGraphicsItem
  • tst_QGraphicsLayout
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • ...
4013
711}-
712-
713#define REHASH(a) \-
714 if (sl_minus_1 < sizeof(uint) * CHAR_BIT) \-
715 hashHaystack -= uint(a) << sl_minus_1; \-
716 hashHaystack <<= 1-
717-
718inline bool qIsUpper(char ch)-
719{-
720 return ch >= 'A' && ch <= 'Z';
executed 114853 times by 49 tests: return ch >= 'A' && ch <= 'Z';
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAlgorithms
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGlyphRun
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QPageSize
  • ...
114853
721}-
722-
723inline bool qIsDigit(char ch)-
724{-
725 return ch >= '0' && ch <= '9';
executed 453450 times by 110 tests: return ch >= '0' && ch <= '9';
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QChar
  • tst_QColor
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusMetaType
  • tst_QDate
  • tst_QDateTime
  • tst_QDebug
  • tst_QEasingCurve
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFormLayout
  • ...
453450
726}-
727-
728inline char qToLower(char ch)-
729{-
730 if (ch >= 'A' && ch <= 'Z')
ch >= 'A'Description
TRUEevaluated 114853 times by 49 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAlgorithms
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGlyphRun
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QPageSize
  • ...
FALSEnever evaluated
ch <= 'Z'Description
TRUEevaluated 4992 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 109861 times by 49 tests
Evaluated by:
  • tst_PlatformSocketEngine
  • tst_QAlgorithms
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGlyphRun
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QPageSize
  • ...
0-114853
731 return ch - 'A' + 'a';
executed 4992 times by 1 test: return ch - 'A' + 'a';
Executed by:
  • tst_QString
4992
732 else-
733 return ch;
executed 109861 times by 49 tests: return ch;
Executed by:
  • tst_PlatformSocketEngine
  • tst_QAlgorithms
  • tst_QByteDataBuffer
  • tst_QColor
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDoubleSpinBox
  • tst_QFont
  • tst_QGlyphRun
  • tst_QGraphicsItem
  • tst_QGraphicsItemAnimation
  • tst_QGraphicsTransform
  • tst_QGraphicsView
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QLCDNumber
  • tst_QLabel
  • tst_QMetaType
  • tst_QPageSize
  • ...
109861
734}-
735-
736-
737const QString::Null QString::null = { };-
738-
739/*!-
740 \macro QT_RESTRICTED_CAST_FROM_ASCII-
741 \relates QString-
742-
743 Defining this macro disables most automatic conversions from source-
744 literals and 8-bit data to unicode QStrings, but allows the use of-
745 the \c{QChar(char)} and \c{QString(const char (&ch)[N]} constructors,-
746 and the \c{QString::operator=(const char (&ch)[N])} assignment operator-
747 giving most of the type-safety benefits of QT_NO_CAST_FROM_ASCII-
748 but does not require user code to wrap character and string literals-
749 with QLatin1Char, QLatin1String or similar.-
750-
751 Using this macro together with source strings outside the 7-bit range,-
752 non-literals, or literals with embedded NUL characters is undefined.-
753-
754 \sa QT_NO_CAST_FROM_ASCII, QT_NO_CAST_TO_ASCII-
755*/-
756-
757/*!-
758 \macro QT_NO_CAST_FROM_ASCII-
759 \relates QString-
760-
761 Disables automatic conversions from 8-bit strings (char *) to unicode QStrings-
762-
763 \sa QT_NO_CAST_TO_ASCII, QT_RESTRICTED_CAST_FROM_ASCII, QT_NO_CAST_FROM_BYTEARRAY-
764*/-
765-
766/*!-
767 \macro QT_NO_CAST_TO_ASCII-
768 \relates QString-
769-
770 disables automatic conversion from QString to 8-bit strings (char *)-
771-
772 \sa QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII, QT_NO_CAST_FROM_BYTEARRAY-
773*/-
774-
775/*!-
776 \macro QT_ASCII_CAST_WARNINGS-
777 \internal-
778 \relates QString-
779-
780 This macro can be defined to force a warning whenever a function is-
781 called that automatically converts between unicode and 8-bit encodings.-
782-
783 Note: This only works for compilers that support warnings for-
784 deprecated API.-
785-
786 \sa QT_NO_CAST_TO_ASCII, QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII-
787*/-
788-
789/*!-
790 \class QCharRef-
791 \inmodule QtCore-
792 \reentrant-
793 \brief The QCharRef class is a helper class for QString.-
794-
795 \internal-
796-
797 \ingroup string-processing-
798-
799 When you get an object of type QCharRef, if you can assign to it,-
800 the assignment will apply to the character in the string from-
801 which you got the reference. That is its whole purpose in life.-
802 The QCharRef becomes invalid once modifications are made to the-
803 string: if you want to keep the character, copy it into a QChar.-
804-
805 Most of the QChar member functions also exist in QCharRef.-
806 However, they are not explicitly documented here.-
807-
808 \sa QString::operator[](), QString::at(), QChar-
809*/-
810-
811/*!-
812 \class QString-
813 \inmodule QtCore-
814 \reentrant-
815-
816 \brief The QString class provides a Unicode character string.-
817-
818 \ingroup tools-
819 \ingroup shared-
820 \ingroup string-processing-
821-
822 QString stores a string of 16-bit \l{QChar}s, where each QChar-
823 corresponds one Unicode 4.0 character. (Unicode characters-
824 with code values above 65535 are stored using surrogate pairs,-
825 i.e., two consecutive \l{QChar}s.)-
826-
827 \l{Unicode} is an international standard that supports most of the-
828 writing systems in use today. It is a superset of US-ASCII (ANSI-
829 X3.4-1986) and Latin-1 (ISO 8859-1), and all the US-ASCII/Latin-1-
830 characters are available at the same code positions.-
831-
832 Behind the scenes, QString uses \l{implicit sharing}-
833 (copy-on-write) to reduce memory usage and to avoid the needless-
834 copying of data. This also helps reduce the inherent overhead of-
835 storing 16-bit characters instead of 8-bit characters.-
836-
837 In addition to QString, Qt also provides the QByteArray class to-
838 store raw bytes and traditional 8-bit '\\0'-terminated strings.-
839 For most purposes, QString is the class you want to use. It is-
840 used throughout the Qt API, and the Unicode support ensures that-
841 your applications will be easy to translate if you want to expand-
842 your application's market at some point. The two main cases where-
843 QByteArray is appropriate are when you need to store raw binary-
844 data, and when memory conservation is critical (like in embedded-
845 systems).-
846-
847 \tableofcontents-
848-
849 \section1 Initializing a String-
850-
851 One way to initialize a QString is simply to pass a \c{const char-
852 *} to its constructor. For example, the following code creates a-
853 QString of size 5 containing the data "Hello":-
854-
855 \snippet qstring/main.cpp 0-
856-
857 QString converts the \c{const char *} data into Unicode using the-
858 fromUtf8() function.-
859-
860 In all of the QString functions that take \c{const char *}-
861 parameters, the \c{const char *} is interpreted as a classic-
862 C-style '\\0'-terminated string encoded in UTF-8. It is legal for-
863 the \c{const char *} parameter to be 0.-
864-
865 You can also provide string data as an array of \l{QChar}s:-
866-
867 \snippet qstring/main.cpp 1-
868-
869 QString makes a deep copy of the QChar data, so you can modify it-
870 later without experiencing side effects. (If for performance-
871 reasons you don't want to take a deep copy of the character data,-
872 use QString::fromRawData() instead.)-
873-
874 Another approach is to set the size of the string using resize()-
875 and to initialize the data character per character. QString uses-
876 0-based indexes, just like C++ arrays. To access the character at-
877 a particular index position, you can use \l operator[](). On-
878 non-const strings, \l operator[]() returns a reference to a-
879 character that can be used on the left side of an assignment. For-
880 example:-
881-
882 \snippet qstring/main.cpp 2-
883-
884 For read-only access, an alternative syntax is to use the at()-
885 function:-
886-
887 \snippet qstring/main.cpp 3-
888-
889 The at() function can be faster than \l operator[](), because it-
890 never causes a \l{deep copy} to occur. Alternatively, use the-
891 left(), right(), or mid() functions to extract several characters-
892 at a time.-
893-
894 A QString can embed '\\0' characters (QChar::Null). The size()-
895 function always returns the size of the whole string, including-
896 embedded '\\0' characters.-
897-
898 After a call to the resize() function, newly allocated characters-
899 have undefined values. To set all the characters in the string to-
900 a particular value, use the fill() function.-
901-
902 QString provides dozens of overloads designed to simplify string-
903 usage. For example, if you want to compare a QString with a string-
904 literal, you can write code like this and it will work as expected:-
905-
906 \snippet qstring/main.cpp 4-
907-
908 You can also pass string literals to functions that take QStrings-
909 as arguments, invoking the QString(const char *)-
910 constructor. Similarly, you can pass a QString to a function that-
911 takes a \c{const char *} argument using the \l qPrintable() macro-
912 which returns the given QString as a \c{const char *}. This is-
913 equivalent to calling <QString>.toLocal8Bit().constData().-
914-
915 \section1 Manipulating String Data-
916-
917 QString provides the following basic functions for modifying the-
918 character data: append(), prepend(), insert(), replace(), and-
919 remove(). For example:-
920-
921 \snippet qstring/main.cpp 5-
922-
923 If you are building a QString gradually and know in advance-
924 approximately how many characters the QString will contain, you-
925 can call reserve(), asking QString to preallocate a certain amount-
926 of memory. You can also call capacity() to find out how much-
927 memory QString actually allocated.-
928-
929 The replace() and remove() functions' first two arguments are the-
930 position from which to start erasing and the number of characters-
931 that should be erased. If you want to replace all occurrences of-
932 a particular substring with another, use one of the two-parameter-
933 replace() overloads.-
934-
935 A frequent requirement is to remove whitespace characters from a-
936 string ('\\n', '\\t', ' ', etc.). If you want to remove whitespace-
937 from both ends of a QString, use the trimmed() function. If you-
938 want to remove whitespace from both ends and replace multiple-
939 consecutive whitespaces with a single space character within the-
940 string, use simplified().-
941-
942 If you want to find all occurrences of a particular character or-
943 substring in a QString, use the indexOf() or lastIndexOf()-
944 functions. The former searches forward starting from a given index-
945 position, the latter searches backward. Both return the index-
946 position of the character or substring if they find it; otherwise,-
947 they return -1. For example, here's a typical loop that finds all-
948 occurrences of a particular substring:-
949-
950 \snippet qstring/main.cpp 6-
951-
952 QString provides many functions for converting numbers into-
953 strings and strings into numbers. See the arg() functions, the-
954 setNum() functions, the number() static functions, and the-
955 toInt(), toDouble(), and similar functions.-
956-
957 To get an upper- or lowercase version of a string use toUpper() or-
958 toLower().-
959-
960 Lists of strings are handled by the QStringList class. You can-
961 split a string into a list of strings using the split() function,-
962 and join a list of strings into a single string with an optional-
963 separator using QStringList::join(). You can obtain a list of-
964 strings from a string list that contain a particular substring or-
965 that match a particular QRegExp using the QStringList::filter()-
966 function.-
967-
968 \section1 Querying String Data-
969-
970 If you want to see if a QString starts or ends with a particular-
971 substring use startsWith() or endsWith(). If you simply want to-
972 check whether a QString contains a particular character or-
973 substring, use the contains() function. If you want to find out-
974 how many times a particular character or substring occurs in the-
975 string, use count().-
976-
977 QStrings can be compared using overloaded operators such as \l-
978 operator<(), \l operator<=(), \l operator==(), \l operator>=(),-
979 and so on. Note that the comparison is based exclusively on the-
980 numeric Unicode values of the characters. It is very fast, but is-
981 not what a human would expect; the QString::localeAwareCompare()-
982 function is a better choice for sorting user-interface strings.-
983-
984 To obtain a pointer to the actual character data, call data() or-
985 constData(). These functions return a pointer to the beginning of-
986 the QChar data. The pointer is guaranteed to remain valid until a-
987 non-const function is called on the QString.-
988-
989 \section1 Converting Between 8-Bit Strings and Unicode Strings-
990-
991 QString provides the following three functions that return a-
992 \c{const char *} version of the string as QByteArray: toUtf8(),-
993 toLatin1(), and toLocal8Bit().-
994-
995 \list-
996 \li toLatin1() returns a Latin-1 (ISO 8859-1) encoded 8-bit string.-
997 \li toUtf8() returns a UTF-8 encoded 8-bit string. UTF-8 is a-
998 superset of US-ASCII (ANSI X3.4-1986) that supports the entire-
999 Unicode character set through multibyte sequences.-
1000 \li toLocal8Bit() returns an 8-bit string using the system's local-
1001 encoding.-
1002 \endlist-
1003-
1004 To convert from one of these encodings, QString provides-
1005 fromLatin1(), fromUtf8(), and fromLocal8Bit(). Other-
1006 encodings are supported through the QTextCodec class.-
1007-
1008 As mentioned above, QString provides a lot of functions and-
1009 operators that make it easy to interoperate with \c{const char *}-
1010 strings. But this functionality is a double-edged sword: It makes-
1011 QString more convenient to use if all strings are US-ASCII or-
1012 Latin-1, but there is always the risk that an implicit conversion-
1013 from or to \c{const char *} is done using the wrong 8-bit-
1014 encoding. To minimize these risks, you can turn off these implicit-
1015 conversions by defining the following two preprocessor symbols:-
1016-
1017 \list-
1018 \li \c QT_NO_CAST_FROM_ASCII disables automatic conversions from-
1019 C string literals and pointers to Unicode.-
1020 \li \c QT_RESTRICTED_CAST_FROM_ASCII allows automatic conversions-
1021 from C characters and character arrays, but disables automatic-
1022 conversions from character pointers to Unicode.-
1023 \li \c QT_NO_CAST_TO_ASCII disables automatic conversion from QString-
1024 to C strings.-
1025 \endlist-
1026-
1027 One way to define these preprocessor symbols globally for your-
1028 application is to add the following entry to your \l {Creating Project Files}{qmake project file}:-
1029-
1030 \snippet code/src_corelib_tools_qstring.cpp 0-
1031-
1032 You then need to explicitly call fromUtf8(), fromLatin1(),-
1033 or fromLocal8Bit() to construct a QString from an-
1034 8-bit string, or use the lightweight QLatin1String class, for-
1035 example:-
1036-
1037 \snippet code/src_corelib_tools_qstring.cpp 1-
1038-
1039 Similarly, you must call toLatin1(), toUtf8(), or-
1040 toLocal8Bit() explicitly to convert the QString to an 8-bit-
1041 string. (Other encodings are supported through the QTextCodec-
1042 class.)-
1043-
1044 \table 100 %-
1045 \header-
1046 \li Note for C Programmers-
1047-
1048 \row-
1049 \li-
1050 Due to C++'s type system and the fact that QString is-
1051 \l{implicitly shared}, QStrings may be treated like \c{int}s or-
1052 other basic types. For example:-
1053-
1054 \snippet qstring/main.cpp 7-
1055-
1056 The \c result variable, is a normal variable allocated on the-
1057 stack. When \c return is called, and because we're returning by-
1058 value, the copy constructor is called and a copy of the string is-
1059 returned. No actual copying takes place thanks to the implicit-
1060 sharing.-
1061-
1062 \endtable-
1063-
1064 \section1 Distinction Between Null and Empty Strings-
1065-
1066 For historical reasons, QString distinguishes between a null-
1067 string and an empty string. A \e null string is a string that is-
1068 initialized using QString's default constructor or by passing-
1069 (const char *)0 to the constructor. An \e empty string is any-
1070 string with size 0. A null string is always empty, but an empty-
1071 string isn't necessarily null:-
1072-
1073 \snippet qstring/main.cpp 8-
1074-
1075 All functions except isNull() treat null strings the same as empty-
1076 strings. For example, toUtf8().constData() returns a pointer to a-
1077 '\\0' character for a null string (\e not a null pointer), and-
1078 QString() compares equal to QString(""). We recommend that you-
1079 always use the isEmpty() function and avoid isNull().-
1080-
1081 \section1 Argument Formats-
1082-
1083 In member functions where an argument \e format can be specified-
1084 (e.g., arg(), number()), the argument \e format can be one of the-
1085 following:-
1086-
1087 \table-
1088 \header \li Format \li Meaning-
1089 \row \li \c e \li format as [-]9.9e[+|-]999-
1090 \row \li \c E \li format as [-]9.9E[+|-]999-
1091 \row \li \c f \li format as [-]9.9-
1092 \row \li \c g \li use \c e or \c f format, whichever is the most concise-
1093 \row \li \c G \li use \c E or \c f format, whichever is the most concise-
1094 \endtable-
1095-
1096 A \e precision is also specified with the argument \e format. For-
1097 the 'e', 'E', and 'f' formats, the \e precision represents the-
1098 number of digits \e after the decimal point. For the 'g' and 'G'-
1099 formats, the \e precision represents the maximum number of-
1100 significant digits (trailing zeroes are omitted).-
1101-
1102 \section1 More Efficient String Construction-
1103-
1104 Many strings are known at compile time. But the trivial-
1105 constructor QString("Hello"), will copy the contents of the string,-
1106 treating the contents as Latin-1. To avoid this one can use the-
1107 QStringLiteral macro to directly create the required data at compile-
1108 time. Constructing a QString out of the literal does then not cause-
1109 any overhead at runtime.-
1110-
1111 A slightly less efficient way is to use QLatin1String. This class wraps-
1112 a C string literal, precalculates it length at compile time and can-
1113 then be used for faster comparison with QStrings and conversion to-
1114 QStrings than a regular C string literal.-
1115-
1116 Using the QString \c{'+'} operator, it is easy to construct a-
1117 complex string from multiple substrings. You will often write code-
1118 like this:-
1119-
1120 \snippet qstring/stringbuilder.cpp 0-
1121-
1122 There is nothing wrong with either of these string constructions,-
1123 but there are a few hidden inefficiencies. Beginning with Qt 4.6,-
1124 you can eliminate them.-
1125-
1126 First, multiple uses of the \c{'+'} operator usually means-
1127 multiple memory allocations. When concatenating \e{n} substrings,-
1128 where \e{n > 2}, there can be as many as \e{n - 1} calls to the-
1129 memory allocator.-
1130-
1131 In 4.6, an internal template class \c{QStringBuilder} has been-
1132 added along with a few helper functions. This class is marked-
1133 internal and does not appear in the documentation, because you-
1134 aren't meant to instantiate it in your code. Its use will be-
1135 automatic, as described below. The class is found in-
1136 \c {src/corelib/tools/qstringbuilder.cpp} if you want to have a-
1137 look at it.-
1138-
1139 \c{QStringBuilder} uses expression templates and reimplements the-
1140 \c{'%'} operator so that when you use \c{'%'} for string-
1141 concatenation instead of \c{'+'}, multiple substring-
1142 concatenations will be postponed until the final result is about-
1143 to be assigned to a QString. At this point, the amount of memory-
1144 required for the final result is known. The memory allocator is-
1145 then called \e{once} to get the required space, and the substrings-
1146 are copied into it one by one.-
1147-
1148 Additional efficiency is gained by inlining and reduced reference-
1149 counting (the QString created from a \c{QStringBuilder} typically-
1150 has a ref count of 1, whereas QString::append() needs an extra-
1151 test).-
1152-
1153 There are three ways you can access this improved method of string-
1154 construction. The straightforward way is to include-
1155 \c{QStringBuilder} wherever you want to use it, and use the-
1156 \c{'%'} operator instead of \c{'+'} when concatenating strings:-
1157-
1158 \snippet qstring/stringbuilder.cpp 5-
1159-
1160 A more global approach which is the most convenient but-
1161 not entirely source compatible, is to this define in your-
1162 .pro file:-
1163-
1164 \snippet qstring/stringbuilder.cpp 3-
1165-
1166 and the \c{'+'} will automatically be performed as the-
1167 \c{QStringBuilder} \c{'%'} everywhere.-
1168-
1169 \sa fromRawData(), QChar, QLatin1String, QByteArray, QStringRef-
1170*/-
1171-
1172/*!-
1173 \enum QString::SplitBehavior-
1174-
1175 This enum specifies how the split() function should behave with-
1176 respect to empty strings.-
1177-
1178 \value KeepEmptyParts If a field is empty, keep it in the result.-
1179 \value SkipEmptyParts If a field is empty, don't include it in the result.-
1180-
1181 \sa split()-
1182*/-
1183-
1184/*! \typedef QString::ConstIterator-
1185-
1186 Qt-style synonym for QString::const_iterator.-
1187*/-
1188-
1189/*! \typedef QString::Iterator-
1190-
1191 Qt-style synonym for QString::iterator.-
1192*/-
1193-
1194/*! \typedef QString::const_iterator-
1195-
1196 This typedef provides an STL-style const iterator for QString.-
1197-
1198 \sa QString::iterator-
1199*/-
1200-
1201/*! \typedef QString::iterator-
1202-
1203 The QString::iterator typedef provides an STL-style non-const-
1204 iterator for QString.-
1205-
1206 \sa QString::const_iterator-
1207*/-
1208-
1209/*! \typedef QString::const_reverse_iterator-
1210 \since 5.6-
1211-
1212 This typedef provides an STL-style const reverse iterator for QString.-
1213-
1214 \sa QString::reverse_iterator, QString::const_iterator-
1215*/-
1216-
1217/*! \typedef QString::reverse_iterator-
1218 \since 5.6-
1219-
1220 This typedef provides an STL-style non-const reverse iterator for QString.-
1221-
1222 \sa QString::const_reverse_iterator, QString::iterator-
1223*/-
1224-
1225/*!-
1226 \typedef QString::size_type-
1227-
1228 The QString::size_type typedef provides an STL-style type for sizes (int).-
1229*/-
1230-
1231/*!-
1232 \typedef QString::difference_type-
1233-
1234 The QString::size_type typedef provides an STL-style type for difference between pointers.-
1235*/-
1236-
1237/*!-
1238 \typedef QString::const_reference-
1239-
1240 This typedef provides an STL-style const reference for a QString element (QChar).-
1241*/-
1242/*!-
1243 \typedef QString::reference-
1244-
1245 This typedef provides an STL-style-
1246 reference for a QString element (QChar).-
1247*/-
1248-
1249/*!-
1250 \typedef QString::const_pointer-
1251-
1252 The QString::const_pointer typedef provides an STL-style-
1253 const pointer to a QString element (QChar).-
1254*/-
1255/*!-
1256 \typedef QString::pointer-
1257-
1258 The QString::const_pointer typedef provides an STL-style-
1259 pointer to a QString element (QChar).-
1260*/-
1261-
1262/*!-
1263 \typedef QString::value_type-
1264-
1265 This typedef provides an STL-style value type for QString.-
1266*/-
1267-
1268/*! \fn QString::iterator QString::begin()-
1269-
1270 Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in-
1271 the string.-
1272-
1273 \sa constBegin(), end()-
1274*/-
1275-
1276/*! \fn QString::const_iterator QString::begin() const-
1277-
1278 \overload begin()-
1279*/-
1280-
1281/*! \fn QString::const_iterator QString::cbegin() const-
1282 \since 5.0-
1283-
1284 Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character-
1285 in the string.-
1286-
1287 \sa begin(), cend()-
1288*/-
1289-
1290/*! \fn QString::const_iterator QString::constBegin() const-
1291-
1292 Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character-
1293 in the string.-
1294-
1295 \sa begin(), constEnd()-
1296*/-
1297-
1298/*! \fn QString::iterator QString::end()-
1299-
1300 Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary character-
1301 after the last character in the string.-
1302-
1303 \sa begin(), constEnd()-
1304*/-
1305-
1306/*! \fn QString::const_iterator QString::end() const-
1307-
1308 \overload end()-
1309*/-
1310-
1311/*! \fn QString::const_iterator QString::cend() const-
1312 \since 5.0-
1313-
1314 Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary-
1315 character after the last character in the list.-
1316-
1317 \sa cbegin(), end()-
1318*/-
1319-
1320/*! \fn QString::const_iterator QString::constEnd() const-
1321-
1322 Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary-
1323 character after the last character in the list.-
1324-
1325 \sa constBegin(), end()-
1326*/-
1327-
1328/*! \fn QString::reverse_iterator QString::rbegin()-
1329 \since 5.6-
1330-
1331 Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first-
1332 character in the string, in reverse order.-
1333-
1334 \sa begin(), crbegin(), rend()-
1335*/-
1336-
1337/*! \fn QString::const_reverse_iterator QString::rbegin() const-
1338 \since 5.6-
1339 \overload-
1340*/-
1341-
1342/*! \fn QString::const_reverse_iterator QString::crbegin() const-
1343 \since 5.6-
1344-
1345 Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first-
1346 character in the string, in reverse order.-
1347-
1348 \sa begin(), rbegin(), rend()-
1349*/-
1350-
1351/*! \fn QString::reverse_iterator QString::rend()-
1352 \since 5.6-
1353-
1354 Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past-
1355 the last character in the string, in reverse order.-
1356-
1357 \sa end(), crend(), rbegin()-
1358*/-
1359-
1360/*! \fn QString::const_reverse_iterator QString::rend() const-
1361 \since 5.6-
1362 \overload-
1363*/-
1364-
1365/*! \fn QString::const_reverse_iterator QString::crend() const-
1366 \since 5.6-
1367-
1368 Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one-
1369 past the last character in the string, in reverse order.-
1370-
1371 \sa end(), rend(), rbegin()-
1372*/-
1373-
1374/*!-
1375 \fn QString::QString()-
1376-
1377 Constructs a null string. Null strings are also empty.-
1378-
1379 \sa isEmpty()-
1380*/-
1381-
1382/*!-
1383 \fn QString::QString(QString &&other)-
1384-
1385 Move-constructs a QString instance, making it point at the same-
1386 object that \a other was pointing to.-
1387-
1388 \since 5.2-
1389*/-
1390-
1391/*! \fn QString::QString(const char *str)-
1392-
1393 Constructs a string initialized with the 8-bit string \a str. The-
1394 given const char pointer is converted to Unicode using the-
1395 fromUtf8() function.-
1396-
1397 You can disable this constructor by defining \c-
1398 QT_NO_CAST_FROM_ASCII when you compile your applications. This-
1399 can be useful if you want to ensure that all user-visible strings-
1400 go through QObject::tr(), for example.-
1401-
1402 \note Defining QT_RESTRICTED_CAST_FROM_ASCII also disables-
1403 this constructor, but enables a \c{QString(const char (&ch)[N])}-
1404 constructor instead. Using non-literal input, or input with-
1405 embedded NUL characters, or non-7-bit characters is undefined-
1406 in this case.-
1407-
1408 \sa fromLatin1(), fromLocal8Bit(), fromUtf8()-
1409*/-
1410-
1411/*! \fn QString QString::fromStdString(const std::string &str)-
1412-
1413 Returns a copy of the \a str string. The given string is converted-
1414 to Unicode using the fromUtf8() function.-
1415-
1416 \sa fromLatin1(), fromLocal8Bit(), fromUtf8(), QByteArray::fromStdString()-
1417*/-
1418-
1419/*! \fn QString QString::fromStdWString(const std::wstring &str)-
1420-
1421 Returns a copy of the \a str string. The given string is assumed-
1422 to be encoded in utf16 if the size of wchar_t is 2 bytes (e.g. on-
1423 windows) and ucs4 if the size of wchar_t is 4 bytes (most Unix-
1424 systems).-
1425-
1426 \sa fromUtf16(), fromLatin1(), fromLocal8Bit(), fromUtf8(), fromUcs4(), fromStdU16String(), fromStdU32String()-
1427*/-
1428-
1429/*! \fn QString QString::fromWCharArray(const wchar_t *string, int size)-
1430 \since 4.2-
1431-
1432 Returns a copy of the \a string, where the encoding of \a string depends on-
1433 the size of wchar. If wchar is 4 bytes, the \a string is interpreted as UCS-4,-
1434 if wchar is 2 bytes it is interpreted as UTF-16.-
1435-
1436 If \a size is -1 (default), the \a string has to be 0 terminated.-
1437-
1438 \sa fromUtf16(), fromLatin1(), fromLocal8Bit(), fromUtf8(), fromUcs4(), fromStdWString()-
1439*/-
1440-
1441/*! \fn std::wstring QString::toStdWString() const-
1442-
1443 Returns a std::wstring object with the data contained in this-
1444 QString. The std::wstring is encoded in utf16 on platforms where-
1445 wchar_t is 2 bytes wide (e.g. windows) and in ucs4 on platforms-
1446 where wchar_t is 4 bytes wide (most Unix systems).-
1447-
1448 This method is mostly useful to pass a QString to a function-
1449 that accepts a std::wstring object.-
1450-
1451 \sa utf16(), toLatin1(), toUtf8(), toLocal8Bit(), toStdU16String(), toStdU32String()-
1452*/-
1453-
1454int QString::toUcs4_helper(const ushort *uc, int length, uint *out)-
1455{-
1456 int count = 0;-
1457-
1458 QStringIterator i(reinterpret_cast<const QChar *>(uc), reinterpret_cast<const QChar *>(uc + length));-
1459 while (i.hasNext())
i.hasNext()Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QString
12-44
1460 out[count++] = i.next();
executed 44 times by 1 test: out[count++] = i.next();
Executed by:
  • tst_QString
44
1461-
1462 return count;
executed 12 times by 1 test: return count;
Executed by:
  • tst_QString
12
1463}-
1464-
1465/*! \fn int QString::toWCharArray(wchar_t *array) const-
1466 \since 4.2-
1467-
1468 Fills the \a array with the data contained in this QString object.-
1469 The array is encoded in UTF-16 on platforms where-
1470 wchar_t is 2 bytes wide (e.g. windows) and in UCS-4 on platforms-
1471 where wchar_t is 4 bytes wide (most Unix systems).-
1472-
1473 \a array has to be allocated by the caller and contain enough space to-
1474 hold the complete string (allocating the array with the same length as the-
1475 string is always sufficient).-
1476-
1477 This function returns the actual length of the string in \a array.-
1478-
1479 \note This function does not append a null character to the array.-
1480-
1481 \sa utf16(), toUcs4(), toLatin1(), toUtf8(), toLocal8Bit(), toStdWString()-
1482*/-
1483-
1484/*! \fn QString::QString(const QString &other)-
1485-
1486 Constructs a copy of \a other.-
1487-
1488 This operation takes \l{constant time}, because QString is-
1489 \l{implicitly shared}. This makes returning a QString from a-
1490 function very fast. If a shared instance is modified, it will be-
1491 copied (copy-on-write), and that takes \l{linear time}.-
1492-
1493 \sa operator=()-
1494*/-
1495-
1496/*!-
1497 Constructs a string initialized with the first \a size characters-
1498 of the QChar array \a unicode.-
1499-
1500 If \a unicode is 0, a null string is constructed.-
1501-
1502 If \a size is negative, \a unicode is assumed to point to a nul-terminated-
1503 array and its length is determined dynamically. The terminating-
1504 nul-character is not considered part of the string.-
1505-
1506 QString makes a deep copy of the string data. The unicode data is copied as-
1507 is and the Byte Order Mark is preserved if present.-
1508-
1509 \sa fromRawData()-
1510*/-
1511QString::QString(const QChar *unicode, int size)-
1512{-
1513 if (!unicode) {
!unicodeDescription
TRUEevaluated 3143 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_QStringMatcher
  • tst_QTextBoundaryFinder
FALSEevaluated 6486100 times by 542 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
3143-6486100
1514 d = Data::sharedNull();-
1515 } else {
executed 3143 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_QStringMatcher
  • tst_QTextBoundaryFinder
3143
1516 if (size < 0) {
size < 0Description
TRUEevaluated 101041 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 6385059 times by 542 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
101041-6385059
1517 size = 0;-
1518 while (!unicode[size].isNull())
!unicode[size].isNull()Description
TRUEevaluated 3080917 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 101041 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
101041-3080917
1519 ++size;
executed 3080917 times by 9 tests: ++size;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
3080917
1520 }
executed 101041 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
101041
1521 if (!size) {
!sizeDescription
TRUEevaluated 204954 times by 394 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • 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_QAlgorithms
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCache
  • tst_QCalendarWidget
  • tst_QChar
  • ...
FALSEevaluated 6281146 times by 400 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
204954-6281146
1522 d = Data::allocate(0);-
1523 } else {
executed 204954 times by 394 tests: end of block
Executed by:
  • tst_Collections
  • tst_Gestures
  • 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_QAlgorithms
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCache
  • tst_QCalendarWidget
  • tst_QChar
  • ...
204954
1524 d = Data::allocate(size + 1);-
1525 Q_CHECK_PTR(d);
never executed: qBadAlloc();
!(d)Description
TRUEnever evaluated
FALSEevaluated 6281146 times by 400 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
0-6281146
1526 d->size = size;-
1527 memcpy(d->data(), unicode, size * sizeof(QChar));-
1528 d->data()[size] = '\0';-
1529 }
executed 6281146 times by 400 tests: end of block
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
6281146
1530 }-
1531}-
1532-
1533/*!-
1534 Constructs a string of the given \a size with every character set-
1535 to \a ch.-
1536-
1537 \sa fill()-
1538*/-
1539QString::QString(int size, QChar ch)-
1540{-
1541 if (size <= 0) {
size <= 0Description
TRUEevaluated 201 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDBusXmlParser
  • tst_QXmlSimpleReader
FALSEevaluated 253266 times by 47 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QCalendarWidget
  • tst_QCompleter
  • tst_QDBusXmlParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListWidget
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • ...
201-253266
1542 d = Data::allocate(0);-
1543 } else {
executed 201 times by 3 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDBusXmlParser
  • tst_QXmlSimpleReader
201
1544 d = Data::allocate(size + 1);-
1545 Q_CHECK_PTR(d);
never executed: qBadAlloc();
!(d)Description
TRUEnever evaluated
FALSEevaluated 253266 times by 47 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QCalendarWidget
  • tst_QCompleter
  • tst_QDBusXmlParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListWidget
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • ...
0-253266
1546 d->size = size;-
1547 d->data()[size] = '\0';-
1548 ushort *i = d->data() + size;-
1549 ushort *b = d->data();-
1550 const ushort value = ch.unicode();-
1551 while (i != b)
i != bDescription
TRUEevaluated 408257 times by 47 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QCalendarWidget
  • tst_QCompleter
  • tst_QDBusXmlParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListWidget
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • ...
FALSEevaluated 253266 times by 47 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QCalendarWidget
  • tst_QCompleter
  • tst_QDBusXmlParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListWidget
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • ...
253266-408257
1552 *--i = value;
executed 408257 times by 47 tests: *--i = value;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QCalendarWidget
  • tst_QCompleter
  • tst_QDBusXmlParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListWidget
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • ...
408257
1553 }
executed 253266 times by 47 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QCalendarWidget
  • tst_QCompleter
  • tst_QDBusXmlParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListWidget
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • ...
253266
1554}-
1555-
1556/*! \fn QString::QString(int size, Qt::Initialization)-
1557 \internal-
1558-
1559 Constructs a string of the given \a size without initializing the-
1560 characters. This is only used in \c QStringBuilder::toString().-
1561*/-
1562QString::QString(int size, Qt::Initialization)-
1563{-
1564 d = Data::allocate(size + 1);-
1565 Q_CHECK_PTR(d);
never executed: qBadAlloc();
!(d)Description
TRUEnever evaluated
FALSEevaluated 46522442 times by 686 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-46522442
1566 d->size = size;-
1567 d->data()[size] = '\0';-
1568}
executed 46522072 times by 686 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
  • ...
46522072
1569-
1570/*! \fn QString::QString(QLatin1String str)-
1571-
1572 Constructs a copy of the Latin-1 string \a str.-
1573-
1574 \sa fromLatin1()-
1575*/-
1576-
1577/*!-
1578 Constructs a string of size 1 containing the character \a ch.-
1579*/-
1580QString::QString(QChar ch)-
1581{-
1582 d = Data::allocate(2);-
1583 Q_CHECK_PTR(d);
never executed: qBadAlloc();
!(d)Description
TRUEnever evaluated
FALSEevaluated 495998 times by 267 tests
Evaluated by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • ...
0-495998
1584 d->size = 1;-
1585 d->data()[0] = ch.unicode();-
1586 d->data()[1] = '\0';-
1587}
executed 495998 times by 267 tests: end of block
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • ...
495998
1588-
1589/*! \fn QString::QString(const QByteArray &ba)-
1590-
1591 Constructs a string initialized with the byte array \a ba. The-
1592 given byte array is converted to Unicode using fromUtf8(). Stops-
1593 copying at the first 0 character, otherwise copies the entire byte-
1594 array.-
1595-
1596 You can disable this constructor by defining \c-
1597 QT_NO_CAST_FROM_ASCII when you compile your applications. This-
1598 can be useful if you want to ensure that all user-visible strings-
1599 go through QObject::tr(), for example.-
1600-
1601 \sa fromLatin1(), fromLocal8Bit(), fromUtf8()-
1602*/-
1603-
1604/*! \fn QString::QString(const Null &)-
1605 \internal-
1606*/-
1607-
1608/*! \fn QString::QString(QStringDataPtr)-
1609 \internal-
1610*/-
1611-
1612/*! \fn QString &QString::operator=(const Null &)-
1613 \internal-
1614*/-
1615-
1616/*!-
1617 \fn QString::~QString()-
1618-
1619 Destroys the string.-
1620*/-
1621-
1622-
1623/*! \fn void QString::swap(QString &other)-
1624 \since 4.8-
1625-
1626 Swaps string \a other with this string. This operation is very fast and-
1627 never fails.-
1628*/-
1629-
1630/*! \fn void QString::detach()-
1631-
1632 \internal-
1633*/-
1634-
1635/*! \fn bool QString::isDetached() const-
1636-
1637 \internal-
1638*/-
1639-
1640/*! \fn bool QString::isSharedWith(const QString &other) const-
1641-
1642 \internal-
1643*/-
1644-
1645/*!-
1646 Sets the size of the string to \a size characters.-
1647-
1648 If \a size is greater than the current size, the string is-
1649 extended to make it \a size characters long with the extra-
1650 characters added to the end. The new characters are uninitialized.-
1651-
1652 If \a size is less than the current size, characters are removed-
1653 from the end.-
1654-
1655 Example:-
1656-
1657 \snippet qstring/main.cpp 45-
1658-
1659 If you want to append a certain number of identical characters to-
1660 the string, use the \l {QString::}{resize(int, QChar)} overload.-
1661-
1662 If you want to expand the string so that it reaches a certain-
1663 width and fill the new positions with a particular character, use-
1664 the leftJustified() function:-
1665-
1666 If \a size is negative, it is equivalent to passing zero.-
1667-
1668 \snippet qstring/main.cpp 47-
1669-
1670 \sa truncate(), reserve()-
1671*/-
1672-
1673void QString::resize(int size)-
1674{-
1675 if (size < 0)
size < 0Description
TRUEevaluated 28 times by 4 tests
Evaluated by:
  • tst_QGuiVariant
  • tst_QKeySequence
  • tst_QKeySequenceEdit
  • tst_QString
FALSEevaluated 89208133 times by 563 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
28-89208133
1676 size = 0;
executed 28 times by 4 tests: size = 0;
Executed by:
  • tst_QGuiVariant
  • tst_QKeySequence
  • tst_QKeySequenceEdit
  • tst_QString
28
1677-
1678 if (IS_RAW_DATA(d) && !d->ref.isShared() && size < d->size) {
((d)->offset !...(QStringData))Description
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QString
  • tst_qmakelib
FALSEevaluated 89208157 times by 563 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
!d->ref.isShared()Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QString
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qmakelib
size < d->sizeDescription
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QString
FALSEnever evaluated
0-89208157
1679 d->size = size;-
1680 return;
executed 2 times by 2 tests: return;
Executed by:
  • tst_QDateTimeEdit
  • tst_QString
2
1681 }-
1682-
1683 if (d->ref.isShared() || uint(size) + 1u > d->alloc)
d->ref.isShared()Description
TRUEevaluated 1679254 times by 481 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
FALSEevaluated 87528905 times by 554 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
uint(size) + 1u > d->allocDescription
TRUEevaluated 240775 times by 195 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_ModelTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAsn1Element
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCache
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColor
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • ...
FALSEevaluated 87288130 times by 547 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
240775-87528905
1684 reallocData(uint(size) + 1u, true);
executed 1920029 times by 485 tests: reallocData(uint(size) + 1u, true);
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
1920029
1685 if (d->alloc) {
d->allocDescription
TRUEevaluated 89208159 times by 563 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
FALSEnever evaluated
0-89208159
1686 d->size = size;-
1687 d->data()[size] = '\0';-
1688 }
executed 89208159 times by 563 tests: end of block
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
89208159
1689}
executed 89208159 times by 563 tests: end of block
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
89208159
1690-
1691/*!-
1692 \overload-
1693 \since 5.7-
1694-
1695 Unlike \l {QString::}{resize(int)}, this overload-
1696 initializes the new characters to \a fillChar:-
1697-
1698 \snippet qstring/main.cpp 46-
1699*/-
1700-
1701void QString::resize(int size, QChar fillChar)-
1702{-
1703 const int oldSize = length();-
1704 resize(size);-
1705 const int difference = length() - oldSize;-
1706 if (difference > 0)
difference > 0Description
TRUEevaluated 28747 times by 13 tests
Evaluated by:
  • tst_Collections
  • tst_QDebug
  • tst_QFtp
  • tst_QGuiVariant
  • tst_QHash
  • tst_QHash_StrictIterators
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QString
  • tst_QTextStream
FALSEevaluated 2239 times by 4 tests
Evaluated by:
  • tst_QDebug
  • tst_QGuiVariant
  • tst_QNetworkInterface
  • tst_QTextStream
2239-28747
1707 std::fill_n(d->begin() + oldSize, difference, fillChar.unicode());
executed 28747 times by 13 tests: std::fill_n(d->begin() + oldSize, difference, fillChar.unicode());
Executed by:
  • tst_Collections
  • tst_QDebug
  • tst_QFtp
  • tst_QGuiVariant
  • tst_QHash
  • tst_QHash_StrictIterators
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QString
  • tst_QTextStream
28747
1708}
executed 30986 times by 13 tests: end of block
Executed by:
  • tst_Collections
  • tst_QDebug
  • tst_QFtp
  • tst_QGuiVariant
  • tst_QHash
  • tst_QHash_StrictIterators
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QString
  • tst_QTextStream
30986
1709-
1710/*! \fn int QString::capacity() const-
1711-
1712 Returns the maximum number of characters that can be stored in-
1713 the string without forcing a reallocation.-
1714-
1715 The sole purpose of this function is to provide a means of fine-
1716 tuning QString's memory usage. In general, you will rarely ever-
1717 need to call this function. If you want to know how many-
1718 characters are in the string, call size().-
1719-
1720 \sa reserve(), squeeze()-
1721*/-
1722-
1723/*!-
1724 \fn void QString::reserve(int size)-
1725-
1726 Attempts to allocate memory for at least \a size characters. If-
1727 you know in advance how large the string will be, you can call-
1728 this function, and if you resize the string often you are likely-
1729 to get better performance. If \a size is an underestimate, the-
1730 worst that will happen is that the QString will be a bit slower.-
1731-
1732 The sole purpose of this function is to provide a means of fine-
1733 tuning QString's memory usage. In general, you will rarely ever-
1734 need to call this function. If you want to change the size of the-
1735 string, call resize().-
1736-
1737 This function is useful for code that needs to build up a long-
1738 string and wants to avoid repeated reallocation. In this example,-
1739 we want to add to the string until some condition is \c true, and-
1740 we're fairly sure that size is large enough to make a call to-
1741 reserve() worthwhile:-
1742-
1743 \snippet qstring/main.cpp 44-
1744-
1745 \sa squeeze(), capacity()-
1746*/-
1747-
1748/*!-
1749 \fn void QString::squeeze()-
1750-
1751 Releases any memory not required to store the character data.-
1752-
1753 The sole purpose of this function is to provide a means of fine-
1754 tuning QString's memory usage. In general, you will rarely ever-
1755 need to call this function.-
1756-
1757 \sa reserve(), capacity()-
1758*/-
1759-
1760void QString::reallocData(uint alloc, bool grow)-
1761{-
1762 size_t blockSize;-
1763 if (grow) {
growDescription
TRUEevaluated 17320378 times by 539 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
FALSEevaluated 1024048 times by 311 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • ...
1024048-17320378
1764 auto r = qCalculateGrowingBlockSize(alloc, sizeof(QChar), sizeof(Data));-
1765 blockSize = r.size;-
1766 alloc = uint(r.elementCount);-
1767 } else {
executed 17320378 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_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
17320378
1768 blockSize = qCalculateBlockSize(alloc, sizeof(QChar), sizeof(Data));-
1769 }
executed 1024049 times by 311 tests: end of block
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • ...
1024049
1770-
1771 if (d->ref.isShared() || IS_RAW_DATA(d)) {
d->ref.isShared()Description
TRUEevaluated 17139594 times by 543 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
FALSEevaluated 1204609 times by 500 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBitArray
  • ...
((d)->offset !...(QStringData))Description
TRUEevaluated 1718 times by 12 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QString
  • tst_QTime
  • tst_QUrl
  • tst_QXmlStream
FALSEevaluated 1202891 times by 500 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBitArray
  • ...
1718-17139594
1772 Data::AllocationOptions allocOptions(d->capacityReserved ? Data::CapacityReserved : 0);-
1773 Data *x = Data::allocate(alloc, allocOptions);-
1774 Q_CHECK_PTR(x);
never executed: qBadAlloc();
!(x)Description
TRUEnever evaluated
FALSEevaluated 17141536 times by 543 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
0-17141536
1775 x->size = qMin(int(alloc) - 1, d->size);-
1776 ::memcpy(x->data(), d->data(), x->size * sizeof(QChar));-
1777 x->data()[x->size] = 0;-
1778 if (!d->ref.deref())
!d->ref.deref()Description
TRUEevaluated 1718 times by 12 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QString
  • tst_QTime
  • tst_QUrl
  • tst_QXmlStream
FALSEevaluated 17139818 times by 543 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
1718-17139818
1779 Data::deallocate(d);
executed 1718 times by 12 tests: Data::deallocate(d);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkCookie
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QString
  • tst_QTime
  • tst_QUrl
  • tst_QXmlStream
1718
1780 d = x;-
1781 } else {
executed 17141536 times by 543 tests: end of block
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • ...
17141536
1782 Data *p = static_cast<Data *>(::realloc(d, blockSize));-
1783 Q_CHECK_PTR(p);
never executed: qBadAlloc();
!(p)Description
TRUEnever evaluated
FALSEevaluated 1202891 times by 500 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBitArray
  • ...
0-1202891
1784 d = p;-
1785 d->alloc = alloc;-
1786 d->offset = sizeof(QStringData);-
1787 }
executed 1202891 times by 500 tests: end of block
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBackingStore
  • tst_QBitArray
  • ...
1202891
1788}-
1789-
1790#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)-
1791void QString::expand(int i)-
1792{-
1793 resize(qMax(i + 1, d->size), QLatin1Char(' '));-
1794}
never executed: end of block
0
1795#endif-
1796-
1797/*! \fn void QString::clear()-
1798-
1799 Clears the contents of the string and makes it null.-
1800-
1801 \sa resize(), isNull()-
1802*/-
1803-
1804/*! \fn QString &QString::operator=(const QString &other)-
1805-
1806 Assigns \a other to this string and returns a reference to this-
1807 string.-
1808*/-
1809-
1810QString &QString::operator=(const QString &other) Q_DECL_NOTHROW-
1811{-
1812 other.d->ref.ref();-
1813 if (!d->ref.deref())
!d->ref.deref()Description
TRUEevaluated 853249 times by 265 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • ...
FALSEevaluated 6633512 times by 445 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
853249-6633512
1814 Data::deallocate(d);
executed 853249 times by 265 tests: Data::deallocate(d);
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • ...
853249
1815 d = other.d;-
1816 return *this;
executed 7486761 times by 451 tests: return *this;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QApplication
  • tst_QArrayData
  • tst_QArrayData_StrictIterators
  • ...
7486761
1817}-
1818-
1819/*!-
1820 \fn QString &QString::operator=(QString &&other)-
1821-
1822 Move-assigns \a other to this QString instance.-
1823-
1824 \since 5.2-
1825*/-
1826-
1827/*! \fn QString &QString::operator=(QLatin1String str)-
1828-
1829 \overload operator=()-
1830-
1831 Assigns the Latin-1 string \a str to this string.-
1832*/-
1833QString &QString::operator=(QLatin1String other)-
1834{-
1835 if (isDetached() && other.size() <= capacity()) { // assumes d->alloc == 0 → !isDetached() (sharedNull)
isDetached()Description
TRUEevaluated 136704 times by 527 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • 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_QAtomicInt
  • tst_QAtomicInteger_char
  • tst_QAtomicInteger_char16_t
  • ...
FALSEevaluated 86568 times by 511 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
  • ...
other.size() <= capacity()Description
TRUEevaluated 133632 times by 329 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_char
  • tst_QAtomicInteger_char16_t
  • tst_QAtomicInteger_char32_t
  • tst_QAtomicInteger_int
  • tst_QAtomicInteger_long
  • ...
FALSEevaluated 3072 times by 503 tests
Evaluated by:
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • 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_QAtomicInt
  • tst_QAtomicInteger_char
  • tst_QAtomicInteger_char16_t
  • tst_QAtomicInteger_char32_t
  • ...
3072-136704
1836 d->size = other.size();-
1837 d->data()[other.size()] = 0;-
1838 qt_from_latin1(d->data(), other.latin1(), other.size());-
1839 } else {
executed 133632 times by 329 tests: end of block
Executed 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_char
  • tst_QAtomicInteger_char16_t
  • tst_QAtomicInteger_char32_t
  • tst_QAtomicInteger_int
  • tst_QAtomicInteger_long
  • ...
133632
1840 *this = fromLatin1(other.latin1(), other.size());-
1841 }
executed 89640 times by 657 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
  • ...
89640
1842 return *this;
executed 223272 times by 657 tests: return *this;
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
  • ...
223272
1843}-
1844-
1845/*! \fn QString &QString::operator=(const QByteArray &ba)-
1846-
1847 \overload operator=()-
1848-
1849 Assigns \a ba to this string. The byte array is converted to Unicode-
1850 using the fromUtf8() function. This function stops conversion at the-
1851 first NUL character found, or the end of the \a ba byte array.-
1852-
1853 You can disable this operator by defining \c-
1854 QT_NO_CAST_FROM_ASCII when you compile your applications. This-
1855 can be useful if you want to ensure that all user-visible strings-
1856 go through QObject::tr(), for example.-
1857*/-
1858-
1859/*! \fn QString &QString::operator=(const char *str)-
1860-
1861 \overload operator=()-
1862-
1863 Assigns \a str to this string. The const char pointer is converted-
1864 to Unicode using the fromUtf8() function.-
1865-
1866 You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII-
1867 or \c QT_RESTRICTED_CAST_FROM_ASCII when you compile your applications.-
1868 This can be useful if you want to ensure that all user-visible strings-
1869 go through QObject::tr(), for example.-
1870-
1871*/-
1872-
1873/*! \fn QString &QString::operator=(char ch)-
1874-
1875 \overload operator=()-
1876-
1877 Assigns character \a ch to this string. Note that the character is-
1878 converted to Unicode using the fromLatin1() function, unlike other 8-bit-
1879 functions that operate on UTF-8 data.-
1880-
1881 You can disable this operator by defining \c-
1882 QT_NO_CAST_FROM_ASCII when you compile your applications. This-
1883 can be useful if you want to ensure that all user-visible strings-
1884 go through QObject::tr(), for example.-
1885*/-
1886-
1887/*!-
1888 \overload operator=()-
1889-
1890 Sets the string to contain the single character \a ch.-
1891*/-
1892QString &QString::operator=(QChar ch)-
1893{-
1894 if (isDetached() && capacity() >= 1) { // assumes d->alloc == 0 → !isDetached() (sharedNull)
isDetached()Description
TRUEevaluated 698 times by 162 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • ...
FALSEevaluated 77060 times by 117 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAction
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontMetrics
  • ...
capacity() >= 1Description
TRUEevaluated 697 times by 162 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QString
1-77060
1895 // re-use existing capacity:-
1896 ushort *dat = d->data();-
1897 dat[0] = ch.unicode();-
1898 dat[1] = 0;-
1899 d->size = 1;-
1900 } else {
executed 697 times by 162 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • ...
697
1901 operator=(QString(ch));-
1902 }
executed 77061 times by 117 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAction
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontMetrics
  • ...
77061
1903 return *this;
executed 77758 times by 218 tests: return *this;
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
77758
1904}-
1905-
1906/*!-
1907 \fn QString& QString::insert(int position, const QString &str)-
1908-
1909 Inserts the string \a str at the given index \a position and-
1910 returns a reference to this string.-
1911-
1912 Example:-
1913-
1914 \snippet qstring/main.cpp 26-
1915-
1916 If the given \a position is greater than size(), the array is-
1917 first extended using resize().-
1918-
1919 \sa append(), prepend(), replace(), remove()-
1920*/-
1921-
1922-
1923/*!-
1924 \fn QString& QString::insert(int position, const QStringRef &str)-
1925 \since 5.5-
1926 \overload insert()-
1927-
1928 Inserts the string reference \a str at the given index \a position and-
1929 returns a reference to this string.-
1930-
1931 If the given \a position is greater than size(), the array is-
1932 first extended using resize().-
1933*/-
1934-
1935-
1936/*!-
1937 \fn QString& QString::insert(int position, const char *str)-
1938 \since 5.5-
1939 \overload insert()-
1940-
1941 Inserts the C string \a str at the given index \a position and-
1942 returns a reference to this string.-
1943-
1944 If the given \a position is greater than size(), the array is-
1945 first extended using resize().-
1946-
1947 This function is not available when QT_NO_CAST_FROM_ASCII is-
1948 defined.-
1949*/-
1950-
1951-
1952/*!-
1953 \fn QString& QString::insert(int position, const QByteArray &str)-
1954 \since 5.5-
1955 \overload insert()-
1956-
1957 Inserts the byte array \a str at the given index \a position and-
1958 returns a reference to this string.-
1959-
1960 If the given \a position is greater than size(), the array is-
1961 first extended using resize().-
1962-
1963 This function is not available when QT_NO_CAST_FROM_ASCII is-
1964 defined.-
1965*/-
1966-
1967-
1968/*!-
1969 \fn QString &QString::insert(int position, QLatin1String str)-
1970 \overload insert()-
1971-
1972 Inserts the Latin-1 string \a str at the given index \a position.-
1973*/-
1974QString &QString::insert(int i, QLatin1String str)-
1975{-
1976 const char *s = str.latin1();-
1977 if (i < 0 || !s || !(*s))
i < 0Description
TRUEnever evaluated
FALSEevaluated 17409 times by 58 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAccessibility
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDebug
  • tst_QDnsLookup
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsAnchorLayout1
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QItemModel
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • ...
!sDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 17401 times by 58 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAccessibility
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDebug
  • tst_QDnsLookup
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsAnchorLayout1
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QItemModel
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • ...
!(*s)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 17393 times by 58 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAccessibility
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDebug
  • tst_QDnsLookup
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsAnchorLayout1
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QItemModel
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • ...
0-17409
1978 return *this;
executed 16 times by 1 test: return *this;
Executed by:
  • tst_QString
16
1979-
1980 int len = str.size();-
1981 if (Q_UNLIKELY(i > d->size))
__builtin_expe...>size), false)Description
TRUEnever evaluated
FALSEevaluated 17393 times by 58 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAccessibility
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDebug
  • tst_QDnsLookup
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsAnchorLayout1
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QItemModel
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • ...
0-17393
1982 resize(i + len, QLatin1Char(' '));
never executed: resize(i + len, QLatin1Char(' '));
0
1983 else-
1984 resize(d->size + len);
executed 17393 times by 58 tests: resize(d->size + len);
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAccessibility
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDebug
  • tst_QDnsLookup
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsAnchorLayout1
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QItemModel
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • ...
17393
1985-
1986 ::memmove(d->data() + i + len, d->data() + i, (d->size - i - len) * sizeof(QChar));-
1987 qt_from_latin1(d->data() + i, s, uint(len));-
1988 return *this;
executed 17393 times by 58 tests: return *this;
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_QAccessibility
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDebug
  • tst_QDnsLookup
  • tst_QErrorMessage
  • tst_QEventLoop
  • tst_QFileSystemModel
  • tst_QGlyphRun
  • tst_QGraphicsAnchorLayout
  • tst_QGraphicsAnchorLayout1
  • tst_QGraphicsItem
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiEventLoop
  • tst_QGuiVariant
  • tst_QHostInfo
  • tst_QItemModel
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • ...
17393
1989}-
1990-
1991/*!-
1992 \fn QString& QString::insert(int position, const QChar *unicode, int size)-
1993 \overload insert()-
1994-
1995 Inserts the first \a size characters of the QChar array \a unicode-
1996 at the given index \a position in the string.-
1997*/-
1998QString& QString::insert(int i, const QChar *unicode, int size)-
1999{-
2000 if (i < 0 || size <= 0)
i < 0Description
TRUEnever evaluated
FALSEevaluated 1414856 times by 75 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • ...
size <= 0Description
TRUEevaluated 353295 times by 39 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • ...
FALSEevaluated 1061561 times by 75 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • ...
0-1414856
2001 return *this;
executed 353295 times by 39 tests: return *this;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • ...
353295
2002-
2003 const ushort *s = (const ushort *)unicode;-
2004 if (s >= d->data() && s < d->data() + d->alloc) {
s >= d->data()Description
TRUEevaluated 473772 times by 69 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • ...
FALSEevaluated 587789 times by 74 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • ...
s < d->data() + d->allocDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_Collections
  • tst_QString
FALSEevaluated 473769 times by 69 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • ...
3-587789
2005 // Part of me - take a copy-
2006 ushort *tmp = static_cast<ushort *>(::malloc(size * sizeof(QChar)));-
2007 Q_CHECK_PTR(tmp);
never executed: qBadAlloc();
!(tmp)Description
TRUEnever evaluated
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_Collections
  • tst_QString
0-3
2008 memcpy(tmp, s, size * sizeof(QChar));-
2009 insert(i, reinterpret_cast<const QChar *>(tmp), size);-
2010 ::free(tmp);-
2011 return *this;
executed 3 times by 2 tests: return *this;
Executed by:
  • tst_Collections
  • tst_QString
3
2012 }-
2013-
2014 if (Q_UNLIKELY(i > d->size))
__builtin_expe...>size), false)Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_Collections
  • tst_QString
FALSEevaluated 1061556 times by 75 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • ...
2-1061556
2015 resize(i + size, QLatin1Char(' '));
executed 2 times by 2 tests: resize(i + size, QLatin1Char(' '));
Executed by:
  • tst_Collections
  • tst_QString
2
2016 else-
2017 resize(d->size + size);
executed 1061556 times by 75 tests: resize(d->size + size);
Executed by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • ...
1061556
2018-
2019 ::memmove(d->data() + i + size, d->data() + i, (d->size - i - size) * sizeof(QChar));-
2020 memcpy(d->data() + i, s, size * sizeof(QChar));-
2021 return *this;
executed 1061558 times by 75 tests: return *this;
Executed by:
  • tst_Collections
  • tst_QAbstractFileEngine
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • ...