OpenCoverage

qlibrary.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/plugin/qlibrary.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#include "qplatformdefs.h"-
41#include "qlibrary.h"-
42-
43#ifndef QT_NO_LIBRARY-
44-
45#include "qlibrary_p.h"-
46#include <qstringlist.h>-
47#include <qfile.h>-
48#include <qfileinfo.h>-
49#include <qmutex.h>-
50#include <qmap.h>-
51#include <private/qcoreapplication_p.h>-
52#ifdef Q_OS_MAC-
53# include <private/qcore_mac_p.h>-
54#endif-
55#ifndef NO_ERRNO_H-
56#include <errno.h>-
57#endif // NO_ERROR_H-
58#include <qdebug.h>-
59#include <qvector.h>-
60#include <qdir.h>-
61#include <qendian.h>-
62#include <qjsondocument.h>-
63#include <qjsonvalue.h>-
64#include "qelfparser_p.h"-
65#include "qmachparser_p.h"-
66-
67QT_BEGIN_NAMESPACE-
68-
69#ifdef QT_NO_DEBUG-
70# define QLIBRARY_AS_DEBUG false-
71#else-
72# define QLIBRARY_AS_DEBUG true-
73#endif-
74-
75#if defined(Q_OS_UNIX)-
76// We don't use separate debug and release libs on UNIX, so we want-
77// to allow loading plugins, regardless of how they were built.-
78# define QT_NO_DEBUG_PLUGIN_CHECK-
79#endif-
80-
81/*!-
82 \class QLibrary-
83 \inmodule QtCore-
84 \reentrant-
85 \brief The QLibrary class loads shared libraries at runtime.-
86-
87-
88 \ingroup plugins-
89-
90 An instance of a QLibrary object operates on a single shared-
91 object file (which we call a "library", but is also known as a-
92 "DLL"). A QLibrary provides access to the functionality in the-
93 library in a platform independent way. You can either pass a file-
94 name in the constructor, or set it explicitly with setFileName().-
95 When loading the library, QLibrary searches in all the-
96 system-specific library locations (e.g. \c LD_LIBRARY_PATH on-
97 Unix), unless the file name has an absolute path.-
98-
99 If the file name is an absolute path then an attempt is made to-
100 load this path first. If the file cannot be found, QLibrary tries-
101 the name with different platform-specific file prefixes, like-
102 "lib" on Unix and Mac, and suffixes, like ".so" on Unix, ".dylib"-
103 on the Mac, or ".dll" on Windows.-
104-
105 If the file path is not absolute then QLibrary modifies the search-
106 order to try the system-specific prefixes and suffixes first,-
107 followed by the file path specified.-
108-
109 This makes it possible to specify shared libraries that are only-
110 identified by their basename (i.e. without their suffix), so the-
111 same code will work on different operating systems yet still-
112 minimise the number of attempts to find the library.-
113-
114 The most important functions are load() to dynamically load the-
115 library file, isLoaded() to check whether loading was successful,-
116 and resolve() to resolve a symbol in the library. The resolve()-
117 function implicitly tries to load the library if it has not been-
118 loaded yet. Multiple instances of QLibrary can be used to access-
119 the same physical library. Once loaded, libraries remain in memory-
120 until the application terminates. You can attempt to unload a-
121 library using unload(), but if other instances of QLibrary are-
122 using the same library, the call will fail, and unloading will-
123 only happen when every instance has called unload().-
124-
125 A typical use of QLibrary is to resolve an exported symbol in a-
126 library, and to call the C function that this symbol represents.-
127 This is called "explicit linking" in contrast to "implicit-
128 linking", which is done by the link step in the build process when-
129 linking an executable against a library.-
130-
131 The following code snippet loads a library, resolves the symbol-
132 "mysymbol", and calls the function if everything succeeded. If-
133 something goes wrong, e.g. the library file does not exist or the-
134 symbol is not defined, the function pointer will be 0 and won't be-
135 called.-
136-
137 \snippet code/src_corelib_plugin_qlibrary.cpp 0-
138-
139 The symbol must be exported as a C function from the library for-
140 resolve() to work. This means that the function must be wrapped in-
141 an \c{extern "C"} block if the library is compiled with a C++-
142 compiler. On Windows, this also requires the use of a \c dllexport-
143 macro; see resolve() for the details of how this is done. For-
144 convenience, there is a static resolve() function which you can-
145 use if you just want to call a function in a library without-
146 explicitly loading the library first:-
147-
148 \snippet code/src_corelib_plugin_qlibrary.cpp 1-
149-
150 \sa QPluginLoader-
151*/-
152-
153/*!-
154 \enum QLibrary::LoadHint-
155-
156 This enum describes the possible hints that can be used to change the way-
157 libraries are handled when they are loaded. These values indicate how-
158 symbols are resolved when libraries are loaded, and are specified using-
159 the setLoadHints() function.-
160-
161 \value ResolveAllSymbolsHint-
162 Causes all symbols in a library to be resolved when it is loaded, not-
163 simply when resolve() is called.-
164 \value ExportExternalSymbolsHint-
165 Exports unresolved and external symbols in the library so that they can be-
166 resolved in other dynamically-loaded libraries loaded later.-
167 \value LoadArchiveMemberHint-
168 Allows the file name of the library to specify a particular object file-
169 within an archive file.-
170 If this hint is given, the filename of the library consists of-
171 a path, which is a reference to an archive file, followed by-
172 a reference to the archive member.-
173 \value PreventUnloadHint-
174 Prevents the library from being unloaded from the address space if close()-
175 is called. The library's static variables are not reinitialized if open()-
176 is called at a later time.-
177 \value DeepBindHint-
178 Instructs the linker to prefer definitions in the loaded library-
179 over exported definitions in the loading application when resolving-
180 external symbols in the loaded library. This option is only supported-
181 on Linux.-
182-
183 \sa loadHints-
184*/-
185-
186-
187static long qt_find_pattern(const char *s, ulong s_len,-
188 const char *pattern, ulong p_len)-
189{-
190 /*-
191 we search from the end of the file because on the supported-
192 systems, the read-only data/text segments are placed at the end-
193 of the file. HOWEVER, when building with debugging enabled, all-
194 the debug symbols are placed AFTER the data/text segments.-
195-
196 what does this mean? when building in release mode, the search-
197 is fast because the data we are looking for is at the end of the-
198 file... when building in debug mode, the search is slower-
199 because we have to skip over all the debugging symbols first-
200 */-
201-
202 if (! s || ! pattern || p_len > s_len) return -1;
never executed: return -1;
! sDescription
TRUEnever evaluated
FALSEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
! patternDescription
TRUEnever evaluated
FALSEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
p_len > s_lenDescription
TRUEnever evaluated
FALSEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-676
203 ulong i, hs = 0, hp = 0, delta = s_len - p_len;-
204-
205 for (i = 0; i < p_len; ++i) {
i < p_lenDescription
TRUEevaluated 8112 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
676-8112
206 hs += s[delta + i];-
207 hp += pattern[i];-
208 }
executed 8112 times by 111 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
8112
209 i = delta;-
210 for (;;) {-
211 if (hs == hp && qstrncmp(s + i, pattern, p_len) == 0)
hs == hpDescription
TRUEevaluated 689 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 182131 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
qstrncmp(s + i...n, p_len) == 0Description
TRUEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 13 times by 9 tests
Evaluated by:
  • tst_QGuiApplication
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlThread
13-182131
212 return i;
executed 676 times by 111 tests: return i;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
676
213 if (i == 0)
i == 0Description
TRUEnever evaluated
FALSEevaluated 182144 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-182144
214 break;
never executed: break;
0
215 --i;-
216 hs -= s[i + p_len];-
217 hs += s[i];-
218 }
executed 182144 times by 111 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
182144
219-
220 return -1;
never executed: return -1;
0
221}-
222-
223/*-
224 This opens the specified library, mmaps it into memory, and searches-
225 for the QT_PLUGIN_VERIFICATION_DATA. The advantage of this approach is that-
226 we can get the verification data without have to actually load the library.-
227 This lets us detect mismatches more safely.-
228-
229 Returns \c false if version information is not present, or if the-
230 information could not be read.-
231 Returns true if version information is present and successfully read.-
232*/-
233static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)-
234{-
235 QFile file(library);-
236 if (!file.open(QIODevice::ReadOnly)) {
!file.open(QIO...ice::ReadOnly)Description
TRUEnever evaluated
FALSEevaluated 1396 times by 113 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-1396
237 if (lib)
libDescription
TRUEnever evaluated
FALSEnever evaluated
0
238 lib->errorString = file.errorString();
never executed: lib->errorString = file.errorString();
0
239 if (qt_debug_component()) {
qt_debug_component()Description
TRUEnever evaluated
FALSEnever evaluated
0
240 qWarning("%s: %s", (const char*) QFile::encodeName(library),-
241 qPrintable(qt_error_string(errno)));-
242 }
never executed: end of block
0
243 return false;
never executed: return false;
0
244 }-
245-
246 QByteArray data;-
247 const char *filedata = 0;-
248 ulong fdlen = file.size();-
249 filedata = (char *) file.map(0, fdlen);-
250 if (filedata == 0) {
filedata == 0Description
TRUEnever evaluated
FALSEevaluated 1396 times by 113 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-1396
251 // try reading the data into memory instead-
252 data = file.readAll();-
253 filedata = data.constData();-
254 fdlen = data.size();-
255 }
never executed: end of block
0
256-
257 /*-
258 ELF and Mach-O binaries with GCC have .qplugin sections.-
259 */-
260 bool hasMetaData = false;-
261 long pos = 0;-
262 char pattern[] = "qTMETADATA ";-
263 pattern[0] = 'Q'; // Ensure the pattern "QTMETADATA" is not found in this library should QPluginLoader ever encounter it.-
264 const ulong plen = qstrlen(pattern);-
265#if defined (Q_OF_ELF) && defined(Q_CC_GNU)-
266 int r = QElfParser().parse(filedata, fdlen, library, lib, &pos, &fdlen);-
267 if (r == QElfParser::Corrupt || r == QElfParser::NotElf) {
r == QElfParser::CorruptDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QPluginLoader
FALSEevaluated 1393 times by 113 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
r == QElfParser::NotElfDescription
TRUEevaluated 716 times by 112 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 677 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
3-1393
268 if (lib && qt_debug_component()) {
libDescription
TRUEevaluated 719 times by 112 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEnever evaluated
qt_debug_component()Description
TRUEnever evaluated
FALSEevaluated 719 times by 112 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-719
269 qWarning("QElfParser: %s",qPrintable(lib->errorString));-
270 }
never executed: end of block
0
271 return false;
executed 719 times by 112 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
719
272 } else if (r == QElfParser::QtMetaDataSection) {
r == QElfParse...etaDataSectionDescription
TRUEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPluginLoader
1-676
273 long rel = qt_find_pattern(filedata + pos, fdlen, pattern, plen);-
274 if (rel < 0)
rel < 0Description
TRUEnever evaluated
FALSEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-676
275 pos = -1;
never executed: pos = -1;
0
276 else-
277 pos += rel;
executed 676 times by 111 tests: pos += rel;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
676
278 hasMetaData = true;-
279 }
executed 676 times by 111 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
676
280#elif defined (Q_OF_MACH_O)-
281 {-
282 QString errorString;-
283 int r = QMachOParser::parse(filedata, fdlen, library, &errorString, &pos, &fdlen);-
284 if (r == QMachOParser::NotSuitable) {-
285 if (qt_debug_component())-
286 qWarning("QMachOParser: %s", qPrintable(errorString));-
287 if (lib)-
288 lib->errorString = errorString;-
289 return false;-
290 }-
291 // even if the metadata section was not found, the Mach-O parser will-
292 // at least return the boundaries of the right architecture-
293 long rel = qt_find_pattern(filedata + pos, fdlen, pattern, plen);-
294 if (rel < 0)-
295 pos = -1;-
296 else-
297 pos += rel;-
298 hasMetaData = true;-
299 }-
300#else-
301 pos = qt_find_pattern(filedata, fdlen, pattern, plen);-
302 if (pos > 0)-
303 hasMetaData = true;-
304#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU)-
305-
306 bool ret = false;-
307-
308 if (pos >= 0) {
pos >= 0Description
TRUEevaluated 677 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEnever evaluated
0-677
309 if (hasMetaData) {
hasMetaDataDescription
TRUEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPluginLoader
1-676
310 const char *data = filedata + pos;-
311 QJsonDocument doc = qJsonFromRawLibraryMetaData(data);-
312 lib->metaData = doc.object();-
313 if (qt_debug_component())
qt_debug_component()Description
TRUEnever evaluated
FALSEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-676
314 qWarning("Found metadata in lib %s, metadata=\n%s\n",
never executed: QMessageLogger(__FILE__, 314, __PRETTY_FUNCTION__).warning("Found metadata in lib %s, metadata=\n%s\n", library.toLocal8Bit().constData(), doc.toJson().constData());
0
315 library.toLocal8Bit().constData(), doc.toJson().constData());
never executed: QMessageLogger(__FILE__, 314, __PRETTY_FUNCTION__).warning("Found metadata in lib %s, metadata=\n%s\n", library.toLocal8Bit().constData(), doc.toJson().constData());
0
316 ret = !doc.isNull();-
317 }
executed 676 times by 111 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
676
318 }
executed 677 times by 111 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
677
319-
320 if (!ret && lib)
!retDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPluginLoader
FALSEevaluated 676 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
libDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPluginLoader
FALSEnever evaluated
0-676
321 lib->errorString = QLibrary::tr("Failed to extract plugin meta data from '%1'").arg(library);
executed 1 time by 1 test: lib->errorString = QLibrary::tr("Failed to extract plugin meta data from '%1'").arg(library);
Executed by:
  • tst_QPluginLoader
1
322 file.close();-
323 return ret;
executed 677 times by 111 tests: return ret;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
677
324}-
325-
326static void installCoverageTool(QLibraryPrivate *libPrivate)-
327{-
328#ifdef __COVERAGESCANNER__-
329 /*-
330 __COVERAGESCANNER__ is defined when Qt has been instrumented for code-
331 coverage by TestCocoon. CoverageScanner is the name of the tool that-
332 generates the code instrumentation.-
333 This code is required here when code coverage analysis with TestCocoon-
334 is enabled in order to allow the loading application to register the plugin-
335 and then store its execution report. The execution report gathers information-
336 about each part of the plugin's code that has been used when-
337 the plugin was loaded by the launching application.-
338 The execution report for the plugin will go to the same execution report-
339 as the one defined for the application loading it.-
340 */-
341-
342 int ret = __coveragescanner_register_library(libPrivate->fileName.toLocal8Bit());-
343-
344 if (qt_debug_component()) {
qt_debug_component()Description
TRUEnever evaluated
FALSEevaluated 524 times by 134 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
0-524
345 if (ret >= 0) {
ret >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
346 qDebug("coverage data for %s registered",-
347 qPrintable(libPrivate->fileName));-
348 } else {
never executed: end of block
0
349 qWarning("could not register %s: error %d; coverage data may be incomplete",-
350 qPrintable(libPrivate->fileName),-
351 ret);-
352 }
never executed: end of block
0
353 }-
354#else-
355 Q_UNUSED(libPrivate);-
356#endif-
357}
executed 524 times by 134 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
524
358-
359class QLibraryStore-
360{-
361public:-
362 inline ~QLibraryStore();-
363 static inline QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version, QLibrary::LoadHints loadHints);-
364 static inline void releaseLibrary(QLibraryPrivate *lib);-
365-
366 static inline void cleanup();-
367-
368private:-
369 static inline QLibraryStore *instance();-
370-
371 // all members and instance() are protected by qt_library_mutex-
372 typedef QMap<QString, QLibraryPrivate*> LibraryMap;-
373 LibraryMap libraryMap;-
374};-
375-
376static QBasicMutex qt_library_mutex;-
377static QLibraryStore *qt_library_data = 0;-
378static bool qt_library_data_once;-
379-
380QLibraryStore::~QLibraryStore()-
381{-
382 qt_library_data = 0;-
383}
never executed: end of block
0
384-
385inline void QLibraryStore::cleanup()-
386{-
387 QLibraryStore *data = qt_library_data;-
388 if (!data)
!dataDescription
TRUEnever evaluated
FALSEnever evaluated
0
389 return;
never executed: return;
0
390-
391 // find any libraries that are still loaded but have a no one attached to them-
392 LibraryMap::Iterator it = data->libraryMap.begin();-
393 for (; it != data->libraryMap.end(); ++it) {
it != data->libraryMap.end()Description
TRUEnever evaluated
FALSEnever evaluated
0
394 QLibraryPrivate *lib = it.value();-
395 if (lib->libraryRefCount.load() == 1) {
lib->libraryRe...nt.load() == 1Description
TRUEnever evaluated
FALSEnever evaluated
0
396 if (lib->libraryUnloadCount.load() > 0) {
lib->libraryUn...unt.load() > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
397 Q_ASSERT(lib->pHnd);-
398 lib->libraryUnloadCount.store(1);-
399#ifdef __GLIBC__-
400 // glibc has a bug in unloading from global destructors-
401 // see https://bugzilla.novell.com/show_bug.cgi?id=622977-
402 // and http://sourceware.org/bugzilla/show_bug.cgi?id=11941-
403 lib->unload(QLibraryPrivate::NoUnloadSys);-
404#else-
405 lib->unload();-
406#endif-
407 }
never executed: end of block
0
408 delete lib;-
409 it.value() = 0;-
410 }
never executed: end of block
0
411 }
never executed: end of block
0
412-
413 if (qt_debug_component()) {
qt_debug_component()Description
TRUEnever evaluated
FALSEnever evaluated
0
414 // dump all objects that remain-
415 for (QLibraryPrivate *lib : qAsConst(data->libraryMap)) {-
416 if (lib)
libDescription
TRUEnever evaluated
FALSEnever evaluated
0
417 qDebug() << "On QtCore unload," << lib->fileName << "was leaked, with"
never executed: QMessageLogger(__FILE__, 417, __PRETTY_FUNCTION__).debug() << "On QtCore unload," << lib->fileName << "was leaked, with" << lib->libraryRefCount.load() << "users";
0
418 << lib->libraryRefCount.load() << "users";
never executed: QMessageLogger(__FILE__, 417, __PRETTY_FUNCTION__).debug() << "On QtCore unload," << lib->fileName << "was leaked, with" << lib->libraryRefCount.load() << "users";
0
419 }
never executed: end of block
0
420 }
never executed: end of block
0
421-
422 delete data;-
423}
never executed: end of block
0
424-
425static void qlibraryCleanup()-
426{-
427 QLibraryStore::cleanup();-
428}
never executed: end of block
0
429Q_DESTRUCTOR_FUNCTION(qlibraryCleanup)
never executed: end of block
0
430-
431// must be called with a locked mutex-
432QLibraryStore *QLibraryStore::instance()-
433{-
434 if (Q_UNLIKELY(!qt_library_data_once && !qt_library_data)) {
__builtin_expe..._data), false)Description
TRUEevaluated 77 times by 48 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImage
  • tst_QNetworkAccessManager
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPlugin
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • ...
FALSEevaluated 5254 times by 377 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
77-5254
435 // only create once per process lifetime-
436 qt_library_data = new QLibraryStore;-
437 qt_library_data_once = true;-
438 }
executed 77 times by 48 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImage
  • tst_QNetworkAccessManager
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPlugin
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • ...
77
439 return qt_library_data;
executed 5331 times by 377 tests: return qt_library_data;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
5331
440}-
441-
442inline QLibraryPrivate *QLibraryStore::findOrCreate(const QString &fileName, const QString &version,-
443 QLibrary::LoadHints loadHints)-
444{-
445 QMutexLocker locker(&qt_library_mutex);-
446 QLibraryStore *data = instance();-
447-
448 // check if this library is already loaded-
449 QLibraryPrivate *lib = 0;-
450 if (Q_LIKELY(data)) {
__builtin_expe...!(data), true)Description
TRUEevaluated 1600 times by 136 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
FALSEnever evaluated
0-1600
451 lib = data->libraryMap.value(fileName);-
452 if (lib)
libDescription
TRUEevaluated 62 times by 19 tests
Evaluated by:
  • tst_QBrush
  • tst_QDataStream
  • tst_QFactoryLoader
  • tst_QGuiVariant
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLibrary
  • tst_QPainter
  • tst_QPixmap
  • tst_QPluginLoader
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
  • tst_QTextLayout
FALSEevaluated 1538 times by 136 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
62-1538
453 lib->mergeLoadHints(loadHints);
executed 62 times by 19 tests: lib->mergeLoadHints(loadHints);
Executed by:
  • tst_QBrush
  • tst_QDataStream
  • tst_QFactoryLoader
  • tst_QGuiVariant
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLibrary
  • tst_QPainter
  • tst_QPixmap
  • tst_QPluginLoader
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
  • tst_QTextLayout
62
454 }
executed 1600 times by 136 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
1600
455 if (!lib)
!libDescription
TRUEevaluated 1538 times by 136 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
FALSEevaluated 62 times by 19 tests
Evaluated by:
  • tst_QBrush
  • tst_QDataStream
  • tst_QFactoryLoader
  • tst_QGuiVariant
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLibrary
  • tst_QPainter
  • tst_QPixmap
  • tst_QPluginLoader
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
  • tst_QTextLayout
62-1538
456 lib = new QLibraryPrivate(fileName, version, loadHints);
executed 1538 times by 136 tests: lib = new QLibraryPrivate(fileName, version, loadHints);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
1538
457-
458 // track this library-
459 if (Q_LIKELY(data) && !fileName.isEmpty())
__builtin_expe...!(data), true)Description
TRUEevaluated 1600 times by 136 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
FALSEnever evaluated
!fileName.isEmpty()Description
TRUEevaluated 1594 times by 136 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QLibrary
  • tst_QPluginLoader
0-1600
460 data->libraryMap.insert(fileName, lib);
executed 1594 times by 136 tests: data->libraryMap.insert(fileName, lib);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
1594
461-
462 lib->libraryRefCount.ref();-
463 return lib;
executed 1600 times by 136 tests: return lib;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
1600
464}-
465-
466inline void QLibraryStore::releaseLibrary(QLibraryPrivate *lib)-
467{-
468 QMutexLocker locker(&qt_library_mutex);-
469 QLibraryStore *data = instance();-
470-
471 if (lib->libraryRefCount.deref()) {
lib->libraryRefCount.deref()Description
TRUEevaluated 158 times by 57 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPlugin
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • ...
FALSEevaluated 3573 times by 355 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
158-3573
472 // still in use-
473 return;
executed 158 times by 57 tests: return;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPlugin
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • ...
158
474 }-
475-
476 // no one else is using-
477 Q_ASSERT(lib->libraryUnloadCount.load() == 0);-
478-
479 if (Q_LIKELY(data) && !lib->fileName.isEmpty()) {
__builtin_expe...!(data), true)Description
TRUEevaluated 3573 times by 355 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEnever evaluated
!lib->fileName.isEmpty()Description
TRUEevaluated 3567 times by 355 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QLibrary
  • tst_QPluginLoader
0-3573
480 QLibraryPrivate *that = data->libraryMap.take(lib->fileName);-
481 Q_ASSERT(lib == that);-
482 Q_UNUSED(that);-
483 }
executed 3567 times by 355 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
3567
484 delete lib;-
485}
executed 3573 times by 355 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
3573
486-
487QLibraryPrivate::QLibraryPrivate(const QString &canonicalFileName, const QString &version, QLibrary::LoadHints loadHints)-
488 : pHnd(0), fileName(canonicalFileName), fullVersion(version), instance(0),-
489 libraryRefCount(0), libraryUnloadCount(0), pluginState(MightBeAPlugin)-
490{-
491 loadHintsInt.store(loadHints);-
492 if (canonicalFileName.isEmpty())
canonicalFileName.isEmpty()Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QLibrary
  • tst_QPluginLoader
FALSEevaluated 1532 times by 136 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
6-1532
493 errorString = QLibrary::tr("The shared library was not found.");
executed 6 times by 2 tests: errorString = QLibrary::tr("The shared library was not found.");
Executed by:
  • tst_QLibrary
  • tst_QPluginLoader
6
494}
executed 1538 times by 136 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
1538
495-
496QLibraryPrivate *QLibraryPrivate::findOrCreate(const QString &fileName, const QString &version,-
497 QLibrary::LoadHints loadHints)-
498{-
499 return QLibraryStore::findOrCreate(fileName, version, loadHints);
executed 1600 times by 136 tests: return QLibraryStore::findOrCreate(fileName, version, loadHints);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
1600
500}-
501-
502QLibraryPrivate::~QLibraryPrivate()-
503{-
504}-
505-
506void QLibraryPrivate::mergeLoadHints(QLibrary::LoadHints lh)-
507{-
508 // if the library is already loaded, we can't change the load hints-
509 if (pHnd)
pHndDescription
TRUEevaluated 110 times by 19 tests
Evaluated by:
  • tst_QBrush
  • tst_QDataStream
  • tst_QFactoryLoader
  • tst_QGuiVariant
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLibrary
  • tst_QPainter
  • tst_QPixmap
  • tst_QPluginLoader
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
  • tst_QTextLayout
FALSEevaluated 689 times by 112 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
110-689
510 return;
executed 110 times by 19 tests: return;
Executed by:
  • tst_QBrush
  • tst_QDataStream
  • tst_QFactoryLoader
  • tst_QGuiVariant
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLibrary
  • tst_QPainter
  • tst_QPixmap
  • tst_QPluginLoader
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
  • tst_QTextLayout
110
511-
512 loadHintsInt.store(lh);-
513}
executed 689 times by 112 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
689
514-
515QFunctionPointer QLibraryPrivate::resolve(const char *symbol)-
516{-
517 if (!pHnd)
!pHndDescription
TRUEnever evaluated
FALSEevaluated 3627 times by 134 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
0-3627
518 return 0;
never executed: return 0;
0
519 return resolve_sys(symbol);
executed 3627 times by 134 tests: return resolve_sys(symbol);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
3627
520}-
521-
522void QLibraryPrivate::setLoadHints(QLibrary::LoadHints lh)-
523{-
524 // this locks a global mutex-
525 QMutexLocker lock(&qt_library_mutex);-
526 mergeLoadHints(lh);-
527}
executed 737 times by 114 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
737
528-
529bool QLibraryPrivate::load()-
530{-
531 if (pHnd) {
pHndDescription
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QLibrary
  • tst_QPluginLoader
FALSEevaluated 530 times by 134 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
2-530
532 libraryUnloadCount.ref();-
533 return true;
executed 2 times by 2 tests: return true;
Executed by:
  • tst_QLibrary
  • tst_QPluginLoader
2
534 }-
535 if (fileName.isEmpty())
fileName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 530 times by 134 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
0-530
536 return false;
never executed: return false;
0
537-
538 bool ret = load_sys();-
539 if (qt_debug_component()) {
qt_debug_component()Description
TRUEnever evaluated
FALSEevaluated 530 times by 134 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
0-530
540 if (ret) {
retDescription
TRUEnever evaluated
FALSEnever evaluated
0
541 qDebug() << "loaded library" << fileName;-
542 } else {
never executed: end of block
0
543 qDebug() << qUtf8Printable(errorString);-
544 }
never executed: end of block
0
545 }-
546 if (ret) {
retDescription
TRUEevaluated 524 times by 134 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QLibrary
  • tst_qlibrary - unknown status
6-524
547 //when loading a library we add a reference to it so that the QLibraryPrivate won't get deleted-
548 //this allows to unload the library at a later time-
549 libraryUnloadCount.ref();-
550 libraryRefCount.ref();-
551 installCoverageTool(this);-
552 }
executed 524 times by 134 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
524
553-
554 return ret;
executed 530 times by 134 tests: return ret;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
530
555}-
556-
557bool QLibraryPrivate::unload(UnloadFlag flag)-
558{-
559 if (!pHnd)
!pHndDescription
TRUEevaluated 1795 times by 227 tests
Evaluated by:
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qclipboard - unknown status
  • tst_qcolor - unknown status
  • tst_qcolordialog - unknown status
  • ...
FALSEevaluated 1079 times by 248 tests
Evaluated by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
1079-1795
560 return false;
executed 1795 times by 227 tests: return false;
Executed by:
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qclipboard - unknown status
  • tst_qcolor - unknown status
  • tst_qcolordialog - unknown status
  • ...
1795
561 if (libraryUnloadCount.load() > 0 && !libraryUnloadCount.deref()) { // only unload if ALL QLibrary instance wanted to
libraryUnloadCount.load() > 0Description
TRUEevaluated 1079 times by 248 tests
Evaluated by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
FALSEnever evaluated
!libraryUnloadCount.deref()Description
TRUEevaluated 1076 times by 248 tests
Evaluated by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QLibrary
  • tst_QPluginLoader
0-1079
562 delete inst.data();-
563 if (flag == NoUnloadSys || unload_sys()) {
flag == NoUnloadSysDescription
TRUEnever evaluated
FALSEevaluated 1076 times by 248 tests
Evaluated by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
unload_sys()Description
TRUEevaluated 1076 times by 248 tests
Evaluated by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
FALSEnever evaluated
0-1076
564 if (qt_debug_component())
qt_debug_component()Description
TRUEnever evaluated
FALSEevaluated 1076 times by 248 tests
Evaluated by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
0-1076
565 qWarning() << "QLibraryPrivate::unload succeeded on" << fileName
never executed: QMessageLogger(__FILE__, 565, __PRETTY_FUNCTION__).warning() << "QLibraryPrivate::unload succeeded on" << fileName << (flag == NoUnloadSys ? "(faked)" : "");
0
566 << (flag == NoUnloadSys ? "(faked)" : "");
never executed: QMessageLogger(__FILE__, 565, __PRETTY_FUNCTION__).warning() << "QLibraryPrivate::unload succeeded on" << fileName << (flag == NoUnloadSys ? "(faked)" : "");
0
567 //when the library is unloaded, we release the reference on it so that 'this'-
568 //can get deleted-
569 libraryRefCount.deref();-
570 pHnd = 0;-
571 instance = 0;-
572 }
executed 1076 times by 248 tests: end of block
Executed by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
1076
573 }
executed 1076 times by 248 tests: end of block
Executed by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
1076
574-
575 return (pHnd == 0);
executed 1079 times by 248 tests: return (pHnd == 0);
Executed by:
  • tst_QFactoryLoader
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • ...
1079
576}-
577-
578void QLibraryPrivate::release()-
579{-
580 QLibraryStore::releaseLibrary(this);-
581}
executed 3731 times by 377 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • ...
3731
582-
583bool QLibraryPrivate::loadPlugin()-
584{-
585 if (instance) {
instanceDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QPluginLoader
FALSEevaluated 408 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
1-408
586 libraryUnloadCount.ref();-
587 return true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_QPluginLoader
1
588 }-
589 if (pluginState == IsNotAPlugin)
pluginState == IsNotAPluginDescription
TRUEnever evaluated
FALSEevaluated 408 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-408
590 return false;
never executed: return false;
0
591 if (load()) {
load()Description
TRUEevaluated 408 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEnever evaluated
0-408
592 instance = (QtPluginInstanceFunction)resolve("qt_plugin_instance");-
593 return instance;
executed 408 times by 111 tests: return instance;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
408
594 }-
595 if (qt_debug_component())
qt_debug_component()Description
TRUEnever evaluated
FALSEnever evaluated
0
596 qWarning() << "QLibraryPrivate::loadPlugin failed on" << fileName << ":" << errorString;
never executed: QMessageLogger(__FILE__, 596, __PRETTY_FUNCTION__).warning() << "QLibraryPrivate::loadPlugin failed on" << fileName << ":" << errorString;
0
597 pluginState = IsNotAPlugin;-
598 return false;
never executed: return false;
0
599}-
600-
601/*!-
602 Returns \c true if \a fileName has a valid suffix for a loadable-
603 library; otherwise returns \c false.-
604-
605 \table-
606 \header \li Platform \li Valid suffixes-
607 \row \li Windows \li \c .dll, \c .DLL-
608 \row \li Unix/Linux \li \c .so-
609 \row \li AIX \li \c .a-
610 \row \li HP-UX \li \c .sl, \c .so (HP-UXi)-
611 \row \li \macos and iOS \li \c .dylib, \c .bundle, \c .so-
612 \endtable-
613-
614 Trailing versioning numbers on Unix are ignored.-
615 */-
616bool QLibrary::isLibrary(const QString &fileName)-
617{-
618#if defined(Q_OS_WIN)-
619 return fileName.endsWith(QLatin1String(".dll"), Qt::CaseInsensitive);-
620#else-
621 QString completeSuffix = QFileInfo(fileName).completeSuffix();-
622 if (completeSuffix.isEmpty())
completeSuffix.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
0-16
623 return false;
never executed: return false;
0
624 QStringList suffixes = completeSuffix.split(QLatin1Char('.'));-
625# if defined(Q_OS_DARWIN)-
626-
627 // On Mac, libs look like libmylib.1.0.0.dylib-
628 const QString lastSuffix = suffixes.at(suffixes.count() - 1);-
629 const QString firstSuffix = suffixes.at(0);-
630-
631 bool valid = (lastSuffix == QLatin1String("dylib")-
632 || firstSuffix == QLatin1String("so")-
633 || firstSuffix == QLatin1String("bundle"));-
634-
635 return valid;-
636# else // Generic Unix-
637 QStringList validSuffixList;-
638-
639# if defined(Q_OS_HPUX)-
640/*-
641 See "HP-UX Linker and Libraries User's Guide", section "Link-time Differences between PA-RISC and IPF":-
642 "In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit),-
643 the shared libraries are suffixed with .so. For compatibility, the IPF linker also supports the .sl suffix."-
644 */-
645 validSuffixList << QLatin1String("sl");-
646# if defined __ia64-
647 validSuffixList << QLatin1String("so");-
648# endif-
649# elif defined(Q_OS_AIX)-
650 validSuffixList << QLatin1String("a") << QLatin1String("so");-
651# elif defined(Q_OS_UNIX)-
652 validSuffixList << QLatin1String("so");-
653# endif-
654-
655 // Examples of valid library names:-
656 // libfoo.so-
657 // libfoo.so.0-
658 // libfoo.so.0.3-
659 // libfoo-0.3.so-
660 // libfoo-0.3.so.0.3.0-
661-
662 int suffix;-
663 int suffixPos = -1;-
664 for (suffix = 0; suffix < validSuffixList.count() && suffixPos == -1; ++suffix)
suffix < valid...ixList.count()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
suffixPos == -1Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
FALSEnever evaluated
0-16
665 suffixPos = suffixes.indexOf(validSuffixList.at(suffix));
executed 16 times by 2 tests: suffixPos = suffixes.indexOf(validSuffixList.at(suffix));
Executed by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
16
666-
667 bool valid = suffixPos != -1;-
668 for (int i = suffixPos + 1; i < suffixes.count() && valid; ++i)
i < suffixes.count()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
validDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qlibrary - unknown status
6-14
669 if (i != suffixPos)
i != suffixPosDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
FALSEnever evaluated
0-6
670 suffixes.at(i).toInt(&valid);
executed 6 times by 2 tests: suffixes.at(i).toInt(&valid);
Executed by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
6
671 return valid;
executed 16 times by 2 tests: return valid;
Executed by:
  • tst_QPlugin
  • tst_qlibrary - unknown status
16
672# endif-
673#endif-
674-
675}-
676-
677typedef const char * (*QtPluginQueryVerificationDataFunction)();-
678-
679static bool qt_get_metadata(QtPluginQueryVerificationDataFunction pfn, QLibraryPrivate *priv)-
680{-
681 const char *szData = 0;-
682 if (!pfn)
!pfnDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QPluginLoader
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QPluginLoader
2
683 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_QPluginLoader
2
684-
685 szData = pfn();-
686 if (!szData)
!szDataDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QPluginLoader
0-2
687 return false;
never executed: return false;
0
688-
689 QJsonDocument doc = qJsonFromRawLibraryMetaData(szData);-
690 if (doc.isNull())
doc.isNull()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QPluginLoader
0-2
691 return false;
never executed: return false;
0
692 priv->metaData = doc.object();-
693 return true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_QPluginLoader
2
694}-
695-
696bool QLibraryPrivate::isPlugin()-
697{-
698 if (pluginState == MightBeAPlugin)
pluginState == MightBeAPluginDescription
TRUEevaluated 1377 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 66 times by 17 tests
Evaluated by:
  • tst_QBrush
  • tst_QDataStream
  • tst_QFactoryLoader
  • tst_QGuiVariant
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QPainter
  • tst_QPixmap
  • tst_QPlugin
  • tst_QPluginLoader
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextEdit
66-1377
699 updatePluginState();
executed 1377 times by 111 tests: updatePluginState();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
1377
700-
701 return pluginState == IsAPlugin;
executed 1443 times by 113 tests: return pluginState == IsAPlugin;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
1443
702}-
703-
704void QLibraryPrivate::updatePluginState()-
705{-
706 errorString.clear();-
707 if (pluginState != MightBeAPlugin)
pluginState != MightBeAPluginDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QPluginLoader
FALSEevaluated 1400 times by 113 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
2-1400
708 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_QPluginLoader
2
709-
710 bool success = false;-
711-
712#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)-
713 if (fileName.endsWith(QLatin1String(".debug"))) {
fileName.endsW...ing(".debug"))Description
TRUEnever evaluated
FALSEevaluated 1400 times by 113 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-1400
714 // refuse to load a file that ends in .debug-
715 // these are the debug symbols from the libraries-
716 // the problem is that they are valid shared library files-
717 // and dlopen is known to crash while opening them-
718-
719 // pretend we didn't see the file-
720 errorString = QLibrary::tr("The shared library was not found.");-
721 pluginState = IsNotAPlugin;-
722 return;
never executed: return;
0
723 }-
724#endif-
725-
726 if (!pHnd) {
!pHndDescription
TRUEevaluated 1396 times by 113 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QPluginLoader
4-1396
727 // scan for the plugin metadata without loading-
728 success = findPatternUnloaded(fileName, this);-
729 } else {
executed 1396 times by 113 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
1396
730 // library is already loaded (probably via QLibrary)-
731 // simply get the target function and call it.-
732 QtPluginQueryVerificationDataFunction getMetaData = NULL;-
733 getMetaData = (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_metadata");-
734 success = qt_get_metadata(getMetaData, this);-
735 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QPluginLoader
4
736-
737 if (!success) {
!successDescription
TRUEevaluated 722 times by 112 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 678 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
678-722
738 if (errorString.isEmpty()){
errorString.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 722 times by 112 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-722
739 if (fileName.isEmpty())
fileName.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
740 errorString = QLibrary::tr("The shared library was not found.");
never executed: errorString = QLibrary::tr("The shared library was not found.");
0
741 else-
742 errorString = QLibrary::tr("The file '%1' is not a valid Qt plugin.").arg(fileName);
never executed: errorString = QLibrary::tr("The file '%1' is not a valid Qt plugin.").arg(fileName);
0
743 }-
744 pluginState = IsNotAPlugin;-
745 return;
executed 722 times by 112 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
722
746 }-
747-
748 pluginState = IsNotAPlugin; // be pessimistic-
749-
750 uint qt_version = (uint)metaData.value(QLatin1String("version")).toDouble();-
751 bool debug = metaData.value(QLatin1String("debug")).toBool();-
752 if ((qt_version & 0x00ff00) > (QT_VERSION & 0x00ff00) || (qt_version & 0xff0000) != (QT_VERSION & 0xff0000)) {
(qt_version & ...)) & 0x00ff00)Description
TRUEnever evaluated
FALSEevaluated 678 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
(qt_version & ...)) & 0xff0000)Description
TRUEnever evaluated
FALSEevaluated 678 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-678
753 if (qt_debug_component()) {
qt_debug_component()Description
TRUEnever evaluated
FALSEnever evaluated
0
754 qWarning("In %s:\n"-
755 " Plugin uses incompatible Qt library (%d.%d.%d) [%s]",-
756 (const char*) QFile::encodeName(fileName),-
757 (qt_version&0xff0000) >> 16, (qt_version&0xff00) >> 8, qt_version&0xff,-
758 debug ? "debug" : "release");-
759 }
never executed: end of block
0
760 errorString = QLibrary::tr("The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5]")-
761 .arg(fileName)-
762 .arg((qt_version&0xff0000) >> 16)-
763 .arg((qt_version&0xff00) >> 8)-
764 .arg(qt_version&0xff)-
765 .arg(debug ? QLatin1String("debug") : QLatin1String("release"));-
766#ifndef QT_NO_DEBUG_PLUGIN_CHECK-
767 } else if(debug != QLIBRARY_AS_DEBUG) {-
768 //don't issue a qWarning since we will hopefully find a non-debug? --Sam-
769 errorString = QLibrary::tr("The plugin '%1' uses incompatible Qt library."-
770 " (Cannot mix debug and release libraries.)").arg(fileName);-
771#endif-
772 } else {
never executed: end of block
0
773 pluginState = IsAPlugin;-
774 }
executed 678 times by 111 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
678
775}-
776-
777/*!-
778 Loads the library and returns \c true if the library was loaded-
779 successfully; otherwise returns \c false. Since resolve() always-
780 calls this function before resolving any symbols it is not-
781 necessary to call it explicitly. In some situations you might want-
782 the library loaded in advance, in which case you would use this-
783 function.-
784-
785 \sa unload()-
786*/-
787bool QLibrary::load()-
788{-
789 if (!d)
!dDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLibrary
FALSEevaluated 124 times by 42 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
1-124
790 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QLibrary
1
791 if (did_load)
did_loadDescription
TRUEnever evaluated
FALSEevaluated 124 times by 42 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
0-124
792 return d->pHnd;
never executed: return d->pHnd;
0
793 did_load = true;-
794 return d->load();
executed 124 times by 42 tests: return d->load();
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
124
795}-
796-
797/*!-
798 Unloads the library and returns \c true if the library could be-
799 unloaded; otherwise returns \c false.-
800-
801 This happens automatically on application termination, so you-
802 shouldn't normally need to call this function.-
803-
804 If other instances of QLibrary are using the same library, the-
805 call will fail, and unloading will only happen when every instance-
806 has called unload().-
807-
808 Note that on Mac OS X 10.3 (Panther), dynamic libraries cannot be unloaded.-
809-
810 \sa resolve(), load()-
811*/-
812bool QLibrary::unload()-
813{-
814 if (did_load) {
did_loadDescription
TRUEevaluated 26 times by 3 tests
Evaluated by:
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_qlibrary - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLibrary
1-26
815 did_load = false;-
816 return d->unload();
executed 26 times by 3 tests: return d->unload();
Executed by:
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_qlibrary - unknown status
26
817 }-
818 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QLibrary
1
819}-
820-
821/*!-
822 Returns \c true if the library is loaded; otherwise returns \c false.-
823-
824 \sa load()-
825 */-
826bool QLibrary::isLoaded() const-
827{-
828 return d && d->pHnd;
executed 3256 times by 42 tests: return d && d->pHnd;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
3256
829}-
830-
831-
832/*!-
833 Constructs a library with the given \a parent.-
834 */-
835QLibrary::QLibrary(QObject *parent)-
836 :QObject(parent), d(0), did_load(false)-
837{-
838}
executed 68 times by 32 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • tst_QSslError
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • ...
68
839-
840-
841/*!-
842 Constructs a library object with the given \a parent that will-
843 load the library specified by \a fileName.-
844-
845 We recommend omitting the file's suffix in \a fileName, since-
846 QLibrary will automatically look for the file with the appropriate-
847 suffix in accordance with the platform, e.g. ".so" on Unix,-
848 ".dylib" on \macos and iOS, and ".dll" on Windows. (See \l{fileName}.)-
849 */-
850QLibrary::QLibrary(const QString& fileName, QObject *parent)-
851 :QObject(parent), d(0), did_load(false)-
852{-
853 setFileName(fileName);-
854}
executed 38 times by 3 tests: end of block
Executed by:
  • tst_QLibrary
  • tst_QPluginLoader
  • tst_qlibrary - unknown status
38
855-
856-
857/*!-
858 Constructs a library object with the given \a parent that will-
859 load the library specified by \a fileName and major version number \a verNum.-
860 Currently, the version number is ignored on Windows.-
861-
862 We recommend omitting the file's suffix in \a fileName, since-
863 QLibrary will automatically look for the file with the appropriate-
864 suffix in accordance with the platform, e.g. ".so" on Unix,-
865 ".dylib" on \macos and iOS, and ".dll" on Windows. (See \l{fileName}.)-
866*/-
867QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)-
868 :QObject(parent), d(0), did_load(false)-
869{-
870 setFileNameAndVersion(fileName, verNum);-
871}
executed 47 times by 10 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_QLabel
  • tst_QLibrary
  • tst_QTextBoundaryFinder
  • tst_QTextLayout
  • tst_qapplication - unknown status
  • tst_qlibrary - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
47
872-
873/*!-
874 Constructs a library object with the given \a parent that will-
875 load the library specified by \a fileName and full version number \a version.-
876 Currently, the version number is ignored on Windows.-
877-
878 We recommend omitting the file's suffix in \a fileName, since-
879 QLibrary will automatically look for the file with the appropriate-
880 suffix in accordance with the platform, e.g. ".so" on Unix,-
881 ".dylib" on \macos and iOS, and ".dll" on Windows. (See \l{fileName}.)-
882 */-
883QLibrary::QLibrary(const QString& fileName, const QString &version, QObject *parent)-
884 :QObject(parent), d(0), did_load(false)-
885{-
886 setFileNameAndVersion(fileName, version);-
887}
never executed: end of block
0
888-
889/*!-
890 Destroys the QLibrary object.-
891-
892 Unless unload() was called explicitly, the library stays in memory-
893 until the application terminates.-
894-
895 \sa isLoaded(), unload()-
896*/-
897QLibrary::~QLibrary()-
898{-
899 if (d)
dDescription
TRUEevaluated 149 times by 42 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QLibrary
4-149
900 d->release();
executed 149 times by 42 tests: d->release();
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
149
901}
executed 153 times by 42 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
153
902-
903-
904/*!-
905 \property QLibrary::fileName-
906 \brief the file name of the library-
907-
908 We recommend omitting the file's suffix in the file name, since-
909 QLibrary will automatically look for the file with the appropriate-
910 suffix (see isLibrary()).-
911-
912 When loading the library, QLibrary searches in all system-specific-
913 library locations (for example, \c LD_LIBRARY_PATH on Unix), unless the-
914 file name has an absolute path. After loading the library-
915 successfully, fileName() returns the fully-qualified file name of-
916 the library, including the full path to the library if one was given-
917 in the constructor or passed to setFileName().-
918-
919 For example, after successfully loading the "GL" library on Unix-
920 platforms, fileName() will return "libGL.so". If the file name was-
921 originally passed as "/usr/lib/libGL", fileName() will return-
922 "/usr/lib/libGL.so".-
923*/-
924-
925void QLibrary::setFileName(const QString &fileName)-
926{-
927 QLibrary::LoadHints lh;-
928 if (d) {
dDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLibrary
FALSEevaluated 67 times by 28 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTextStream
  • ...
3-67
929 lh = d->loadHints();-
930 d->release();-
931 d = 0;-
932 did_load = false;-
933 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QLibrary
3
934 d = QLibraryPrivate::findOrCreate(fileName, QString(), lh);-
935}
executed 70 times by 28 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTextStream
  • ...
70
936-
937QString QLibrary::fileName() const-
938{-
939 if (d)
dDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QLibrary
FALSEnever evaluated
0-1
940 return d->qualifiedFileName.isEmpty() ? d->fileName : d->qualifiedFileName;
executed 1 time by 1 test: return d->qualifiedFileName.isEmpty() ? d->fileName : d->qualifiedFileName;
Executed by:
  • tst_QLibrary
1
941 return QString();
never executed: return QString();
0
942}-
943-
944/*!-
945 \fn void QLibrary::setFileNameAndVersion(const QString &fileName, int versionNumber)-
946-
947 Sets the fileName property and major version number to \a fileName-
948 and \a versionNumber respectively.-
949 The \a versionNumber is ignored on Windows.-
950-
951 \sa setFileName()-
952*/-
953void QLibrary::setFileNameAndVersion(const QString &fileName, int verNum)-
954{-
955 QLibrary::LoadHints lh;-
956 if (d) {
dDescription
TRUEnever evaluated
FALSEevaluated 47 times by 10 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_QLabel
  • tst_QLibrary
  • tst_QTextBoundaryFinder
  • tst_QTextLayout
  • tst_qapplication - unknown status
  • tst_qlibrary - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
0-47
957 lh = d->loadHints();-
958 d->release();-
959 d = 0;-
960 did_load = false;-
961 }
never executed: end of block
0
962 d = QLibraryPrivate::findOrCreate(fileName, verNum >= 0 ? QString::number(verNum) : QString(), lh);-
963}
executed 47 times by 10 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_QLabel
  • tst_QLibrary
  • tst_QTextBoundaryFinder
  • tst_QTextLayout
  • tst_qapplication - unknown status
  • tst_qlibrary - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
47
964-
965/*!-
966 \since 4.4-
967-
968 Sets the fileName property and full version number to \a fileName-
969 and \a version respectively.-
970 The \a version parameter is ignored on Windows.-
971-
972 \sa setFileName()-
973*/-
974void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &version)-
975{-
976 QLibrary::LoadHints lh;-
977 if (d) {
dDescription
TRUEnever evaluated
FALSEevaluated 32 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • tst_QSslError
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QXmlInputSource
  • tst_Spdy
0-32
978 lh = d->loadHints();-
979 d->release();-
980 d = 0;-
981 did_load = false;-
982 }
never executed: end of block
0
983 d = QLibraryPrivate::findOrCreate(fileName, version, lh);-
984}
executed 32 times by 16 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • tst_QSslError
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QXmlInputSource
  • tst_Spdy
32
985-
986/*!-
987 Returns the address of the exported symbol \a symbol. The library is-
988 loaded if necessary. The function returns 0 if the symbol could-
989 not be resolved or if the library could not be loaded.-
990-
991 Example:-
992 \snippet code/src_corelib_plugin_qlibrary.cpp 2-
993-
994 The symbol must be exported as a C function from the library. This-
995 means that the function must be wrapped in an \c{extern "C"} if-
996 the library is compiled with a C++ compiler. On Windows you must-
997 also explicitly export the function from the DLL using the-
998 \c{__declspec(dllexport)} compiler directive, for example:-
999-
1000 \snippet code/src_corelib_plugin_qlibrary.cpp 3-
1001-
1002 with \c MY_EXPORT defined as-
1003-
1004 \snippet code/src_corelib_plugin_qlibrary.cpp 4-
1005*/-
1006QFunctionPointer QLibrary::resolve(const char *symbol)-
1007{-
1008 if (!isLoaded() && !load())
!isLoaded()Description
TRUEevaluated 7 times by 4 tests
Evaluated by:
  • tst_QLabel
  • tst_QTextBoundaryFinder
  • tst_QTextLayout
  • tst_qlibrary - unknown status
FALSEevaluated 3209 times by 41 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
!load()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlibrary - unknown status
FALSEevaluated 6 times by 4 tests
Evaluated by:
  • tst_QLabel
  • tst_QTextBoundaryFinder
  • tst_QTextLayout
  • tst_qlibrary - unknown status
1-3209
1009 return 0;
executed 1 time by 1 test: return 0;
Executed by:
  • tst_qlibrary - unknown status
1
1010 return d->resolve(symbol);
executed 3215 times by 42 tests: return d->resolve(symbol);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup
  • tst_QDnsLookup_Appless
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLabel
  • tst_QLibrary
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QObject
  • tst_QPluginLoader
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslEllipticCurve
  • ...
3215
1011}-
1012-
1013/*!-
1014 \overload-
1015-
1016 Loads the library \a fileName and returns the address of the-
1017 exported symbol \a symbol. Note that \a fileName should not-
1018 include the platform-specific file suffix; (see \l{fileName}). The-
1019 library remains loaded until the application exits.-
1020-
1021 The function returns 0 if the symbol could not be resolved or if-
1022 the library could not be loaded.-
1023-
1024 \sa resolve()-
1025*/-
1026QFunctionPointer QLibrary::resolve(const QString &fileName, const char *symbol)-
1027{-
1028 QLibrary library(fileName);-
1029 return library.resolve(symbol);
never executed: return library.resolve(symbol);
0
1030}-
1031-
1032/*!-
1033 \overload-
1034-
1035 Loads the library \a fileName with major version number \a verNum and-
1036 returns the address of the exported symbol \a symbol.-
1037 Note that \a fileName should not include the platform-specific file suffix;-
1038 (see \l{fileName}). The library remains loaded until the application exits.-
1039 \a verNum is ignored on Windows.-
1040-
1041 The function returns 0 if the symbol could not be resolved or if-
1042 the library could not be loaded.-
1043-
1044 \sa resolve()-
1045*/-
1046QFunctionPointer QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)-
1047{-
1048 QLibrary library(fileName, verNum);-
1049 return library.resolve(symbol);
executed 11 times by 3 tests: return library.resolve(symbol);
Executed by:
  • tst_QLabel
  • tst_QTextBoundaryFinder
  • tst_QTextLayout
11
1050}-
1051-
1052/*!-
1053 \overload-
1054 \since 4.4-
1055-
1056 Loads the library \a fileName with full version number \a version and-
1057 returns the address of the exported symbol \a symbol.-
1058 Note that \a fileName should not include the platform-specific file suffix;-
1059 (see \l{fileName}). The library remains loaded until the application exits.-
1060 \a version is ignored on Windows.-
1061-
1062 The function returns 0 if the symbol could not be resolved or if-
1063 the library could not be loaded.-
1064-
1065 \sa resolve()-
1066*/-
1067QFunctionPointer QLibrary::resolve(const QString &fileName, const QString &version, const char *symbol)-
1068{-
1069 QLibrary library(fileName, version);-
1070 return library.resolve(symbol);
never executed: return library.resolve(symbol);
0
1071}-
1072-
1073/*!-
1074 \since 4.2-
1075-
1076 Returns a text string with the description of the last error that occurred.-
1077 Currently, errorString will only be set if load(), unload() or resolve() for some reason fails.-
1078*/-
1079QString QLibrary::errorString() const-
1080{-
1081 return (!d || d->errorString.isEmpty()) ? tr("Unknown error") : d->errorString;
executed 21 times by 2 tests: return (!d || d->errorString.isEmpty()) ? tr("Unknown error") : d->errorString;
Executed by:
  • tst_QLibrary
  • tst_qlibrary - unknown status
21
1082}-
1083-
1084/*!-
1085 \property QLibrary::loadHints-
1086 \brief Give the load() function some hints on how it should behave.-
1087-
1088 You can give some hints on how the symbols are resolved. Usually,-
1089 the symbols are not resolved at load time, but resolved lazily,-
1090 (that is, when resolve() is called). If you set the loadHints to-
1091 ResolveAllSymbolsHint, then all symbols will be resolved at load time-
1092 if the platform supports it.-
1093-
1094 Setting ExportExternalSymbolsHint will make the external symbols in the-
1095 library available for resolution in subsequent loaded libraries.-
1096-
1097 If LoadArchiveMemberHint is set, the file name-
1098 is composed of two components: A path which is a reference to an-
1099 archive file followed by the second component which is the reference to-
1100 the archive member. For instance, the fileName \c libGL.a(shr_64.o) will refer-
1101 to the library \c shr_64.o in the archive file named \c libGL.a. This-
1102 is only supported on the AIX platform.-
1103-
1104 The interpretation of the load hints is platform dependent, and if-
1105 you use it you are probably making some assumptions on which platform-
1106 you are compiling for, so use them only if you understand the consequences-
1107 of them.-
1108-
1109 By default, none of these flags are set, so libraries will be loaded with-
1110 lazy symbol resolution, and will not export external symbols for resolution-
1111 in other dynamically-loaded libraries.-
1112-
1113 \note Setting this property after the library has been loaded has no effect-
1114 and loadHints() will not reflect those changes.-
1115-
1116 \note This property is shared among all QLibrary instances that refer to-
1117 the same library.-
1118*/-
1119void QLibrary::setLoadHints(LoadHints hints)-
1120{-
1121 if (!d) {
!dDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLibrary
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QLibrary
3
1122 d = QLibraryPrivate::findOrCreate(QString()); // ugly, but we need a d-ptr-
1123 d->errorString.clear();-
1124 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QLibrary
3
1125 d->setLoadHints(hints);-
1126}
executed 6 times by 1 test: end of block
Executed by:
  • tst_QLibrary
6
1127-
1128QLibrary::LoadHints QLibrary::loadHints() const-
1129{-
1130 return d ? d->loadHints() : QLibrary::LoadHints();
executed 15 times by 1 test: return d ? d->loadHints() : QLibrary::LoadHints();
Executed by:
  • tst_QLibrary
15
1131}-
1132-
1133/* Internal, for debugging */-
1134bool qt_debug_component()-
1135{-
1136 static int debug_env = QT_PREPEND_NAMESPACE(qEnvironmentVariableIntValue)("QT_DEBUG_PLUGINS");-
1137 return debug_env != 0;
executed 7191 times by 411 tests: return debug_env != 0;
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDnsLookup
  • ...
7191
1138}-
1139-
1140QT_END_NAMESPACE-
1141-
1142#endif // QT_NO_LIBRARY-
Source codeSwitch to Preprocessed file

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