OpenCoverage

qdbusservicewatcher.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusservicewatcher.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8class QDBusServiceWatcherPrivate: public QObjectPrivate-
9{-
10 inline QDBusServiceWatcher* q_func() { return static_cast<QDBusServiceWatcher *>(q_ptr); } inline const QDBusServiceWatcher* q_func() const { return static_cast<const QDBusServiceWatcher *>(q_ptr); } friend class QDBusServiceWatcher;-
11public:-
12 QDBusServiceWatcherPrivate(const QDBusConnection &c, QDBusServiceWatcher::WatchMode wm)-
13 : connection(c), watchMode(wm)-
14 {-
15 }
executed 816 times by 155 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
  • ...
816
16-
17 QStringList servicesWatched;-
18 QDBusConnection connection;-
19 QDBusServiceWatcher::WatchMode watchMode;-
20-
21 void _q_serviceOwnerChanged(const QString &, const QString &, const QString &);-
22 void setConnection(const QStringList &services, const QDBusConnection &c, QDBusServiceWatcher::WatchMode watchMode);-
23-
24 void addService(const QString &service);-
25 void removeService(const QString &service);-
26};-
27-
28void QDBusServiceWatcherPrivate::_q_serviceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner)-
29{-
30 QDBusServiceWatcher * const q = q_func();-
31 q->serviceOwnerChanged(service, oldOwner, newOwner);-
32 if (oldOwner.isEmpty()
oldOwner.isEmpty()Description
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusservicewatcher - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
)
5-8
33 q->serviceRegistered(service);
executed 8 times by 3 tests: q->serviceRegistered(service);
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusservicewatcher - unknown status
8
34 else if (newOwner.isEmpty()
newOwner.isEmpty()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
FALSEnever evaluated
)
0-5
35 q->serviceUnregistered(service);
executed 5 times by 1 test: q->serviceUnregistered(service);
Executed by:
  • tst_qdbusservicewatcher - unknown status
5
36}
executed 13 times by 3 tests: end of block
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusservicewatcher - unknown status
13
37-
38void QDBusServiceWatcherPrivate::setConnection(const QStringList &s, const QDBusConnection &c, QDBusServiceWatcher::WatchMode wm)-
39{-
40 if (connection.isConnected()
connection.isConnected()Description
TRUEevaluated 818 times by 155 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 6 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
) {
6-818
41-
42 for (const QString &s : qAsConst(servicesWatched))-
43 removeService(s);
executed 4 times by 1 test: removeService(s);
Executed by:
  • tst_qdbusservicewatcher - unknown status
4
44 }
executed 818 times by 155 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
  • ...
818
45-
46 connection = c;-
47 watchMode = wm;-
48 servicesWatched = s;-
49-
50 if (connection.isConnected()
connection.isConnected()Description
TRUEevaluated 819 times by 155 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 5 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
) {
5-819
51-
52 for (const QString &s : qAsConst(servicesWatched))-
53 addService(s);
executed 819 times by 155 tests: addService(s);
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
  • ...
819
54 }
executed 819 times by 155 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
  • ...
819
55}
executed 824 times by 155 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
  • ...
824
56-
57void QDBusServiceWatcherPrivate::addService(const QString &service)-
58{-
59 QDBusConnectionPrivate *d = QDBusConnectionPrivate::d(connection);-
60 if (d
dDescription
TRUEevaluated 819 times by 155 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 2 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
&& d->shouldWatchService(service)
d->shouldWatchService(service)Description
TRUEevaluated 819 times by 155 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
  • ...
FALSEnever evaluated
)
0-819
61 d->watchService(service, watchMode, q_func(), qFlagLocation("1""_q_serviceOwnerChanged(QString,QString,QString)" "\0" __FILE__ ":" "106"));
executed 819 times by 155 tests: d->watchService(service, watchMode, q_func(), qFlagLocation("1""_q_serviceOwnerChanged(QString,QString,QString)" "\0" __FILE__ ":" "106"));
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
  • ...
819
62}
executed 821 times by 155 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
  • ...
821
63-
64void QDBusServiceWatcherPrivate::removeService(const QString &service)-
65{-
66 QDBusConnectionPrivate *d = QDBusConnectionPrivate::d(connection);-
67 if (d
dDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
FALSEnever evaluated
&& d->shouldWatchService(service)
d->shouldWatchService(service)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
FALSEnever evaluated
)
0-4
68 d->unwatchService(service, watchMode, q_func(), qFlagLocation("1""_q_serviceOwnerChanged(QString,QString,QString)" "\0" __FILE__ ":" "113"));
executed 4 times by 1 test: d->unwatchService(service, watchMode, q_func(), qFlagLocation("1""_q_serviceOwnerChanged(QString,QString,QString)" "\0" __FILE__ ":" "113"));
Executed by:
  • tst_qdbusservicewatcher - unknown status
4
69}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qdbusservicewatcher - unknown status
4
70QDBusServiceWatcher::QDBusServiceWatcher(QObject *parent)-
71 : QObject(*new QDBusServiceWatcherPrivate(QDBusConnection(QString()), WatchForOwnerChange), parent)-
72{-
73}
never executed: end of block
0
74QDBusServiceWatcher::QDBusServiceWatcher(const QString &service, const QDBusConnection &connection, WatchMode watchMode, QObject *parent)-
75 : QObject(*new QDBusServiceWatcherPrivate(connection, watchMode), parent)-
76{-
77 d_func()->setConnection(QStringList() << service, connection, watchMode);-
78}
executed 816 times by 155 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
  • ...
816
79-
80-
81-
82-
83-
84QDBusServiceWatcher::~QDBusServiceWatcher()-
85{-
86}-
87-
88-
89-
90-
91-
92-
93QStringList QDBusServiceWatcher::watchedServices() const-
94{-
95 return
never executed: return d_func()->servicesWatched;
d_func()->servicesWatched;
never executed: return d_func()->servicesWatched;
0
96}-
97void QDBusServiceWatcher::setWatchedServices(const QStringList &services)-
98{-
99 QDBusServiceWatcherPrivate * const d = d_func();-
100 if (services == d->servicesWatched
services == d->servicesWatchedDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
)
0-2
101 return;
never executed: return;
0
102 d->setConnection(services, d->connection, d->watchMode);-
103}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qdbusservicewatcher - unknown status
2
104-
105-
106-
107-
108-
109-
110void QDBusServiceWatcher::addWatchedService(const QString &newService)-
111{-
112 QDBusServiceWatcherPrivate * const d = d_func();-
113 if (d->servicesWatched.contains(newService)
d->servicesWat...ns(newService)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
)
0-2
114 return;
never executed: return;
0
115 d->addService(newService);-
116 d->servicesWatched << newService;-
117}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qdbusservicewatcher - unknown status
2
118bool QDBusServiceWatcher::removeWatchedService(const QString &service)-
119{-
120 QDBusServiceWatcherPrivate * const d = d_func();-
121 d->removeService(service);-
122 return
never executed: return d->servicesWatched.removeOne(service);
d->servicesWatched.removeOne(service);
never executed: return d->servicesWatched.removeOne(service);
0
123}-
124-
125QDBusServiceWatcher::WatchMode QDBusServiceWatcher::watchMode() const-
126{-
127 return
never executed: return d_func()->watchMode;
d_func()->watchMode;
never executed: return d_func()->watchMode;
0
128}-
129-
130void QDBusServiceWatcher::setWatchMode(WatchMode mode)-
131{-
132 QDBusServiceWatcherPrivate * const d = d_func();-
133 if (mode == d->watchMode
mode == d->watchModeDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
)
0-4
134 return;
never executed: return;
0
135 d->setConnection(d->servicesWatched, d->connection, mode);-
136}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qdbusservicewatcher - unknown status
4
137-
138-
139-
140-
141-
142-
143QDBusConnection QDBusServiceWatcher::connection() const-
144{-
145 return
never executed: return d_func()->connection;
d_func()->connection;
never executed: return d_func()->connection;
0
146}-
147void QDBusServiceWatcher::setConnection(const QDBusConnection &connection)-
148{-
149 QDBusServiceWatcherPrivate * const d = d_func();-
150 if (connection.name() == d->connection.name()
connection.nam...nection.name()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusservicewatcher - unknown status
)
0-2
151 return;
never executed: return;
0
152 d->setConnection(d->servicesWatched, connection, d->watchMode);-
153}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qdbusservicewatcher - unknown status
2
154-
155-
156-
157-
158-
Switch to Source codePreprocessed file

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