OpenCoverage

qdnslookup.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/kernel/qdnslookup.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7namespace { namespace Q_QGS_theDnsLookupThreadPool { typedef QDnsLookupThreadPool 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 2 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 2 times by 2 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
}
executed 2 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 101 times by 2 tests: return &holder.value;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
&holder.value;
executed 101 times by 2 tests: return &holder.value;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
} } } static QGlobalStatic<QDnsLookupThreadPool, Q_QGS_theDnsLookupThreadPool::innerFunction, Q_QGS_theDnsLookupThreadPool::guard> theDnsLookupThreadPool;;
0-101
8namespace { namespace Q_QGS_theDnsLookupSeedStorage { typedef QThreadStorage<bool *> 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 2 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 2 times by 2 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
}
executed 2 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 107 times by 2 tests: return &holder.value;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
&holder.value;
executed 107 times by 2 tests: return &holder.value;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
} } } static QGlobalStatic<QThreadStorage<bool *>, Q_QGS_theDnsLookupSeedStorage::innerFunction, Q_QGS_theDnsLookupSeedStorage::guard> theDnsLookupSeedStorage;;
0-107
9-
10static bool qt_qdnsmailexchangerecord_less_than(const QDnsMailExchangeRecord &r1, const QDnsMailExchangeRecord &r2)-
11{-
12-
13 return
executed 6 times by 1 test: return r1.preference() < r2.preference();
Executed by:
  • tst_qdnslookup - unknown status
r1.preference() < r2.preference();
executed 6 times by 1 test: return r1.preference() < r2.preference();
Executed by:
  • tst_qdnslookup - unknown status
6
14}-
15-
16-
17-
18-
19-
20static void qt_qdnsmailexchangerecord_sort(QList<QDnsMailExchangeRecord> &records)-
21{-
22-
23 if (records.size() <= 1
records.size() <= 1Description
TRUEevaluated 80 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
)
4-80
24 return;
executed 80 times by 2 tests: return;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
80
25-
26-
27 std::sort(records.begin(), records.end(), qt_qdnsmailexchangerecord_less_than);-
28-
29 int i = 0;-
30 while (i < records.size()
i < records.size()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
4-6
31-
32-
33 QList<QDnsMailExchangeRecord> slice;-
34 const quint16 slicePreference = records.at(i).preference();-
35 for (int j = i; j < records.size()
j < records.size()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
; ++j) {
4-10
36 if (records.at(j).preference() != slicePreference
records.at(j)....licePreferenceDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
)
2-8
37 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qdnslookup - unknown status
2
38 slice << records.at(j);-
39 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
8
40-
41-
42 while (!slice.isEmpty()
!slice.isEmpty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
6-8
43 const unsigned int pos = qrand() % slice.size();-
44 records[i++] = slice.takeAt(pos);-
45 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
8
46 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
6
47}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
4
48-
49static bool qt_qdnsservicerecord_less_than(const QDnsServiceRecord &r1, const QDnsServiceRecord &r2)-
50{-
51-
52-
53 return
executed 19 times by 1 test: return r1.priority() < r2.priority() || (r1.priority() == r2.priority() && r1.weight() == 0 && r2.weight() > 0);
Executed by:
  • tst_qdnslookup - unknown status
r1.priority() < r2.priority()
executed 19 times by 1 test: return r1.priority() < r2.priority() || (r1.priority() == r2.priority() && r1.weight() == 0 && r2.weight() > 0);
Executed by:
  • tst_qdnslookup - unknown status
19
54 || (r1.priority() == r2.priority()
executed 19 times by 1 test: return r1.priority() < r2.priority() || (r1.priority() == r2.priority() && r1.weight() == 0 && r2.weight() > 0);
Executed by:
  • tst_qdnslookup - unknown status
19
55 && r1.weight() == 0 && r2.weight() > 0);
executed 19 times by 1 test: return r1.priority() < r2.priority() || (r1.priority() == r2.priority() && r1.weight() == 0 && r2.weight() > 0);
Executed by:
  • tst_qdnslookup - unknown status
19
56}-
57-
58-
59-
60-
61-
62static void qt_qdnsservicerecord_sort(QList<QDnsServiceRecord> &records)-
63{-
64-
65 if (records.size() <= 1
records.size() <= 1Description
TRUEevaluated 78 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
)
6-78
66 return;
executed 78 times by 2 tests: return;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
78
67-
68-
69-
70 std::sort(records.begin(), records.end(), qt_qdnsservicerecord_less_than);-
71-
72 int i = 0;-
73 while (i < records.size()
i < records.size()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
6-12
74-
75-
76 QList<QDnsServiceRecord> slice;-
77 const quint16 slicePriority = records.at(i).priority();-
78 unsigned int sliceWeight = 0;-
79 for (int j = i; j < records.size()
j < records.size()Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
; ++j) {
6-22
80 if (records.at(j).priority() != slicePriority
records.at(j).... slicePriorityDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
)
6-16
81 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qdnslookup - unknown status
6
82 sliceWeight += records.at(j).weight();-
83 slice << records.at(j);-
84 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
16
85-
86-
87-
88-
89-
90-
91 while (!slice.isEmpty()
!slice.isEmpty()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
12-16
92 const unsigned int weightThreshold = qrand() % (sliceWeight + 1);-
93 unsigned int summedWeight = 0;-
94 for (int j = 0; j < slice.size()
j < slice.size()Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEnever evaluated
; ++j) {
0-19
95 summedWeight += slice.at(j).weight();-
96 if (summedWeight >= weightThreshold
summedWeight >...eightThresholdDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
3-16
97-
98-
99-
100-
101-
102-
103 sliceWeight -= slice.at(j).weight();-
104 records[i++] = slice.takeAt(j);-
105 break;
executed 16 times by 1 test: break;
Executed by:
  • tst_qdnslookup - unknown status
16
106 }-
107 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
3
108 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
16
109 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
12
110}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
6
111-
112const char *QDnsLookupPrivate::msgNoIpV6NameServerAdresses =-
113 "IPv6 addresses for nameservers are currently not supported";-
114QDnsLookup::QDnsLookup(QObject *parent)-
115 : QObject(*new QDnsLookupPrivate, parent)-
116{-
117 qRegisterMetaType<QDnsLookupReply>();-
118}
executed 76 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
76
119-
120-
121-
122-
123-
124QDnsLookup::QDnsLookup(Type type, const QString &name, QObject *parent)-
125 : QObject(*new QDnsLookupPrivate, parent)-
126{-
127 QDnsLookupPrivate * const d = d_func();-
128 qRegisterMetaType<QDnsLookupReply>();-
129 d->name = name;-
130 d->type = type;-
131}
executed 21 times by 1 test: end of block
Executed by:
  • tst_qdnslookup_appless - unknown status
21
132QDnsLookup::QDnsLookup(Type type, const QString &name, const QHostAddress &nameserver, QObject *parent)-
133 : QObject(*new QDnsLookupPrivate, parent)-
134{-
135 QDnsLookupPrivate * const d = d_func();-
136 qRegisterMetaType<QDnsLookupReply>();-
137 d->name = name;-
138 d->type = type;-
139 d->nameserver = nameserver;-
140}
never executed: end of block
0
141QDnsLookup::~QDnsLookup()-
142{-
143}-
144-
145-
146-
147-
148-
149-
150QDnsLookup::Error QDnsLookup::error() const-
151{-
152 return
executed 152 times by 1 test: return d_func()->reply.error;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.error;
executed 152 times by 1 test: return d_func()->reply.error;
Executed by:
  • tst_qdnslookup - unknown status
152
153}-
154-
155-
156-
157-
158-
159-
160QString QDnsLookup::errorString() const-
161{-
162 return
executed 112 times by 1 test: return d_func()->reply.errorString;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.errorString;
executed 112 times by 1 test: return d_func()->reply.errorString;
Executed by:
  • tst_qdnslookup - unknown status
112
163}-
164-
165-
166-
167-
168-
169bool QDnsLookup::isFinished() const-
170{-
171 return
executed 180 times by 2 tests: return d_func()->isFinished;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
d_func()->isFinished;
executed 180 times by 2 tests: return d_func()->isFinished;
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
180
172}-
173QString QDnsLookup::name() const-
174{-
175 return
executed 72 times by 1 test: return d_func()->name;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->name;
executed 72 times by 1 test: return d_func()->name;
Executed by:
  • tst_qdnslookup - unknown status
72
176}-
177-
178void QDnsLookup::setName(const QString &name)-
179{-
180 QDnsLookupPrivate * const d = d_func();-
181 if (name != d->name
name != d->nameDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
16-64
182 d->name = name;-
183 nameChanged(name);-
184 }
executed 64 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
64
185}
executed 80 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
80
186-
187-
188-
189-
190-
191-
192QDnsLookup::Type QDnsLookup::type() const-
193{-
194 return
executed 72 times by 1 test: return d_func()->type;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->type;
executed 72 times by 1 test: return d_func()->type;
Executed by:
  • tst_qdnslookup - unknown status
72
195}-
196-
197void QDnsLookup::setType(Type type)-
198{-
199 QDnsLookupPrivate * const d = d_func();-
200 if (type != d->type
type != d->typeDescription
TRUEevaluated 68 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
12-68
201 d->type = type;-
202 typeChanged(type);-
203 }
executed 68 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
68
204}
executed 80 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
80
205-
206-
207-
208-
209-
210-
211QHostAddress QDnsLookup::nameserver() const-
212{-
213 return
never executed: return d_func()->nameserver;
d_func()->nameserver;
never executed: return d_func()->nameserver;
0
214}-
215-
216void QDnsLookup::setNameserver(const QHostAddress &nameserver)-
217{-
218 QDnsLookupPrivate * const d = d_func();-
219 if (nameserver != d->nameserver
nameserver != d->nameserverDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
220 d->nameserver = nameserver;-
221 nameserverChanged(nameserver);-
222 }
never executed: end of block
0
223}
never executed: end of block
0
224-
225-
226-
227-
228-
229QList<QDnsDomainNameRecord> QDnsLookup::canonicalNameRecords() const-
230{-
231 return
executed 72 times by 1 test: return d_func()->reply.canonicalNameRecords;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.canonicalNameRecords;
executed 72 times by 1 test: return d_func()->reply.canonicalNameRecords;
Executed by:
  • tst_qdnslookup - unknown status
72
232}-
233-
234-
235-
236-
237-
238QList<QDnsHostAddressRecord> QDnsLookup::hostAddressRecords() const-
239{-
240 return
executed 92 times by 1 test: return d_func()->reply.hostAddressRecords;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.hostAddressRecords;
executed 92 times by 1 test: return d_func()->reply.hostAddressRecords;
Executed by:
  • tst_qdnslookup - unknown status
92
241}-
242QList<QDnsMailExchangeRecord> QDnsLookup::mailExchangeRecords() const-
243{-
244 return
executed 72 times by 1 test: return d_func()->reply.mailExchangeRecords;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.mailExchangeRecords;
executed 72 times by 1 test: return d_func()->reply.mailExchangeRecords;
Executed by:
  • tst_qdnslookup - unknown status
72
245}-
246-
247-
248-
249-
250-
251QList<QDnsDomainNameRecord> QDnsLookup::nameServerRecords() const-
252{-
253 return
executed 72 times by 1 test: return d_func()->reply.nameServerRecords;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.nameServerRecords;
executed 72 times by 1 test: return d_func()->reply.nameServerRecords;
Executed by:
  • tst_qdnslookup - unknown status
72
254}-
255-
256-
257-
258-
259-
260QList<QDnsDomainNameRecord> QDnsLookup::pointerRecords() const-
261{-
262 return
executed 72 times by 1 test: return d_func()->reply.pointerRecords;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.pointerRecords;
executed 72 times by 1 test: return d_func()->reply.pointerRecords;
Executed by:
  • tst_qdnslookup - unknown status
72
263}-
264QList<QDnsServiceRecord> QDnsLookup::serviceRecords() const-
265{-
266 return
executed 72 times by 1 test: return d_func()->reply.serviceRecords;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.serviceRecords;
executed 72 times by 1 test: return d_func()->reply.serviceRecords;
Executed by:
  • tst_qdnslookup - unknown status
72
267}-
268-
269-
270-
271-
272-
273QList<QDnsTextRecord> QDnsLookup::textRecords() const-
274{-
275 return
executed 72 times by 1 test: return d_func()->reply.textRecords;
Executed by:
  • tst_qdnslookup - unknown status
d_func()->reply.textRecords;
executed 72 times by 1 test: return d_func()->reply.textRecords;
Executed by:
  • tst_qdnslookup - unknown status
72
276}-
277-
278-
279-
280-
281-
282-
283-
284void QDnsLookup::abort()-
285{-
286 QDnsLookupPrivate * const d = d_func();-
287 if (d->runnable
d->runnableDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEnever evaluated
) {
0-2
288 d->runnable = 0;-
289 d->reply = QDnsLookupReply();-
290 d->reply.error = QDnsLookup::OperationCancelledError;-
291 d->reply.errorString = tr("Operation cancelled");-
292 d->isFinished = true;-
293 finished();-
294 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
2
295}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
2
296-
297-
298-
299-
300-
301-
302-
303void QDnsLookup::lookup()-
304{-
305 QDnsLookupPrivate * const d = d_func();-
306 d->isFinished = false;-
307 d->reply = QDnsLookupReply();-
308 d->runnable = new QDnsLookupRunnable(d->type, QUrl::toAce(d->name), d->nameserver);-
309 connect(d->runnable, qFlagLocation("2""finished(QDnsLookupReply)" "\0" __FILE__ ":" "504"),-
310 this, qFlagLocation("1""_q_lookupFinished(QDnsLookupReply)" "\0" __FILE__ ":" "505"),-
311 Qt::BlockingQueuedConnection);-
312 theDnsLookupThreadPool()->start(d->runnable);-
313}
executed 101 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
101
314QDnsDomainNameRecord::QDnsDomainNameRecord()-
315 : d(new QDnsDomainNameRecordPrivate)-
316{-
317}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
6
318-
319-
320-
321-
322-
323QDnsDomainNameRecord::QDnsDomainNameRecord(const QDnsDomainNameRecord &other)-
324 : d(other.d)-
325{-
326}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
6
327-
328-
329-
330-
331-
332QDnsDomainNameRecord::~QDnsDomainNameRecord()-
333{-
334}-
335-
336-
337-
338-
339-
340QString QDnsDomainNameRecord::name() const-
341{-
342 return
executed 6 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
d->name;
executed 6 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
6
343}-
344-
345-
346-
347-
348-
349quint32 QDnsDomainNameRecord::timeToLive() const-
350{-
351 return
never executed: return d->timeToLive;
d->timeToLive;
never executed: return d->timeToLive;
0
352}-
353-
354-
355-
356-
357-
358QString QDnsDomainNameRecord::value() const-
359{-
360 return
executed 6 times by 1 test: return d->value;
Executed by:
  • tst_qdnslookup - unknown status
d->value;
executed 6 times by 1 test: return d->value;
Executed by:
  • tst_qdnslookup - unknown status
6
361}-
362-
363-
364-
365-
366-
367-
368QDnsDomainNameRecord &QDnsDomainNameRecord::operator=(const QDnsDomainNameRecord &other)-
369{-
370 d = other.d;-
371 return
never executed: return *this;
*this;
never executed: return *this;
0
372}-
373QDnsHostAddressRecord::QDnsHostAddressRecord()-
374 : d(new QDnsHostAddressRecordPrivate)-
375{-
376}
executed 50 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
50
377-
378-
379-
380-
381-
382QDnsHostAddressRecord::QDnsHostAddressRecord(const QDnsHostAddressRecord &other)-
383 : d(other.d)-
384{-
385}
executed 62 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
62
386-
387-
388-
389-
390-
391QDnsHostAddressRecord::~QDnsHostAddressRecord()-
392{-
393}-
394-
395-
396-
397-
398-
399QString QDnsHostAddressRecord::name() const-
400{-
401 return
executed 38 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
d->name;
executed 38 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
38
402}-
403-
404-
405-
406-
407-
408quint32 QDnsHostAddressRecord::timeToLive() const-
409{-
410 return
never executed: return d->timeToLive;
d->timeToLive;
never executed: return d->timeToLive;
0
411}-
412-
413-
414-
415-
416-
417QHostAddress QDnsHostAddressRecord::value() const-
418{-
419 return
executed 38 times by 1 test: return d->value;
Executed by:
  • tst_qdnslookup - unknown status
d->value;
executed 38 times by 1 test: return d->value;
Executed by:
  • tst_qdnslookup - unknown status
38
420}-
421-
422-
423-
424-
425-
426-
427QDnsHostAddressRecord &QDnsHostAddressRecord::operator=(const QDnsHostAddressRecord &other)-
428{-
429 d = other.d;-
430 return
never executed: return *this;
*this;
never executed: return *this;
0
431}-
432QDnsMailExchangeRecord::QDnsMailExchangeRecord()-
433 : d(new QDnsMailExchangeRecordPrivate)-
434{-
435}
executed 12 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
12
436-
437-
438-
439-
440-
441QDnsMailExchangeRecord::QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other)-
442 : d(other.d)-
443{-
444}
executed 32 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
32
445-
446-
447-
448-
449-
450QDnsMailExchangeRecord::~QDnsMailExchangeRecord()-
451{-
452}-
453-
454-
455-
456-
457-
458QString QDnsMailExchangeRecord::exchange() const-
459{-
460 return
executed 12 times by 1 test: return d->exchange;
Executed by:
  • tst_qdnslookup - unknown status
d->exchange;
executed 12 times by 1 test: return d->exchange;
Executed by:
  • tst_qdnslookup - unknown status
12
461}-
462-
463-
464-
465-
466-
467QString QDnsMailExchangeRecord::name() const-
468{-
469 return
executed 12 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
d->name;
executed 12 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
12
470}-
471-
472-
473-
474-
475-
476quint16 QDnsMailExchangeRecord::preference() const-
477{-
478 return
executed 40 times by 1 test: return d->preference;
Executed by:
  • tst_qdnslookup - unknown status
d->preference;
executed 40 times by 1 test: return d->preference;
Executed by:
  • tst_qdnslookup - unknown status
40
479}-
480-
481-
482-
483-
484-
485quint32 QDnsMailExchangeRecord::timeToLive() const-
486{-
487 return
never executed: return d->timeToLive;
d->timeToLive;
never executed: return d->timeToLive;
0
488}-
489-
490-
491-
492-
493-
494-
495QDnsMailExchangeRecord &QDnsMailExchangeRecord::operator=(const QDnsMailExchangeRecord &other)-
496{-
497 d = other.d;-
498 return
never executed: return *this;
*this;
never executed: return *this;
0
499}-
500QDnsServiceRecord::QDnsServiceRecord()-
501 : d(new QDnsServiceRecordPrivate)-
502{-
503}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
18
504-
505-
506-
507-
508-
509QDnsServiceRecord::QDnsServiceRecord(const QDnsServiceRecord &other)-
510 : d(other.d)-
511{-
512}
executed 60 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
60
513-
514-
515-
516-
517-
518QDnsServiceRecord::~QDnsServiceRecord()-
519{-
520}-
521-
522-
523-
524-
525-
526QString QDnsServiceRecord::name() const-
527{-
528 return
executed 18 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
d->name;
executed 18 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
18
529}-
530-
531-
532-
533-
534-
535quint16 QDnsServiceRecord::port() const-
536{-
537 return
executed 18 times by 1 test: return d->port;
Executed by:
  • tst_qdnslookup - unknown status
d->port;
executed 18 times by 1 test: return d->port;
Executed by:
  • tst_qdnslookup - unknown status
18
538}-
539quint16 QDnsServiceRecord::priority() const-
540{-
541 return
executed 118 times by 1 test: return d->priority;
Executed by:
  • tst_qdnslookup - unknown status
d->priority;
executed 118 times by 1 test: return d->priority;
Executed by:
  • tst_qdnslookup - unknown status
118
542}-
543-
544-
545-
546-
547-
548QString QDnsServiceRecord::target() const-
549{-
550 return
executed 18 times by 1 test: return d->target;
Executed by:
  • tst_qdnslookup - unknown status
d->target;
executed 18 times by 1 test: return d->target;
Executed by:
  • tst_qdnslookup - unknown status
18
551}-
552-
553-
554-
555-
556-
557quint32 QDnsServiceRecord::timeToLive() const-
558{-
559 return
never executed: return d->timeToLive;
d->timeToLive;
never executed: return d->timeToLive;
0
560}-
561quint16 QDnsServiceRecord::weight() const-
562{-
563 return
executed 77 times by 1 test: return d->weight;
Executed by:
  • tst_qdnslookup - unknown status
d->weight;
executed 77 times by 1 test: return d->weight;
Executed by:
  • tst_qdnslookup - unknown status
77
564}-
565-
566-
567-
568-
569-
570-
571QDnsServiceRecord &QDnsServiceRecord::operator=(const QDnsServiceRecord &other)-
572{-
573 d = other.d;-
574 return
never executed: return *this;
*this;
never executed: return *this;
0
575}-
576QDnsTextRecord::QDnsTextRecord()-
577 : d(new QDnsTextRecordPrivate)-
578{-
579}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
8
580-
581-
582-
583-
584-
585QDnsTextRecord::QDnsTextRecord(const QDnsTextRecord &other)-
586 : d(other.d)-
587{-
588}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
8
589-
590-
591-
592-
593-
594QDnsTextRecord::~QDnsTextRecord()-
595{-
596}-
597-
598-
599-
600-
601-
602QString QDnsTextRecord::name() const-
603{-
604 return
executed 8 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
d->name;
executed 8 times by 1 test: return d->name;
Executed by:
  • tst_qdnslookup - unknown status
8
605}-
606-
607-
608-
609-
610-
611quint32 QDnsTextRecord::timeToLive() const-
612{-
613 return
never executed: return d->timeToLive;
d->timeToLive;
never executed: return d->timeToLive;
0
614}-
615-
616-
617-
618-
619-
620QList<QByteArray> QDnsTextRecord::values() const-
621{-
622 return
executed 8 times by 1 test: return d->values;
Executed by:
  • tst_qdnslookup - unknown status
d->values;
executed 8 times by 1 test: return d->values;
Executed by:
  • tst_qdnslookup - unknown status
8
623}-
624-
625-
626-
627-
628-
629-
630QDnsTextRecord &QDnsTextRecord::operator=(const QDnsTextRecord &other)-
631{-
632 d = other.d;-
633 return
never executed: return *this;
*this;
never executed: return *this;
0
634}-
635-
636-
637-
638-
639-
640-
641-
642void QDnsLookupPrivate::_q_lookupFinished(const QDnsLookupReply &_reply)-
643{-
644 QDnsLookup * const q = q_func();-
645 if (runnable == q->sender()
runnable == q->sender()Description
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
2-88
646-
647-
648-
649 reply = _reply;-
650 runnable = 0;-
651 isFinished = true;-
652 q->finished();-
653 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
88
654}
executed 90 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
90
655-
656void QDnsLookupRunnable::run()-
657{-
658 QDnsLookupReply reply;-
659-
660-
661 if (requestName.isEmpty()
requestName.isEmpty()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
FALSEevaluated 84 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
) {
16-84
662 reply.error = QDnsLookup::InvalidRequestError;-
663 reply.errorString = tr("Invalid domain name");-
664 finished(reply);-
665 return;
executed 16 times by 1 test: return;
Executed by:
  • tst_qdnslookup - unknown status
16
666 }-
667-
668-
669 query(requestType, requestName, nameserver, &reply);-
670-
671-
672 if (!theDnsLookupSeedStorage()->hasLocalData()
!theDnsLookupS...hasLocalData()Description
TRUEevaluated 23 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEevaluated 61 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
23-61
673 qsrand(QTime(0,0,0).msecsTo(QTime::currentTime()) ^ reinterpret_cast<quintptr>(this));-
674 theDnsLookupSeedStorage()->setLocalData(new bool(true));-
675 }
executed 23 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
23
676 qt_qdnsmailexchangerecord_sort(reply.mailExchangeRecords);-
677 qt_qdnsservicerecord_sort(reply.serviceRecords);-
678-
679 finished(reply);-
680}
executed 84 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
84
681-
682QDnsLookupThreadPool::QDnsLookupThreadPool()-
683 : signalsConnected(false)-
684{-
685-
686 setMaxThreadCount(5);-
687}
executed 2 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
2
688-
689void QDnsLookupThreadPool::start(QRunnable *runnable)-
690{-
691-
692 if (!signalsConnected
!signalsConnectedDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEevaluated 79 times by 1 test
Evaluated by:
  • tst_qdnslookup - unknown status
) {
22-79
693 QMutexLocker signalsLocker(&signalsMutex);-
694 if (!signalsConnected
!signalsConnectedDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
FALSEnever evaluated
) {
0-22
695 QCoreApplication *app = QCoreApplication::instance();-
696 if (!app
!appDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qdnslookup_appless - unknown status
FALSEevaluated 21 times by 2 tests
Evaluated by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
) {
1-21
697 QMessageLogger(__FILE__, 1039, __PRETTY_FUNCTION__).warning("QDnsLookup requires a QCoreApplication");-
698 delete runnable;-
699 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_qdnslookup_appless - unknown status
1
700 }-
701-
702 moveToThread(app->thread());-
703 connect(app, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "1045"),-
704 qFlagLocation("1""_q_applicationDestroyed()" "\0" __FILE__ ":" "1046"), Qt::DirectConnection);-
705 signalsConnected = true;-
706 }
executed 21 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
21
707 }
executed 21 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
21
708-
709 QThreadPool::start(runnable);-
710}
executed 100 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
100
711-
712void QDnsLookupThreadPool::_q_applicationDestroyed()-
713{-
714 waitForDone();-
715 signalsConnected = false;-
716}
executed 21 times by 2 tests: end of block
Executed by:
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
21
717-
718-
719-
Switch to Source codePreprocessed file

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