OpenCoverage

qexception.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/thread/qexception.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QException::~QException()-
7-
8 noexcept-
9-
10-
11-
12{-
13-
14}-
15-
16void QException::raise() const-
17{-
18 QException e = *this;-
19 throw
executed 16 times by 4 tests: throw e;
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
e;
executed 16 times by 4 tests: throw e;
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
16
20}-
21-
22QException *QException::clone() const-
23{-
24 return
executed 16 times by 4 tests: return new QException(*this);
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
new QException(*this);
executed 16 times by 4 tests: return new QException(*this);
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
16
25}-
26-
27QUnhandledException::~QUnhandledException()-
28-
29 noexcept-
30-
31-
32-
33{-
34-
35}-
36-
37void QUnhandledException::raise() const-
38{-
39 QUnhandledException e = *this;-
40 throw
executed 3 times by 1 test: throw e;
Executed by:
  • tst_QtConcurrentThreadEngine
e;
executed 3 times by 1 test: throw e;
Executed by:
  • tst_QtConcurrentThreadEngine
3
41}-
42-
43QUnhandledException *QUnhandledException::clone() const-
44{-
45 return
executed 3 times by 1 test: return new QUnhandledException(*this);
Executed by:
  • tst_QtConcurrentThreadEngine
new QUnhandledException(*this);
executed 3 times by 1 test: return new QUnhandledException(*this);
Executed by:
  • tst_QtConcurrentThreadEngine
3
46}-
47-
48-
49-
50namespace QtPrivate {-
51-
52class Base : public QSharedData-
53{-
54public:-
55 Base(QException *exception)-
56 : exception(exception), hasThrown(false) { }
executed 21 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
21
57 ~Base() { delete exception; }
executed 21 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
21
58-
59 QException *exception;-
60 bool hasThrown;-
61};-
62-
63ExceptionHolder::ExceptionHolder(QException *exception)-
64: base(exception ? new Base(exception) : nullptr) {}
executed 209799 times by 12 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
209799
65-
66ExceptionHolder::ExceptionHolder(const ExceptionHolder &other)-
67: base(other.base)-
68{}
never executed: end of block
0
69-
70void ExceptionHolder::operator=(const ExceptionHolder &other)-
71{-
72 base = other.base;-
73}
executed 21 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
21
74-
75ExceptionHolder::~ExceptionHolder()-
76{}-
77-
78QException *ExceptionHolder::exception() const-
79{-
80 if (!base
!baseDescription
TRUEevaluated 233369 times by 12 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 46 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
46-233369
81 return
executed 233369 times by 12 tests: return nullptr;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
nullptr;
executed 233369 times by 12 tests: return nullptr;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
233369
82 return
executed 46 times by 4 tests: return base->exception;
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
base->exception;
executed 46 times by 4 tests: return base->exception;
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
46
83}-
84-
85void ExceptionStore::setException(const QException &e)-
86{-
87 if (hasException() == false
hasException() == falseDescription
TRUEevaluated 21 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QtConcurrentThreadEngine
)
4-21
88 exceptionHolder = ExceptionHolder(e.clone());
executed 21 times by 4 tests: exceptionHolder = ExceptionHolder(e.clone());
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
21
89}
executed 25 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
25
90-
91bool ExceptionStore::hasException() const-
92{-
93 return
executed 233394 times by 12 tests: return (exceptionHolder.exception() != 0);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
(exceptionHolder.exception() != 0);
executed 233394 times by 12 tests: return (exceptionHolder.exception() != 0);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
233394
94}-
95-
96ExceptionHolder ExceptionStore::exception()-
97{-
98 return
never executed: return exceptionHolder;
exceptionHolder;
never executed: return exceptionHolder;
0
99}-
100-
101void ExceptionStore::throwPossibleException()-
102{-
103 if (hasException()
hasException()Description
TRUEevaluated 21 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 233348 times by 12 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
) {
21-233348
104 exceptionHolder.base->hasThrown = true;-
105 exceptionHolder.exception()->raise();-
106 }
never executed: end of block
0
107}
executed 233348 times by 12 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
233348
108-
109bool ExceptionStore::hasThrown() const { return
never executed: return exceptionHolder.base->hasThrown;
exceptionHolder.base->hasThrown;
never executed: return exceptionHolder.base->hasThrown;
}
0
110-
111}-
112-
113-
114-
115-
Switch to Source codePreprocessed file

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