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