qbytearraymatcher.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qbytearraymatcher.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qbytearraymatcher.h"-
35-
36#include <limits.h>-
37-
38QT_BEGIN_NAMESPACE-
39-
40static inline void bm_init_skiptable(const uchar *cc, int len, uchar *skiptable)-
41{-
42 int l = qMin(len, 255);-
43 memset(skiptable, l, 256*sizeof(uchar));-
44 cc += len - l;-
45 while (l--)
l--Description
TRUEevaluated 1032042 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
FALSEevaluated 46147 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
46147-1032042
46 skiptable[*cc++] = l;
executed 1032042 times by 28 tests: skiptable[*cc++] = l;
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
1032042
47}
executed 46147 times by 28 tests: end of block
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
46147
48-
49static inline int bm_find(const uchar *cc, int l, int index, const uchar *puc, uint pl,-
50 const uchar *skiptable)-
51{-
52 if (pl == 0)
pl == 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QString
FALSEevaluated 73136 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
8-73136
53 return index > l ? -1 : index;
executed 8 times by 1 test: return index > l ? -1 : index;
Executed by:
  • tst_QString
index > lDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QString
0-8
54 const uint pl_minus_one = pl - 1;-
55-
56 const uchar *current = cc + index + pl_minus_one;-
57 const uchar *end = cc + l;-
58 while (current < end) {
current < endDescription
TRUEevaluated 13716901 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
FALSEevaluated 4157 times by 23 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
4157-13716901
59 uint skip = skiptable[*current];-
60 if (!skip) {
!skipDescription
TRUEevaluated 79962 times by 27 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • ...
FALSEevaluated 13636939 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
79962-13636939
61 // possible match-
62 while (skip < pl) {
skip < plDescription
TRUEevaluated 1103188 times by 27 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • ...
FALSEevaluated 68045 times by 25 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Spdy
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
68045-1103188
63 if (*(current - skip) != puc[pl_minus_one - skip])
*(current - sk...us_one - skip]Description
TRUEevaluated 11917 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 1091271 times by 27 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • ...
11917-1091271
64 break;
executed 11917 times by 13 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
11917
65 skip++;-
66 }
executed 1091271 times by 27 tests: end of block
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • ...
1091271
67 if (skip > pl_minus_one) // we have a match
skip > pl_minus_oneDescription
TRUEevaluated 68045 times by 25 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Spdy
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
FALSEevaluated 11917 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
11917-68045
68 return (current - cc) - skip + 1;
executed 68045 times by 25 tests: return (current - cc) - skip + 1;
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Spdy
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
68045
69-
70 // in case we don't have a match we are a bit inefficient as we only skip by one-
71 // when we have the non matching char in the string.-
72 if (skiptable[*(current - skip)] == pl)
skiptable[*(cu...- skip)] == plDescription
TRUEevaluated 4255 times by 11 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 7662 times by 9 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_qmessagehandler
4255-7662
73 skip = pl - skip;
executed 4255 times by 11 tests: skip = pl - skip;
Executed by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
4255
74 else-
75 skip = 1;
executed 7662 times by 9 tests: skip = 1;
Executed by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_qmessagehandler
7662
76 }-
77 if (current > end - skip)
current > end - skipDescription
TRUEevaluated 934 times by 8 tests
Evaluated by:
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
FALSEevaluated 13647922 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
934-13647922
78 break;
executed 934 times by 8 tests: break;
Executed by:
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
934
79 current += skip;-
80 }
executed 13647922 times by 28 tests: end of block
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_Spdy
  • ...
13647922
81 return -1; // not found
executed 5091 times by 24 tests: return -1;
Executed by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
5091
82}-
83-
84/*! \class QByteArrayMatcher-
85 \inmodule QtCore-
86 \brief The QByteArrayMatcher class holds a sequence of bytes that-
87 can be quickly matched in a byte array.-
88-
89 \ingroup tools-
90 \ingroup string-processing-
91-
92 This class is useful when you have a sequence of bytes that you-
93 want to repeatedly match against some byte arrays (perhaps in a-
94 loop), or when you want to search for the same sequence of bytes-
95 multiple times in the same byte array. Using a matcher object and-
96 indexIn() is faster than matching a plain QByteArray with-
97 QByteArray::indexOf() if repeated matching takes place. This-
98 class offers no benefit if you are doing one-off byte array-
99 matches.-
100-
101 Create the QByteArrayMatcher with the QByteArray you want to-
102 search for. Then call indexIn() on the QByteArray that you want to-
103 search.-
104-
105 \sa QByteArray, QStringMatcher-
106*/-
107-
108/*!-
109 Constructs an empty byte array matcher that won't match anything.-
110 Call setPattern() to give it a pattern to match.-
111*/-
112QByteArrayMatcher::QByteArrayMatcher()-
113 : d(0)-
114{-
115 p.p = 0;-
116 p.l = 0;-
117 memset(p.q_skiptable, 0, sizeof(p.q_skiptable));-
118}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QByteArrayMatcher
2
119-
120/*!-
121 Constructs a byte array matcher from \a pattern. \a pattern-
122 has the given \a length. \a pattern must remain in scope, but-
123 the destructor does not delete \a pattern.-
124 */-
125QByteArrayMatcher::QByteArrayMatcher(const char *pattern, int length)-
126 : d(0)-
127{-
128 p.p = reinterpret_cast<const uchar *>(pattern);-
129 p.l = length;-
130 bm_init_skiptable(p.p, p.l, p.q_skiptable);-
131}
executed 2073 times by 9 tests: end of block
Executed by:
  • tst_Collections
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_Selftests
  • tst_qlogging - unknown status
  • tst_qmessagehandler
2073
132-
133/*!-
134 Constructs a byte array matcher that will search for \a pattern.-
135 Call indexIn() to perform a search.-
136*/-
137QByteArrayMatcher::QByteArrayMatcher(const QByteArray &pattern)-
138 : d(0), q_pattern(pattern)-
139{-
140 p.p = reinterpret_cast<const uchar *>(pattern.constData());-
141 p.l = pattern.size();-
142 bm_init_skiptable(p.p, p.l, p.q_skiptable);-
143}
executed 4332 times by 16 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_Spdy
  • tst_qnetworkreply - unknown status
4332
144-
145/*!-
146 Copies the \a other byte array matcher to this byte array matcher.-
147*/-
148QByteArrayMatcher::QByteArrayMatcher(const QByteArrayMatcher &other)-
149 : d(0)-
150{-
151 operator=(other);-
152}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QByteArrayMatcher
1
153-
154/*!-
155 Destroys the byte array matcher.-
156*/-
157QByteArrayMatcher::~QByteArrayMatcher()-
158{-
159 Q_UNUSED(d);-
160}
executed 6410 times by 25 tests: end of block
Executed by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qbytearraymatcher - unknown status
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
6410
161-
162/*!-
163 Assigns the \a other byte array matcher to this byte array matcher.-
164*/-
165QByteArrayMatcher &QByteArrayMatcher::operator=(const QByteArrayMatcher &other)-
166{-
167 q_pattern = other.q_pattern;-
168 memcpy(&p, &other.p, sizeof(p));-
169 return *this;
executed 5 times by 1 test: return *this;
Executed by:
  • tst_QByteArrayMatcher
5
170}-
171-
172/*!-
173 Sets the byte array that this byte array matcher will search for-
174 to \a pattern.-
175-
176 \sa pattern(), indexIn()-
177*/-
178void QByteArrayMatcher::setPattern(const QByteArray &pattern)-
179{-
180 q_pattern = pattern;-
181 p.p = reinterpret_cast<const uchar *>(pattern.constData());-
182 p.l = pattern.size();-
183 bm_init_skiptable(p.p, p.l, p.q_skiptable);-
184}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QByteArrayMatcher
3
185-
186/*!-
187 Searches the byte array \a ba, from byte position \a from (default-
188 0, i.e. from the first byte), for the byte array pattern() that-
189 was set in the constructor or in the most recent call to-
190 setPattern(). Returns the position where the pattern() matched in-
191 \a ba, or -1 if no match was found.-
192*/-
193int QByteArrayMatcher::indexIn(const QByteArray &ba, int from) const-
194{-
195 if (from < 0)
from < 0Description
TRUEnever evaluated
FALSEevaluated 33402 times by 24 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
0-33402
196 from = 0;
never executed: from = 0;
0
197 return bm_find(reinterpret_cast<const uchar *>(ba.constData()), ba.size(), from,
executed 33402 times by 24 tests: return bm_find(reinterpret_cast<const uchar *>(ba.constData()), ba.size(), from, p.p, p.l, p.q_skiptable);
Executed by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
33402
198 p.p, p.l, p.q_skiptable);
executed 33402 times by 24 tests: return bm_find(reinterpret_cast<const uchar *>(ba.constData()), ba.size(), from, p.p, p.l, p.q_skiptable);
Executed by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QByteArrayMatcher
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qlogging - unknown status
  • tst_qmessagehandler
  • tst_qnetworkreply - unknown status
33402
199}-
200-
201/*!-
202 Searches the char string \a str, which has length \a len, from-
203 byte position \a from (default 0, i.e. from the first byte), for-
204 the byte array pattern() that was set in the constructor or in the-
205 most recent call to setPattern(). Returns the position where the-
206 pattern() matched in \a str, or -1 if no match was found.-
207*/-
208int QByteArrayMatcher::indexIn(const char *str, int len, int from) const-
209{-
210 if (from < 0)
from < 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QByteArrayMatcher
0-3
211 from = 0;
never executed: from = 0;
0
212 return bm_find(reinterpret_cast<const uchar *>(str), len, from,
executed 3 times by 1 test: return bm_find(reinterpret_cast<const uchar *>(str), len, from, p.p, p.l, p.q_skiptable);
Executed by:
  • tst_QByteArrayMatcher
3
213 p.p, p.l, p.q_skiptable);
executed 3 times by 1 test: return bm_find(reinterpret_cast<const uchar *>(str), len, from, p.p, p.l, p.q_skiptable);
Executed by:
  • tst_QByteArrayMatcher
3
214}-
215-
216/*!-
217 \fn QByteArray QByteArrayMatcher::pattern() const-
218-
219 Returns the byte array pattern that this byte array matcher will-
220 search for.-
221-
222 \sa setPattern()-
223*/-
224-
225-
226static int findChar(const char *str, int len, char ch, int from)-
227{-
228 const uchar *s = (const uchar *)str;-
229 uchar c = (uchar)ch;-
230 if (from < 0)
from < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
231 from = qMax(from + len, 0);
never executed: from = qMax(from + len, 0);
0
232 if (from < len) {
from < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
233 const uchar *n = s + from - 1;-
234 const uchar *e = s + len;-
235 while (++n != e)
++n != eDescription
TRUEnever evaluated
FALSEnever evaluated
0
236 if (*n == c)
*n == cDescription
TRUEnever evaluated
FALSEnever evaluated
0
237 return n - s;
never executed: return n - s;
0
238 }
never executed: end of block
0
239 return -1;
never executed: return -1;
0
240}-
241-
242/*!-
243 \internal-
244 */-
245static int qFindByteArrayBoyerMoore(-
246 const char *haystack, int haystackLen, int haystackOffset,-
247 const char *needle, int needleLen)-
248{-
249 uchar skiptable[256];-
250 bm_init_skiptable((const uchar *)needle, needleLen, skiptable);-
251 if (haystackOffset < 0)
haystackOffset < 0Description
TRUEnever evaluated
FALSEevaluated 39739 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qmessagehandler
0-39739
252 haystackOffset = 0;
never executed: haystackOffset = 0;
0
253 return bm_find((const uchar *)haystack, haystackLen, haystackOffset,
executed 39739 times by 12 tests: return bm_find((const uchar *)haystack, haystackLen, haystackOffset, (const uchar *)needle, needleLen, skiptable);
Executed by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qmessagehandler
39739
254 (const uchar *)needle, needleLen, skiptable);
executed 39739 times by 12 tests: return bm_find((const uchar *)haystack, haystackLen, haystackOffset, (const uchar *)needle, needleLen, skiptable);
Executed by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qmessagehandler
39739
255}-
256-
257#define REHASH(a) \-
258 if (sl_minus_1 < sizeof(uint) * CHAR_BIT) \-
259 hashHaystack -= uint(a) << sl_minus_1; \-
260 hashHaystack <<= 1-
261-
262/*!-
263 \internal-
264 */-
265int qFindByteArray(-
266 const char *haystack0, int haystackLen, int from,-
267 const char *needle, int needleLen)-
268{-
269 const int l = haystackLen;-
270 const int sl = needleLen;-
271 if (from < 0)
from < 0Description
TRUEnever evaluated
FALSEevaluated 713757 times by 34 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • ...
0-713757
272 from += l;
never executed: from += l;
0
273 if (uint(sl + from) > (uint)l)
uint(sl + from) > (uint)lDescription
TRUEnever evaluated
FALSEevaluated 713757 times by 34 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • ...
0-713757
274 return -1;
never executed: return -1;
0
275 if (!sl)
!slDescription
TRUEnever evaluated
FALSEevaluated 713757 times by 34 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • ...
0-713757
276 return from;
never executed: return from;
0
277 if (!l)
!lDescription
TRUEnever evaluated
FALSEevaluated 713757 times by 34 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • ...
0-713757
278 return -1;
never executed: return -1;
0
279-
280 if (sl == 1)
sl == 1Description
TRUEnever evaluated
FALSEevaluated 713757 times by 34 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • ...
0-713757
281 return findChar(haystack0, haystackLen, needle[0], from);
never executed: return findChar(haystack0, haystackLen, needle[0], from);
0
282-
283 /*-
284 We use the Boyer-Moore algorithm in cases where the overhead-
285 for the skip table should pay off, otherwise we use a simple-
286 hash function.-
287 */-
288 if (l > 500 && sl > 5)
l > 500Description
TRUEevaluated 39771 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qmessagehandler
FALSEevaluated 673986 times by 33 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • ...
sl > 5Description
TRUEevaluated 39739 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qmessagehandler
FALSEevaluated 32 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextEdit
32-673986
289 return qFindByteArrayBoyerMoore(haystack0, haystackLen, from,
executed 39739 times by 12 tests: return qFindByteArrayBoyerMoore(haystack0, haystackLen, from, needle, needleLen);
Executed by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qmessagehandler
39739
290 needle, needleLen);
executed 39739 times by 12 tests: return qFindByteArrayBoyerMoore(haystack0, haystackLen, from, needle, needleLen);
Executed by:
  • tst_NetworkSelfTest
  • tst_QByteArray
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTextCodec
  • tst_QTextEdit
  • tst_Selftests
  • tst_qmessagehandler
39739
291-
292 /*-
293 We use some hashing for efficiency's sake. Instead of-
294 comparing strings, we compare the hash value of str with that-
295 of a part of this QString. Only if that matches, we call memcmp().-
296 */-
297 const char *haystack = haystack0 + from;-
298 const char *end = haystack0 + (l - sl);-
299 const uint sl_minus_1 = sl - 1;-
300 uint hashNeedle = 0, hashHaystack = 0;-
301 int idx;-
302 for (idx = 0; idx < sl; ++idx) {
idx < slDescription
TRUEevaluated 4789208 times by 33 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • ...
FALSEevaluated 674018 times by 33 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • ...
674018-4789208
303 hashNeedle = ((hashNeedle<<1) + needle[idx]);-
304 hashHaystack = ((hashHaystack<<1) + haystack[idx]);-
305 }
executed 4789208 times by 33 tests: end of block
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • ...
4789208
306 hashHaystack -= *(haystack + sl_minus_1);-
307-
308 while (haystack <= end) {
haystack <= endDescription
TRUEevaluated 18406755 times by 33 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • ...
FALSEevaluated 553112 times by 22 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_Selftests
  • tst_Spdy
  • tst_qapplication - unknown status
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
553112-18406755
309 hashHaystack += *(haystack + sl_minus_1);-
310 if (hashHaystack == hashNeedle && *needle == *haystack
hashHaystack == hashNeedleDescription
TRUEevaluated 120930 times by 25 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qmake
  • tst_qmessagehandler
FALSEevaluated 18285825 times by 29 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qapplication - unknown status
  • ...
*needle == *haystackDescription
TRUEevaluated 120908 times by 24 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qmake
  • tst_qmessagehandler
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_QTextBrowser
22-18285825
311 && memcmp(needle, haystack, sl) == 0)
memcmp(needle,...tack, sl) == 0Description
TRUEevaluated 120906 times by 24 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qmake
  • tst_qmessagehandler
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QByteArray
2-120906
312 return haystack - haystack0;
executed 120906 times by 24 tests: return haystack - haystack0;
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QByteArray
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
  • tst_QTcpSocket
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qmake
  • tst_qmessagehandler
120906
313-
314 REHASH(*haystack);
executed 18284318 times by 28 tests: hashHaystack -= uint(*haystack) << sl_minus_1;
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qapplication - unknown status
  • tst_qmake
  • ...
sl_minus_1 < sizeof(uint) * 8Description
TRUEevaluated 18284318 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qapplication - unknown status
  • tst_qmake
  • ...
FALSEevaluated 1531 times by 3 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_QString
  • tst_qmessagehandler
1531-18284318
315 ++haystack;-
316 }
executed 18285849 times by 29 tests: end of block
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_QTextDocument
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qapplication - unknown status
  • ...
18285849
317 return -1;
executed 553112 times by 22 tests: return -1;
Executed by:
  • tst_Collections
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QByteArray
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QMimeData
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QString
  • tst_QTextBrowser
  • tst_QTextCodec
  • tst_Selftests
  • tst_Spdy
  • tst_qapplication - unknown status
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
553112
318}-
319-
320QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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