OpenCoverage

qdbusunixfiledescriptor.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusunixfiledescriptor.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6class QDBusUnixFileDescriptorPrivate : public QSharedData {-
7public:-
8 QDBusUnixFileDescriptorPrivate() : fd(-1) { }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
24
9 QDBusUnixFileDescriptorPrivate(const QDBusUnixFileDescriptorPrivate &other)-
10 : QSharedData(other), fd(-1)-
11 { }
never executed: end of block
0
12 ~QDBusUnixFileDescriptorPrivate();-
13-
14 QAtomicInt fd;-
15};-
16-
17template<> inline-
18QExplicitlySharedDataPointer<QDBusUnixFileDescriptorPrivate>::~QExplicitlySharedDataPointer()-
19{ if (d
dDescription
TRUEevaluated 94 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
&& !d->ref.deref()
!d->ref.deref()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
FALSEevaluated 70 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
) delete d;
executed 24 times by 1 test: delete d;
Executed by:
  • tst_qdbusmarshall - unknown status
}
executed 104 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
10-104
20QDBusUnixFileDescriptor::QDBusUnixFileDescriptor()-
21 : d(0)-
22{-
23}
executed 23 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
23
24QDBusUnixFileDescriptor::QDBusUnixFileDescriptor(int fileDescriptor)-
25 : d(0)-
26{-
27 if (fileDescriptor != -1
fileDescriptor != -1Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
)
1-7
28 setFileDescriptor(fileDescriptor);
executed 7 times by 1 test: setFileDescriptor(fileDescriptor);
Executed by:
  • tst_qdbusmarshall - unknown status
7
29}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
8
30-
31-
32-
33-
34QDBusUnixFileDescriptor::QDBusUnixFileDescriptor(const QDBusUnixFileDescriptor &other)-
35 : d(other.d)-
36{-
37}
executed 73 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
73
38-
39-
40-
41-
42-
43-
44QDBusUnixFileDescriptor &QDBusUnixFileDescriptor::operator=(const QDBusUnixFileDescriptor &other)-
45{-
46 if (this != &other
this != &otherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
47 d.operator=(other.d);
never executed: d.operator=(other.d);
0
48 return
never executed: return *this;
*this;
never executed: return *this;
0
49}-
50QDBusUnixFileDescriptor::~QDBusUnixFileDescriptor()-
51{-
52}-
53bool QDBusUnixFileDescriptor::isValid() const-
54{-
55 return
executed 6 times by 1 test: return d ? d->fd.load() != -1 : false;
Executed by:
  • tst_qdbusmarshall - unknown status
d ? d->fd.load() != -1 : false;
executed 6 times by 1 test: return d ? d->fd.load() != -1 : false;
Executed by:
  • tst_qdbusmarshall - unknown status
6
56}-
57int QDBusUnixFileDescriptor::fileDescriptor() const-
58{-
59 return
executed 27 times by 1 test: return d ? d->fd.load() : -1;
Executed by:
  • tst_qdbusmarshall - unknown status
d ? d->fd.load() : -1;
executed 27 times by 1 test: return d ? d->fd.load() : -1;
Executed by:
  • tst_qdbusmarshall - unknown status
27
60}-
61bool QDBusUnixFileDescriptor::isSupported()-
62{-
63 return
never executed: return true;
true;
never executed: return true;
0
64}-
65void QDBusUnixFileDescriptor::setFileDescriptor(int fileDescriptor)-
66{-
67 if (fileDescriptor != -1
fileDescriptor != -1Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
FALSEnever evaluated
)
0-7
68 giveFileDescriptor(qt_safe_dup(fileDescriptor));
executed 7 times by 1 test: giveFileDescriptor(qt_safe_dup(fileDescriptor));
Executed by:
  • tst_qdbusmarshall - unknown status
7
69}
executed 7 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
7
70-
71-
72-
73-
74-
75-
76-
77void QDBusUnixFileDescriptor::giveFileDescriptor(int fileDescriptor)-
78{-
79-
80-
81 if (d
dDescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
)
0-24
82 d.detach();
never executed: d.detach();
0
83 else-
84 d = new QDBusUnixFileDescriptorPrivate;
executed 24 times by 1 test: d = new QDBusUnixFileDescriptorPrivate;
Executed by:
  • tst_qdbusmarshall - unknown status
24
85-
86 const int fdl = d->fd.load();-
87 if (fdl != -1
fdl != -1Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
)
0-24
88 qt_safe_close(fdl);
never executed: qt_safe_close(fdl);
0
89-
90 if (fileDescriptor != -1
fileDescriptor != -1Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
FALSEnever evaluated
)
0-24
91 d->fd.store(fileDescriptor);
executed 24 times by 1 test: d->fd.store(fileDescriptor);
Executed by:
  • tst_qdbusmarshall - unknown status
24
92}
executed 24 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
24
93int QDBusUnixFileDescriptor::takeFileDescriptor()-
94{-
95 if (!d
!dDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
96 return
never executed: return -1;
-1;
never executed: return -1;
0
97-
98 return
never executed: return d->fd.fetchAndStoreRelaxed(-1);
d->fd.fetchAndStoreRelaxed(-1);
never executed: return d->fd.fetchAndStoreRelaxed(-1);
0
99}-
100-
101QDBusUnixFileDescriptorPrivate::~QDBusUnixFileDescriptorPrivate()-
102{-
103 const int fdl = fd.load();-
104 if (fdl != -1
fdl != -1Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qdbusmarshall - unknown status
FALSEnever evaluated
)
0-24
105 qt_safe_close(fdl);
executed 24 times by 1 test: qt_safe_close(fdl);
Executed by:
  • tst_qdbusmarshall - unknown status
24
106}
executed 24 times by 1 test: end of block
Executed by:
  • tst_qdbusmarshall - unknown status
24
107-
Switch to Source codePreprocessed file

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