OpenCoverage

qqmldebugservice.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/debugger/qqmldebugservice.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5class QQmlDebugServer;-
6-
7class QQmlDebugServicePrivate : public QObjectPrivate-
8{-
9 inline QQmlDebugService* q_func() { return static_cast<QQmlDebugService *>(q_ptr); } inline const QQmlDebugService* q_func() const { return static_cast<const QQmlDebugService *>(q_ptr); } friend class QQmlDebugService;-
10public:-
11 QQmlDebugServicePrivate(const QString &name, float version);-
12-
13 const QString name;-
14 const float version;-
15 QQmlDebugService::State state;-
16};-
17-
18QQmlDebugServicePrivate::QQmlDebugServicePrivate(const QString &name, float version) :-
19 name(name), version(version), state(QQmlDebugService::NotConnected)-
20{-
21}
executed 158 times by 7 tests: end of block
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
158
22-
23QQmlDebugService::QQmlDebugService(const QString &name, float version, QObject *parent)-
24 : QObject(*(new QQmlDebugServicePrivate(name, version)), parent)-
25{-
26 QQmlDebugServicePrivate * const d = d_func();-
27 QQmlDebugConnector *server = QQmlDebugConnector::instance();-
28-
29 if (!server
!serverDescription
TRUEnever evaluated
FALSEevaluated 158 times by 7 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
)
0-158
30 return;
never executed: return;
0
31-
32 if (server->service(d->name)
server->service(d->name)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmldebugservice
FALSEevaluated 154 times by 7 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
) {
4-154
33 QMessageLogger(__FILE__, 79, __PRETTY_FUNCTION__).warning() << "QQmlDebugService: Conflicting plugin name" << d->name;-
34 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmldebugservice
else {
4
35 server->addService(d->name, this);-
36 }
executed 154 times by 7 tests: end of block
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
154
37}-
38-
39QQmlDebugService::~QQmlDebugService()-
40{-
41 QQmlDebugServicePrivate * const d = d_func();-
42 QQmlDebugConnector *server = QQmlDebugConnector::instance();-
43-
44 if (!server
!serverDescription
TRUEnever evaluated
FALSEevaluated 152 times by 6 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
)
0-152
45 return;
never executed: return;
0
46-
47 if (server->service(d->name) != this
server->servic...>name) != thisDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmldebugservice
FALSEevaluated 148 times by 5 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
)
4-148
48 QMessageLogger(__FILE__, 94, __PRETTY_FUNCTION__).warning() << "QQmlDebugService: Plugin" << d->name << "is not registered.";
executed 4 times by 1 test: QMessageLogger(__FILE__, 94, __PRETTY_FUNCTION__).warning() << "QQmlDebugService: Plugin" << d->name << "is not registered.";
Executed by:
  • tst_qqmldebugservice
4
49 else-
50 server->removeService(d->name);
executed 148 times by 5 tests: server->removeService(d->name);
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
148
51}-
52-
53const QString &QQmlDebugService::name() const-
54{-
55 const QQmlDebugServicePrivate * const d = d_func();-
56 return
executed 732 times by 7 tests: return d->name;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
d->name;
executed 732 times by 7 tests: return d->name;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
732
57}-
58-
59float QQmlDebugService::version() const-
60{-
61 const QQmlDebugServicePrivate * const d = d_func();-
62 return
executed 158 times by 6 tests: return d->version;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
d->version;
executed 158 times by 6 tests: return d->version;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
158
63}-
64-
65QQmlDebugService::State QQmlDebugService::state() const-
66{-
67 const QQmlDebugServicePrivate * const d = d_func();-
68 return
executed 836 times by 7 tests: return d->state;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
d->state;
executed 836 times by 7 tests: return d->state;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
836
69}-
70-
71void QQmlDebugService::setState(QQmlDebugService::State newState)-
72{-
73 QQmlDebugServicePrivate * const d = d_func();-
74 d->state = newState;-
75}
executed 688 times by 7 tests: end of block
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
688
76-
77namespace {-
78class ObjectReferenceHash : public QObject-
79{-
80 public:-
81#pragma GCC diagnostic push-
82 -
83#pragma GCC diagnostic ignored "-Wsuggest-override"-
84 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
85#pragma GCC diagnostic ignored "-Wattributes"-
86 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
87#pragma GCC diagnostic pop-
88 struct QPrivateSignal {};-
89public:-
90 ObjectReferenceHash() : nextId(0) {}
executed 28 times by 5 tests: end of block
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
28
91-
92 QHash<QObject *, int> objects;-
93 QHash<int, QObject *> ids;-
94-
95 int nextId;-
96-
97 void remove(QObject *obj);-
98};-
99}-
100namespace { namespace Q_QGS_objectReferenceHash { typedef ObjectReferenceHash Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 28 times by 5 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 28 times by 5 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
}
executed 28 times by 5 tests: end of block
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 6804 times by 5 tests: return &holder.value;
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
&holder.value;
executed 6804 times by 5 tests: return &holder.value;
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
} } } static QGlobalStatic<ObjectReferenceHash, Q_QGS_objectReferenceHash::innerFunction, Q_QGS_objectReferenceHash::guard> objectReferenceHash;
0-6804
101-
102void ObjectReferenceHash::remove(QObject *obj)-
103{-
104 QHash<QObject *, int>::Iterator iter = objects.find(obj);-
105 if (iter != objects.end()
iter != objects.end()Description
TRUEevaluated 106 times by 5 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
FALSEnever evaluated
) {
0-106
106 ids.remove(iter.value());-
107 objects.erase(iter);-
108 }
executed 106 times by 5 tests: end of block
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
106
109}
executed 106 times by 5 tests: end of block
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
106
110-
111-
112-
113-
114-
115int QQmlDebugService::idForObject(QObject *object)-
116{-
117 if (!object
!objectDescription
TRUEevaluated 840 times by 3 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
FALSEevaluated 6436 times by 5 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
)
840-6436
118 return
executed 840 times by 3 tests: return -1;
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
-1;
executed 840 times by 3 tests: return -1;
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
840
119-
120 ObjectReferenceHash *hash = objectReferenceHash();-
121 QHash<QObject *, int>::Iterator iter = hash->objects.find(object);-
122-
123 if (iter == hash->objects.end()
iter == hash->objects.end()Description
TRUEevaluated 124 times by 5 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
FALSEevaluated 6312 times by 4 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
) {
124-6312
124 int id = hash->nextId++;-
125 hash->ids.insert(id, object);-
126 iter = hash->objects.insert(object, id);-
127 connect(object, &QObject::destroyed, hash, &ObjectReferenceHash::remove);-
128 }
executed 124 times by 5 tests: end of block
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
124
129 return
executed 6436 times by 5 tests: return iter.value();
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
iter.value();
executed 6436 times by 5 tests: return iter.value();
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
6436
130}-
131-
132-
133-
134-
135const QHash<int, QObject *> &QQmlDebugService::objectsForIds()-
136{-
137 return
executed 368 times by 4 tests: return objectReferenceHash()->ids;
Executed by:
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
objectReferenceHash()->ids;
executed 368 times by 4 tests: return objectReferenceHash()->ids;
Executed by:
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlprofilerservice
  • tst_qv4debugger
368
138}-
139-
140-
141-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0