OpenCoverage

qdbuspendingcall.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbuspendingcall.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 QtDBus module of the Qt Toolkit.-
8**-
9** $QT_BEGIN_LICENSE:LGPL$-
10** Commercial License Usage-
11** Licensees holding valid commercial Qt licenses may use this file in-
12** accordance with the commercial license agreement provided with the-
13** Software or, alternatively, in accordance with the terms contained in-
14** a written agreement between you and The Qt Company. For licensing terms-
15** and conditions see https://www.qt.io/terms-conditions. For further-
16** information use the contact form at https://www.qt.io/contact-us.-
17**-
18** GNU Lesser General Public License Usage-
19** Alternatively, this file may be used under the terms of the GNU Lesser-
20** General Public License version 3 as published by the Free Software-
21** Foundation and appearing in the file LICENSE.LGPL3 included in the-
22** packaging of this file. Please review the following information to-
23** ensure the GNU Lesser General Public License version 3 requirements-
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
25**-
26** GNU General Public License Usage-
27** Alternatively, this file may be used under the terms of the GNU-
28** General Public License version 2.0 or (at your option) the GNU General-
29** Public license version 3 or any later version approved by the KDE Free-
30** Qt Foundation. The licenses are as published by the Free Software-
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
32** included in the packaging of this file. Please review the following-
33** information to ensure the GNU General Public License requirements will-
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
35** https://www.gnu.org/licenses/gpl-3.0.html.-
36**-
37** $QT_END_LICENSE$-
38**-
39****************************************************************************/-
40-
41#include "qdbuspendingcall.h"-
42#include "qdbuspendingcall_p.h"-
43-
44#include "qdbusconnection_p.h"-
45#include "qdbusmetatype_p.h"-
46#include "qdbusutil_p.h"-
47#include "qcoreapplication.h"-
48#include "qcoreevent.h"-
49#include <private/qobject_p.h>-
50-
51#ifndef QT_NO_DBUS-
52-
53QT_BEGIN_NAMESPACE-
54-
55/*!-
56 \class QDBusPendingCall-
57 \inmodule QtDBus-
58 \ingroup shared-
59 \since 4.5-
60-
61 \brief The QDBusPendingCall class refers to one pending asynchronous call-
62-
63 A QDBusPendingCall object is a reference to a method call that was-
64 sent over D-Bus without waiting for a reply. QDBusPendingCall is an-
65 opaque type, meant to be used as a handle for a pending reply.-
66-
67 In most programs, the QDBusPendingCall class will not be used-
68 directly. It can be safely replaced with the template-based-
69 QDBusPendingReply, in order to access the contents of the reply or-
70 wait for it to be complete.-
71-
72 The QDBusPendingCallWatcher class allows one to connect to a signal-
73 that will indicate when the reply has arrived or if the call has-
74 timed out. It also provides the-
75 QDBusPendingCallWatcher::waitForFinished() method which will suspend-
76 the execution of the program until the reply has arrived.-
77-
78 \note If you create a copy of a QDBusPendingCall object, all-
79 information will be shared among the many copies. Therefore,-
80 QDBusPendingCall is an explicitly-shared object and does not-
81 provide a method of detaching the copies (since they refer-
82 to the same pending call)-
83-
84 \sa QDBusPendingReply, QDBusPendingCallWatcher,-
85 QDBusAbstractInterface::asyncCall()-
86*/-
87-
88/*!-
89 \class QDBusPendingCallWatcher-
90 \inmodule QtDBus-
91 \since 4.5-
92-
93 \brief The QDBusPendingCallWatcher class provides a convenient way for-
94 waiting for asynchronous replies-
95-
96 The QDBusPendingCallWatcher provides the finished() signal that will be-
97 emitted when a reply arrives.-
98-
99 It is usually used like the following example:-
100-
101 \snippet code/src_qdbus_qdbuspendingcall.cpp 0-
102-
103 Note that it is not necessary to keep the original QDBusPendingCall-
104 object around since QDBusPendingCallWatcher inherits from that class-
105 too.-
106-
107 The slot connected to by the above code could be something similar-
108 to the following:-
109-
110 \snippet code/src_qdbus_qdbuspendingcall.cpp 1-
111-
112 Note the use of QDBusPendingReply to validate the argument types in-
113 the reply. If the reply did not contain exactly two arguments-
114 (one string and one QByteArray), QDBusPendingReply::isError() will-
115 return true.-
116-
117 \sa QDBusPendingReply, QDBusAbstractInterface::asyncCall()-
118*/-
119-
120/*!-
121 \fn void QDBusPendingCallWatcher::finished(QDBusPendingCallWatcher *self)-
122-
123 This signal is emitted when the pending call has finished and its-
124 reply is available. The \a self parameter is a pointer to the-
125 object itself, passed for convenience so that the slot can access-
126 the properties and determine the contents of the reply.-
127*/-
128-
129void QDBusPendingCallWatcherHelper::add(QDBusPendingCallWatcher *watcher)-
130{-
131 connect(this, SIGNAL(finished()), watcher, SLOT(_q_finished()), Qt::QueuedConnection);-
132}
executed 45 times by 18 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
45
133-
134QDBusPendingCallPrivate::~QDBusPendingCallPrivate()-
135{-
136 if (pending) {
pendingDescription
TRUEnever evaluated
FALSEevaluated 2797 times by 158 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
0-2797
137 q_dbus_pending_call_cancel(pending);-
138 q_dbus_pending_call_unref(pending);-
139 }
never executed: end of block
0
140 delete watcherHelper;-
141}
executed 2797 times by 158 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
2797
142-
143bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *member)-
144{-
145 receiver = target;-
146 metaTypes.clear();-
147 methodIdx = -1;-
148 if (!target)
!targetDescription
TRUEnever evaluated
FALSEevaluated 12 times by 4 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusthreading - unknown status
0-12
149 return true;; // unsetting
never executed: return true;
0
150-
151 if (!member || !*member) {
!memberDescription
TRUEnever evaluated
FALSEevaluated 12 times by 4 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusthreading - unknown status
!*memberDescription
TRUEnever evaluated
FALSEevaluated 12 times by 4 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusthreading - unknown status
0-12
152 // would not be able to deliver a reply-
153 qWarning("QDBusPendingCall::setReplyCallback: error: cannot deliver a reply to %s::%s (%s)",-
154 target ? target->metaObject()->className() : "(null)",-
155 member ? member + 1 : "(null)",-
156 target ? qPrintable(target->objectName()) : "no name");-
157 return false;
never executed: return false;
0
158 }-
159-
160 methodIdx = QDBusConnectionPrivate::findSlot(target, member + 1, metaTypes);-
161 if (methodIdx == -1) {
methodIdx == -1Description
TRUEnever evaluated
FALSEevaluated 12 times by 4 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusthreading - unknown status
0-12
162 QByteArray normalizedName = QMetaObject::normalizedSignature(member + 1);-
163 methodIdx = QDBusConnectionPrivate::findSlot(target, normalizedName, metaTypes);-
164 }
never executed: end of block
0
165 if (methodIdx == -1) {
methodIdx == -1Description
TRUEnever evaluated
FALSEevaluated 12 times by 4 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusthreading - unknown status
0-12
166 // would not be able to deliver a reply-
167 qWarning("QDBusPendingCall::setReplyCallback: error: cannot deliver a reply to %s::%s (%s)",-
168 target->metaObject()->className(),-
169 member + 1, qPrintable(target->objectName()));-
170 return false;
never executed: return false;
0
171 }-
172-
173 // success-
174 // construct the expected signature-
175 int count = metaTypes.count() - 1;-
176 if (count == 1 && metaTypes.at(1) == QDBusMetaTypeId::message()) {
count == 1Description
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
FALSEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbusthreading - unknown status
metaTypes.at(1...eId::message()Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbuspendingcall - unknown status
2-8
177 // wildcard slot, can receive anything, so don't set the signature-
178 return true;
executed 2 times by 2 tests: return true;
Executed by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
2
179 }-
180-
181 if (metaTypes.at(count) == QDBusMetaTypeId::message())
metaTypes.at(c...eId::message()Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusthreading - unknown status
0-10
182 --count;
never executed: --count;
0
183-
184 setMetaTypes(count, count ? metaTypes.constData() + 1 : 0);-
185 return true;
executed 10 times by 4 tests: return true;
Executed by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusthreading - unknown status
10
186}-
187-
188void QDBusPendingCallPrivate::setMetaTypes(int count, const int *types)-
189{-
190 if (count == 0) {
count == 0Description
TRUEevaluated 14 times by 5 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 274 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
14-274
191 expectedReplySignature = QLatin1String(""); // not null-
192 return;
executed 14 times by 5 tests: return;
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusthreading - unknown status
14
193 }-
194-
195 QByteArray sig;-
196 sig.reserve(count + count / 2);-
197 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEevaluated 278 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 274 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
274-278
198 const char *typeSig = QDBusMetaType::typeToSignature(types[i]);-
199 if (Q_UNLIKELY(!typeSig)) {
__builtin_expe...peSig), false)Description
TRUEnever evaluated
FALSEevaluated 278 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
0-278
200 qFatal("QDBusPendingReply: type %s is not registered with QtDBus",-
201 QMetaType::typeName(types[i]));-
202 }
never executed: end of block
0
203 sig += typeSig;-
204 }
executed 278 times by 19 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
278
205-
206 expectedReplySignature = QString::fromLatin1(sig);-
207}
executed 274 times by 19 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
274
208-
209void QDBusPendingCallPrivate::checkReceivedSignature()-
210{-
211 // MUST BE CALLED WITH A LOCKED MUTEX!-
212-
213 if (replyMessage.type() == QDBusMessage::InvalidMessage)
replyMessage.t...InvalidMessageDescription
TRUEevaluated 43 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
FALSEevaluated 2841 times by 158 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
43-2841
214 return; // not yet finished - no message to
executed 43 times by 16 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
43
215 // validate against-
216 if (replyMessage.type() == QDBusMessage::ErrorMessage)
replyMessage.t...::ErrorMessageDescription
TRUEevaluated 416 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QSystemTrayIcon
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuslocalcalls - unknown status
  • ...
FALSEevaluated 2425 times by 158 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
416-2425
217 return; // we don't have to check the signature of an error reply
executed 416 times by 29 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QSystemTrayIcon
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuslocalcalls - unknown status
  • ...
416
218-
219 if (expectedReplySignature.isNull())
expectedReplyS...ature.isNull()Description
TRUEevaluated 2195 times by 158 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
FALSEevaluated 230 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusthreading - unknown status
230-2195
220 return; // no signature to validate against
executed 2195 times by 158 tests: return;
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
2195
221-
222 // can't use startsWith here because a null string doesn't start or end with an empty string-
223 if (replyMessage.signature().indexOf(expectedReplySignature) != 0) {
replyMessage.s...ignature) != 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 221 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusthreading - unknown status
9-221
224 QString errorMsg = QLatin1String("Unexpected reply signature: got \"%1\", "-
225 "expected \"%2\"");-
226 replyMessage = QDBusMessage::createError(-
227 QDBusError::InvalidSignature,-
228 errorMsg.arg(replyMessage.signature(), expectedReplySignature));-
229-
230 }
executed 9 times by 1 test: end of block
Executed by:
  • tst_qdbuspendingreply - unknown status
9
231}
executed 230 times by 22 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusthreading - unknown status
230
232-
233void QDBusPendingCallPrivate::waitForFinished()-
234{-
235 QMutexLocker locker(&mutex);-
236-
237 if (replyMessage.type() != QDBusMessage::InvalidMessage)
replyMessage.t...InvalidMessageDescription
TRUEevaluated 468 times by 34 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenuBar
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QSystemTrayIcon
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • ...
FALSEevaluated 1252 times by 154 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
468-1252
238 return; // already finished
executed 468 times by 34 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QFtp
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QLayout
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenuBar
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QSystemTrayIcon
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • ...
468
239-
240 waitForFinishedCondition.wait(&mutex);-
241}
executed 1252 times by 154 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • ...
1252
242-
243/*!-
244 Creates a copy of the \a other pending asynchronous call. Note-
245 that both objects will refer to the same pending call.-
246*/-
247QDBusPendingCall::QDBusPendingCall(const QDBusPendingCall &other)-
248 : d(other.d)-
249{-
250}
executed 75 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbusreply - unknown status
75
251-
252/*!-
253 \internal-
254*/-
255QDBusPendingCall::QDBusPendingCall(QDBusPendingCallPrivate *dd)-
256 : d(dd)-
257{-
258 if (dd) {
ddDescription
TRUEevaluated 131 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 278 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
131-278
259 bool r = dd->ref.deref();-
260 Q_ASSERT(r);-
261 Q_UNUSED(r);-
262 }
executed 131 times by 23 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
131
263}
executed 409 times by 24 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
409
264-
265/*!-
266 Destroys this copy of the QDBusPendingCall object. If this copy is-
267 also the last copy of a pending asynchronous call, the call will-
268 be canceled and no further notifications will be received. There-
269 will be no way of accessing the reply's contents when it arrives.-
270*/-
271QDBusPendingCall::~QDBusPendingCall()-
272{-
273 // d deleted by QExplicitlySharedDataPointer-
274}-
275-
276-
277/*!-
278 Creates a copy of the \a other pending asynchronous call and drops-
279 the reference to the previously-referenced call. Note that both-
280 objects will refer to the same pending call after this function.-
281-
282 If this object contained the last reference of a pending-
283 asynchronous call, the call will be canceled and no further-
284 notifications will be received. There will be no way of accessing-
285 the reply's contents when it arrives.-
286*/-
287QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other)-
288{-
289 d = other.d;-
290 return *this;
executed 103 times by 18 tests: return *this;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbuspendingreply - unknown status
103
291}-
292-
293/*!-
294 \fn void QDBusPendingCall::swap(QDBusPendingCall &other)-
295 \since 5.0-
296-
297 Swaps this pending call instance with \a other. This function is-
298 very fast and never fails.-
299*/-
300-
301/*!-
302 \fn bool QDBusPendingCallWatcher::isFinished() const-
303-
304 Returns \c true if the pending call has finished processing and the-
305 reply has been received.-
306-
307 Note that this function only changes state if you call-
308 waitForFinished() or if an external D-Bus event happens, which in-
309 general only happens if you return to the event loop execution.-
310-
311 \sa QDBusPendingReply::isFinished()-
312*/-
313/*!-
314 \fn bool QDBusPendingReply::isFinished() const-
315-
316 Returns \c true if the pending call has finished processing and the-
317 reply has been received. If this function returns \c true, the-
318 isError(), error() and reply() methods should return valid-
319 information.-
320-
321 Note that this function only changes state if you call-
322 waitForFinished() or if an external D-Bus event happens, which in-
323 general only happens if you return to the event loop execution.-
324-
325 \sa QDBusPendingCallWatcher::isFinished()-
326*/-
327-
328bool QDBusPendingCall::isFinished() const-
329{-
330 if (!d)
!dDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 66 times by 6 tests
Evaluated by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
2-66
331 return true; // considered finished
executed 2 times by 1 test: return true;
Executed by:
  • tst_qdbuspendingreply - unknown status
2
332-
333 QMutexLocker locker(&d->mutex);-
334 return d->replyMessage.type() != QDBusMessage::InvalidMessage;
executed 66 times by 6 tests: return d->replyMessage.type() != QDBusMessage::InvalidMessage;
Executed by:
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
66
335}-
336-
337void QDBusPendingCall::waitForFinished()-
338{-
339 if (d) d->waitForFinished();
executed 111 times by 22 tests: d->waitForFinished();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
dDescription
TRUEevaluated 111 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
4-111
340}
executed 115 times by 23 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
115
341-
342/*!-
343 \fn bool QDBusPendingReply::isValid() const-
344-
345 Returns \c true if the reply contains a normal reply message, false-
346 if it contains anything else.-
347-
348 If the pending call has not finished processing, this function-
349 return false.-
350*/-
351bool QDBusPendingCall::isValid() const-
352{-
353 if (!d)
!dDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 12 times by 3 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
4-12
354 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qdbuspendingreply - unknown status
4
355 QMutexLocker locker(&d->mutex);-
356 return d->replyMessage.type() == QDBusMessage::ReplyMessage;
executed 12 times by 3 tests: return d->replyMessage.type() == QDBusMessage::ReplyMessage;
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_spyhook - unknown status
12
357}-
358-
359/*!-
360 \fn bool QDBusPendingReply::isError() const-
361-
362 Returns \c true if the reply contains an error message, false if it-
363 contains a normal method reply.-
364-
365 If the pending call has not finished processing, this function-
366 also returns \c true.-
367*/-
368bool QDBusPendingCall::isError() const-
369{-
370 if (!d)
!dDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 208 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
4-208
371 return true; // considered finished and an error
executed 4 times by 1 test: return true;
Executed by:
  • tst_qdbuspendingreply - unknown status
4
372 QMutexLocker locker(&d->mutex);-
373 return d->replyMessage.type() == QDBusMessage::ErrorMessage;
executed 208 times by 22 tests: return d->replyMessage.type() == QDBusMessage::ErrorMessage;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
208
374}-
375-
376/*!-
377 \fn QDBusError QDBusPendingReply::error() const-
378-
379 Retrieves the error content of the reply message, if it has-
380 finished processing. If the reply message has not finished-
381 processing or if it contains a normal reply message (non-error),-
382 this function returns an invalid QDBusError.-
383*/-
384QDBusError QDBusPendingCall::error() const-
385{-
386 if (d) {
dDescription
TRUEevaluated 33 times by 6 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusreply - unknown status
2-33
387 QMutexLocker locker(&d->mutex);-
388 return QDBusError(d->replyMessage);
executed 33 times by 6 tests: return QDBusError(d->replyMessage);
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
33
389 }-
390-
391 // not connected, return an error-
392 QDBusError err = QDBusError(QDBusError::Disconnected,-
393 QDBusUtil::disconnectedErrorMessage());-
394 return err;
executed 2 times by 1 test: return err;
Executed by:
  • tst_qdbusreply - unknown status
2
395}-
396-
397/*!-
398 \fn QDBusMessage QDBusPendingReply::reply() const-
399-
400 Retrieves the reply message received for the asynchronous call-
401 that was sent, if it has finished processing. If the pending call-
402 is not finished, this function returns a QDBusMessage of type-
403 QDBusMessage::InvalidMessage.-
404-
405 After it has finished processing, the message type will either be-
406 an error message or a normal method reply message.-
407*/-
408QDBusMessage QDBusPendingCall::reply() const-
409{-
410 if (!d)
!dDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusreply - unknown status
FALSEevaluated 40 times by 6 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
2-40
411 return QDBusMessage::createError(error());
executed 2 times by 1 test: return QDBusMessage::createError(error());
Executed by:
  • tst_qdbusreply - unknown status
2
412 QMutexLocker locker(&d->mutex);-
413 return d->replyMessage;
executed 40 times by 6 tests: return d->replyMessage;
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuslocalcalls - unknown status
  • tst_qdbuspendingcall - unknown status
40
414}-
415-
416#if 0-
417/*!-
418 Sets the slot \a member in object \a target to be called when the-
419 reply arrives. The slot's parameter list must match the reply-
420 message's arguments for it to be called.-
421-
422 It may, optionally, contain a QDBusMessage final parameter. If it-
423 is present, the parameter will contain the reply message object.-
424-
425 The callback will not be called if the reply is an error message.-
426-
427 This function returns \c true if it could set the callback, false-
428 otherwise. It is not a guarantee that the callback will be-
429 called.-
430-
431 \warning QDBusPendingCall only supports one callback per pending-
432 asynchronous call, even if multiple QDBusPendingCall-
433 objects are referencing the same pending call.-
434*/-
435bool QDBusPendingCall::setReplyCallback(QObject *target, const char *member)-
436{-
437 if (!d)-
438 return false;-
439-
440 return d->setReplyCallback(target, member);-
441}-
442#endif-
443-
444/*!-
445 \since 4.6-
446 Creates a QDBusPendingCall object based on the error condition-
447 \a error. The resulting pending call object will be in the-
448 "finished" state and QDBusPendingReply::isError() will return true.-
449-
450 \sa fromCompletedCall()-
451*/-
452QDBusPendingCall QDBusPendingCall::fromError(const QDBusError &error)-
453{-
454 return fromCompletedCall(QDBusMessage::createError(error));
executed 14 times by 1 test: return fromCompletedCall(QDBusMessage::createError(error));
Executed by:
  • tst_qdbusabstractinterface - unknown status
14
455}-
456-
457/*!-
458 \since 4.6-
459 Creates a QDBusPendingCall object based on the message \a msg.-
460 The message must be of type QDBusMessage::ErrorMessage or-
461 QDBusMessage::ReplyMessage (that is, a message that is typical-
462 of a completed call).-
463-
464 This function is useful for code that requires simulating a pending-
465 call, but that has already finished.-
466-
467 \sa fromError()-
468*/-
469QDBusPendingCall QDBusPendingCall::fromCompletedCall(const QDBusMessage &msg)-
470{-
471 QDBusPendingCallPrivate *d = 0;-
472 if (msg.type() == QDBusMessage::ErrorMessage ||
msg.type() == ...::ErrorMessageDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
FALSEnever evaluated
0-14
473 msg.type() == QDBusMessage::ReplyMessage) {
msg.type() == ...::ReplyMessageDescription
TRUEnever evaluated
FALSEnever evaluated
0
474 d = new QDBusPendingCallPrivate(QDBusMessage(), 0);-
475 d->replyMessage = msg;-
476 d->ref.store(1);-
477 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractinterface - unknown status
14
478-
479 return QDBusPendingCall(d);
executed 14 times by 1 test: return QDBusPendingCall(d);
Executed by:
  • tst_qdbusabstractinterface - unknown status
14
480}-
481-
482-
483class QDBusPendingCallWatcherPrivate: public QObjectPrivate-
484{-
485public:-
486 void _q_finished();-
487-
488 Q_DECLARE_PUBLIC(QDBusPendingCallWatcher)-
489};-
490-
491inline void QDBusPendingCallWatcherPrivate::_q_finished()-
492{-
493 Q_Q(QDBusPendingCallWatcher);-
494 emit q->finished(q);-
495}
executed 9 times by 2 tests: end of block
Executed by:
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
9
496-
497/*!-
498 Creates a QDBusPendingCallWatcher object to watch for replies on the-
499 asynchronous pending call \a call and sets this object's parent-
500 to \a parent.-
501*/-
502QDBusPendingCallWatcher::QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent)-
503 : QObject(*new QDBusPendingCallWatcherPrivate, parent), QDBusPendingCall(call)-
504{-
505 if (d) { // QDBusPendingCall::d
dDescription
TRUEevaluated 45 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
FALSEnever evaluated
0-45
506 QMutexLocker locker(&d->mutex);-
507 if (!d->watcherHelper) {
!d->watcherHelperDescription
TRUEevaluated 45 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
FALSEnever evaluated
0-45
508 d->watcherHelper = new QDBusPendingCallWatcherHelper;-
509 if (d->replyMessage.type() != QDBusMessage::InvalidMessage) {
d->replyMessag...InvalidMessageDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_qdbuspendingcall - unknown status
FALSEevaluated 40 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
5-40
510 // cause a signal emission anyways-
511 QMetaObject::invokeMethod(d->watcherHelper, "finished", Qt::QueuedConnection);-
512 }
executed 5 times by 2 tests: end of block
Executed by:
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_qdbuspendingcall - unknown status
5
513 }
executed 45 times by 18 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
45
514 d->watcherHelper->add(this);-
515 }
executed 45 times by 18 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
45
516}
executed 45 times by 18 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdbusconnection_delayed - unknown status
  • tst_qdbuspendingcall - unknown status
45
517-
518/*!-
519 Destroys this object. If this QDBusPendingCallWatcher object was the-
520 last reference to the unfinished pending call, the call will be-
521 canceled.-
522*/-
523QDBusPendingCallWatcher::~QDBusPendingCallWatcher()-
524{-
525}-
526-
527/*!-
528 \fn void QDBusPendingCallWatcher::waitForFinished()-
529-
530 Suspends the execution of the calling thread until the reply is-
531 received and processed. After this function returns, isFinished()-
532 should return true, indicating the reply's contents are ready to-
533 be processed.-
534-
535 \sa QDBusPendingReply::waitForFinished()-
536*/-
537void QDBusPendingCallWatcher::waitForFinished()-
538{-
539 if (d) {
dDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qdbuspendingcall - unknown status
FALSEnever evaluated
0-5
540 d->waitForFinished();-
541-
542 // our signals were queued, so deliver them-
543 QCoreApplication::sendPostedEvents(d->watcherHelper, QEvent::MetaCall);-
544 QCoreApplication::sendPostedEvents(this, QEvent::MetaCall);-
545 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_qdbuspendingcall - unknown status
5
546}
executed 5 times by 1 test: end of block
Executed by:
  • tst_qdbuspendingcall - unknown status
5
547QT_END_NAMESPACE-
548-
549#endif // QT_NO_DBUS-
550-
551#include "moc_qdbuspendingcall.cpp"-
Source codeSwitch to Preprocessed file

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