Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode) | - |
18 | { | - |
19 | if (key.isEmpty()TRUE | evaluated 59 times by 1 test | FALSE | evaluated 22452 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
){ | 59-22452 |
20 | errorString = QCoreApplication::tr("%1: key is empty", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:")); | - |
21 | error = QSystemSemaphore::KeyError; | - |
22 | returnexecuted 59 times by 1 test: return -1; -1;executed 59 times by 1 test: return -1; | 59 |
23 | } | - |
24 | | - |
25 | | - |
26 | if (-TRUE | evaluated 15320 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| FALSE | evaluated 7132 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
1 != unix_keyTRUE | evaluated 15320 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| FALSE | evaluated 7132 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) | 7132-15320 |
27 | returnexecuted 15320 times by 4 tests: return unix_key; Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
unix_key;executed 15320 times by 4 tests: return unix_key; Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| 15320 |
28 | | - |
29 | | - |
30 | int built = QSharedMemoryPrivate::createUnixKeyFile(fileName); | - |
31 | if (-TRUE | never evaluated | FALSE | evaluated 7132 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
1 == builtTRUE | never evaluated | FALSE | evaluated 7132 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) { | 0-7132 |
32 | errorString = QCoreApplication::tr("%1: unable to make key", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:")); | - |
33 | error = QSystemSemaphore::KeyError; | - |
34 | return never executed: return -1; -1;never executed: return -1; | 0 |
35 | } | - |
36 | createdFile = (1 == built); | - |
37 | | - |
38 | | - |
39 | unix_key = qt_safe_ftok(QFile::encodeName(fileName), 'Q'); | - |
40 | if (-TRUE | never evaluated | FALSE | evaluated 7132 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
1 == unix_keyTRUE | never evaluated | FALSE | evaluated 7132 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) { | 0-7132 |
41 | errorString = QCoreApplication::tr("%1: ftok failed", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:")); | - |
42 | error = QSystemSemaphore::KeyError; | - |
43 | return never executed: return -1; -1;never executed: return -1; | 0 |
44 | } | - |
45 | | - |
46 | | - |
47 | semaphore = semget(unix_key, 1, 0600 | 01000 | 02000); | - |
48 | if (-TRUE | evaluated 3613 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| FALSE | evaluated 3519 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
|
1 == semaphoreTRUE | evaluated 3613 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| FALSE | evaluated 3519 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
|
) { | 3519-3613 |
49 | if ((*TRUE | evaluated 3611 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| FALSE | evaluated 2 times by 1 test |
__errno_location ()) == 17TRUE | evaluated 3611 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| FALSE | evaluated 2 times by 1 test |
) | 2-3611 |
50 | semaphore = semget(unix_key, 1, 0600 | 01000);executed 3611 times by 3 tests: semaphore = semget(unix_key, 1, 0600 | 01000); Executed by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| 3611 |
51 | if (-TRUE | evaluated 2 times by 1 test | FALSE | evaluated 3611 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
1 == semaphoreTRUE | evaluated 2 times by 1 test | FALSE | evaluated 3611 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) { | 2-3611 |
52 | setErrorString(QLatin1String("QSystemSemaphore::handle")); | - |
53 | cleanHandle(); | - |
54 | returnexecuted 2 times by 1 test: return -1; -1;executed 2 times by 1 test: return -1; | 2 |
55 | } | - |
56 | }executed 3611 times by 3 tests: end of block Executed by:- tst_QSharedMemory
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
else { | 3611 |
57 | createdSemaphore = true; | - |
58 | | - |
59 | createdFile = true; | - |
60 | }executed 3519 times by 3 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
| 3519 |
61 | | - |
62 | if (mode == QSystemSemaphore::CreateTRUE | evaluated 3513 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
| FALSE | evaluated 3617 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) { | 3513-3617 |
63 | createdSemaphore = true; | - |
64 | createdFile = true; | - |
65 | }executed 3513 times by 3 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
| 3513 |
66 | | - |
67 | | - |
68 | if (createdSemaphoreTRUE | evaluated 6987 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
| FALSE | evaluated 143 times by 2 testsEvaluated by:- tst_QSharedMemory
- tst_qsystemsemaphore - unknown status
|
&& initialValue >= 0TRUE | evaluated 6987 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
| FALSE | never evaluated |
) { | 0-6987 |
69 | qt_semun init_op; | - |
70 | init_op.val = initialValue; | - |
71 | if (-TRUE | never evaluated | FALSE | evaluated 6987 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
|
1 == semctl(semaphore, 0, 16, init_op)TRUE | never evaluated | FALSE | evaluated 6987 times by 3 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
|
) { | 0-6987 |
72 | setErrorString(QLatin1String("QSystemSemaphore::handle")); | - |
73 | cleanHandle(); | - |
74 | return never executed: return -1; -1;never executed: return -1; | 0 |
75 | } | - |
76 | }executed 6987 times by 3 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
| 6987 |
77 | | - |
78 | returnexecuted 7130 times by 4 tests: return unix_key; Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
unix_key;executed 7130 times by 4 tests: return unix_key; Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| 7130 |
79 | } | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
86 | void QSystemSemaphorePrivate::cleanHandle() | - |
87 | { | - |
88 | unix_key = -1; | - |
89 | | - |
90 | | - |
91 | if (createdFileTRUE | evaluated 3522 times by 2 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
| FALSE | evaluated 3937 times by 5 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qapplication - unknown status
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) { | 3522-3937 |
92 | QFile::remove(fileName); | - |
93 | createdFile = false; | - |
94 | }executed 3522 times by 2 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
| 3522 |
95 | | - |
96 | if (createdSemaphoreTRUE | evaluated 3520 times by 2 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
| FALSE | evaluated 3939 times by 5 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qapplication - unknown status
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) { | 3520-3939 |
97 | if (-TRUE | evaluated 3519 times by 2 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
| FALSE | evaluated 1 time by 1 test |
1 != semaphoreTRUE | evaluated 3519 times by 2 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
| FALSE | evaluated 1 time by 1 test |
) { | 1-3519 |
98 | if (-TRUE | never evaluated | FALSE | evaluated 3519 times by 2 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
|
1 == semctl(semaphore, 0, 0, 0)TRUE | never evaluated | FALSE | evaluated 3519 times by 2 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
|
) { | 0-3519 |
99 | setErrorString(QLatin1String("QSystemSemaphore::cleanHandle")); | - |
100 | | - |
101 | | - |
102 | | - |
103 | } never executed: end of block | 0 |
104 | semaphore = -1; | - |
105 | }executed 3519 times by 2 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
| 3519 |
106 | createdSemaphore = false; | - |
107 | }executed 3520 times by 2 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
| 3520 |
108 | }executed 7459 times by 5 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qapplication - unknown status
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| 7459 |
109 | | - |
110 | | - |
111 | | - |
112 | | - |
113 | bool QSystemSemaphorePrivate::modifySemaphore(int count) | - |
114 | { | - |
115 | if (-TRUE | evaluated 2 times by 1 test | FALSE | evaluated 15320 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
1 == handle()TRUE | evaluated 2 times by 1 test | FALSE | evaluated 15320 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) | 2-15320 |
116 | returnexecuted 2 times by 1 test: return false; false;executed 2 times by 1 test: return false; | 2 |
117 | | - |
118 | struct sembuf operation; | - |
119 | operation.sem_num = 0; | - |
120 | operation.sem_op = count; | - |
121 | operation.sem_flg = 0x1000; | - |
122 | | - |
123 | int res; | - |
124 | do { res = semop(semaphore, &operation, 1); }executed 15320 times by 4 tests: end of block Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
while (res == -1TRUE | evaluated 2 times by 1 test | FALSE | evaluated 15318 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
&& (*TRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
__errno_location ()) == 4TRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
); | 0-15320 |
125 | if (-TRUE | evaluated 2 times by 1 test | FALSE | evaluated 15318 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
1 == resTRUE | evaluated 2 times by 1 test | FALSE | evaluated 15318 times by 4 testsEvaluated by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
|
) { | 2-15318 |
126 | | - |
127 | if ((*TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
__errno_location ()) == 22TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
|| (*TRUE | never evaluated | FALSE | never evaluated |
__errno_location ()) == 43TRUE | never evaluated | FALSE | never evaluated |
) { | 0-2 |
128 | semaphore = -1; | - |
129 | cleanHandle(); | - |
130 | handle(); | - |
131 | returnexecuted 2 times by 1 test: return modifySemaphore(count); modifySemaphore(count);executed 2 times by 1 test: return modifySemaphore(count); | 2 |
132 | } | - |
133 | setErrorString(QLatin1String("QSystemSemaphore::modifySemaphore")); | - |
134 | | - |
135 | | - |
136 | | - |
137 | return never executed: return false; false;never executed: return false; | 0 |
138 | } | - |
139 | | - |
140 | clearError(); | - |
141 | returnexecuted 15318 times by 4 tests: return true; Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
true;executed 15318 times by 4 tests: return true; Executed by:- tst_QSharedMemory
- tst_QSystemSemaphore
- tst_qsharedmemory - unknown status
- tst_qsystemsemaphore - unknown status
| 15318 |
142 | } | - |
143 | | - |
144 | | - |
145 | | - |
| | |