thread/qexception.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6void QException::raise() const -
7{ -
8 QException e = *this; -
9 throw e;
executed: throw e;
Execution Count:12
12
10} -
11 -
12QException *QException::clone() const -
13{ -
14 return new QException(*this);
executed: return new QException(*this);
Execution Count:12
12
15} -
16 -
17void QUnhandledException::raise() const -
18{ -
19 QUnhandledException e = *this; -
20 throw e;
executed: throw e;
Execution Count:3
3
21} -
22 -
23QUnhandledException *QUnhandledException::clone() const -
24{ -
25 return new QUnhandledException(*this);
executed: return new QUnhandledException(*this);
Execution Count:4
4
26} -
27 -
28 -
29 -
30namespace QtPrivate { -
31 -
32class Base : public QSharedData -
33{ -
34public: -
35 Base(QException *exception) -
36 : exception(exception), hasThrown(false) { }
executed: }
Execution Count:666411
666411
37 ~Base() { delete exception; }
executed: }
Execution Count:667145
667145
38 -
39 QException *exception; -
40 bool hasThrown; -
41}; -
42 -
43ExceptionHolder::ExceptionHolder(QException *exception) -
44: base(new Base(exception)) {}
executed: }
Execution Count:667660
667660
45 -
46ExceptionHolder::ExceptionHolder(const ExceptionHolder &other) -
47: base(other.base) -
48{}
never executed: }
0
49 -
50void ExceptionHolder::operator=(const ExceptionHolder &other) -
51{ -
52 base = other.base; -
53}
executed: }
Execution Count:18
18
54 -
55ExceptionHolder::~ExceptionHolder() -
56{} -
57 -
58QException *ExceptionHolder::exception() const -
59{ -
60 return base->exception;
executed: return base->exception;
Execution Count:607398
607398
61} -
62 -
63void ExceptionStore::setException(const QException &e) -
64{ -
65 if (hasException() == false)
evaluated: hasException() == false
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:31
18-31
66 exceptionHolder = ExceptionHolder(e.clone());
executed: exceptionHolder = ExceptionHolder(e.clone());
Execution Count:18
18
67}
executed: }
Execution Count:49
49
68 -
69bool ExceptionStore::hasException() const -
70{ -
71 return (exceptionHolder.exception() != 0);
executed: return (exceptionHolder.exception() != 0);
Execution Count:606942
606942
72} -
73 -
74ExceptionHolder ExceptionStore::exception() -
75{ -
76 return exceptionHolder;
never executed: return exceptionHolder;
0
77} -
78 -
79void ExceptionStore::throwPossibleException() -
80{ -
81 if (hasException() ) {
evaluated: hasException()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:607120
17-607120
82 exceptionHolder.base->hasThrown = true; -
83 exceptionHolder.exception()->raise(); -
84 }
never executed: }
0
85}
executed: }
Execution Count:606754
606754
86 -
87bool ExceptionStore::hasThrown() const { return exceptionHolder.base->hasThrown; }
never executed: return exceptionHolder.base->hasThrown;
0
88 -
89} -
90 -
91 -
92 -
93 -
94 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial