qsystemsemaphore.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qsystemsemaphore.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessMode mode)-
4 : d(new QSystemSemaphorePrivate)-
5{-
6 setKey(key, initialValue, mode);-
7}
executed 3735 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
3735
8QSystemSemaphore::~QSystemSemaphore()-
9{-
10 d->cleanHandle();-
11}
executed 3734 times by 4 tests: end of block
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qapplication - unknown status
  • tst_qsystemsemaphore - unknown status
3734
12void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode mode)-
13{-
14 if (key == d->key
key == d->keyDescription
TRUEevaluated 10883 times by 4 tests
Evaluated by:
  • tst_QApplication
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
FALSEevaluated 3666 times by 4 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
&& mode == Open
mode == OpenDescription
TRUEevaluated 7362 times by 4 tests
Evaluated by:
  • tst_QApplication
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
FALSEevaluated 3521 times by 2 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_qsharedmemory - unknown status
)
3521-10883
15 return;
executed 7362 times by 4 tests: return;
Executed by:
  • tst_QApplication
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
7362
16 d->clearError();-
17-
18-
19 if (key == d->key
key == d->keyDescription
TRUEevaluated 3521 times by 2 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_qsharedmemory - unknown status
FALSEevaluated 3666 times by 4 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
&& mode == Create
mode == CreateDescription
TRUEevaluated 3521 times by 2 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_qsharedmemory - unknown status
FALSEnever evaluated
&& d->createdSemaphore
d->createdSemaphoreDescription
TRUEevaluated 3466 times by 2 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_qsharedmemory - unknown status
FALSEevaluated 55 times by 1 test
Evaluated by:
  • tst_QSharedMemory
&& d->createdFile
d->createdFileDescription
TRUEevaluated 3466 times by 2 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_qsharedmemory - unknown status
FALSEnever evaluated
) {
0-3666
20 d->initialValue = initialValue;-
21 d->unix_key = -1;-
22 d->handle(mode);-
23 return;
executed 3466 times by 2 tests: return;
Executed by:
  • tst_QSharedMemory
  • tst_qsharedmemory - unknown status
3466
24 }-
25-
26 d->cleanHandle();-
27 d->key = key;-
28 d->initialValue = initialValue;-
29-
30 d->fileName = d->makeKeyFileName();-
31 d->handle(mode);-
32}
executed 3721 times by 4 tests: end of block
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
3721
33-
34-
35-
36-
37-
38-
39-
40QString QSystemSemaphore::key() const-
41{-
42 return
executed 6 times by 1 test: return d->key;
Executed by:
  • tst_QSystemSemaphore
d->key;
executed 6 times by 1 test: return d->key;
Executed by:
  • tst_QSystemSemaphore
6
43}-
44bool QSystemSemaphore::acquire()-
45{-
46 return
executed 7661 times by 4 tests: return d->modifySemaphore(-1);
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
d->modifySemaphore(-1);
executed 7661 times by 4 tests: return d->modifySemaphore(-1);
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
7661
47}-
48bool QSystemSemaphore::release(int n)-
49{-
50 if (n == 0
n == 0Description
TRUEnever evaluated
FALSEevaluated 7659 times by 4 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
)
0-7659
51 return
never executed: return true;
true;
never executed: return true;
0
52 if (n < 0
n < 0Description
TRUEnever evaluated
FALSEevaluated 7659 times by 4 tests
Evaluated by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
) {
0-7659
53 QMessageLogger(__FILE__, 303, __PRETTY_FUNCTION__).warning("QSystemSemaphore::release: n is negative.");-
54 return
never executed: return false;
false;
never executed: return false;
0
55 }-
56 return
executed 7659 times by 4 tests: return d->modifySemaphore(n);
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
d->modifySemaphore(n);
executed 7659 times by 4 tests: return d->modifySemaphore(n);
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
7659
57}-
58-
59-
60-
61-
62-
63-
64-
65QSystemSemaphore::SystemSemaphoreError QSystemSemaphore::error() const-
66{-
67 return
executed 3721 times by 3 tests: return d->error;
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
d->error;
executed 3721 times by 3 tests: return d->error;
Executed by:
  • tst_QSharedMemory
  • tst_QSystemSemaphore
  • tst_qsharedmemory - unknown status
3721
68}-
69QString QSystemSemaphore::errorString() const-
70{-
71 return
executed 9 times by 1 test: return d->errorString;
Executed by:
  • tst_QSystemSemaphore
d->errorString;
executed 9 times by 1 test: return d->errorString;
Executed by:
  • tst_QSystemSemaphore
9
72}-
73-
74-
75-
76-
Switch to Source codePreprocessed file

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