qtestdata.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8class QTestDataPrivate -
9{ -
10public: -
11 QTestDataPrivate() : tag(0), parent(0), data(0), dataCount(0) {}
executed: }
Execution Count:61136
61136
12 -
13 char *tag; -
14 QTestTable *parent; -
15 void **data; -
16 int dataCount; -
17}; -
18 -
19QTestData::QTestData(const char *tag, QTestTable *parent) -
20{ -
21 do { if (!(tag)) qt_assert("tag","qtestdata.cpp",66); } while (0);
never executed: qt_assert("tag","qtestdata.cpp",66);
executed: }
Execution Count:61136
partially evaluated: !(tag)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:61136
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:61136
0-61136
22 do { if (!(parent)) qt_assert("parent","qtestdata.cpp",67); } while (0);
partially evaluated: !(parent)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:61136
never executed: qt_assert("parent","qtestdata.cpp",67);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:61136
executed: }
Execution Count:61136
0-61136
23 d = new QTestDataPrivate; -
24 d->tag = qstrdup(tag); -
25 d->parent = parent; -
26 d->data = new void *[parent->elementCount()]; -
27 memset(d->data, 0, parent->elementCount() * sizeof(void*)); -
28}
executed: }
Execution Count:61136
61136
29 -
30QTestData::~QTestData() -
31{ -
32 for (int i = 0; i < d->dataCount; ++i) {
evaluated: i < d->dataCount
TRUEFALSE
yes
Evaluation Count:183499
yes
Evaluation Count:61133
61133-183499
33 if (d->data[i])
partially evaluated: d->data[i]
TRUEFALSE
yes
Evaluation Count:183499
no
Evaluation Count:0
0-183499
34 QMetaType::destroy(d->parent->elementTypeId(i), d->data[i]);
executed: QMetaType::destroy(d->parent->elementTypeId(i), d->data[i]);
Execution Count:183499
183499
35 }
executed: }
Execution Count:183499
183499
36 delete [] d->data; -
37 delete [] d->tag; -
38 delete d; -
39}
executed: }
Execution Count:61133
61133
40 -
41void QTestData::append(int type, const void *data) -
42{ -
43 do { if (!(d->dataCount < d->parent->elementCount())) qt_assert("d->dataCount < d->parent->elementCount()","qtestdata.cpp",88); } while (0);
executed: }
Execution Count:183502
partially evaluated: !(d->dataCount < d->parent->elementCount())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:183502
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:183502
never executed: qt_assert("d->dataCount < d->parent->elementCount()","qtestdata.cpp",88);
0-183502
44 if (d->parent->elementTypeId(d->dataCount) != type) {
partially evaluated: d->parent->elementTypeId(d->dataCount) != type
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:183502
0-183502
45 QMessageLogger("qtestdata.cpp", 90, __PRETTY_FUNCTION__).debug("expected data of type '%s', got '%s' for element %d of data with tag '%s'", -
46 QMetaType::typeName(d->parent->elementTypeId(d->dataCount)), -
47 QMetaType::typeName(type), -
48 d->dataCount, d->tag); -
49 do { if (!(false)) qt_assert("false","qtestdata.cpp",94); } while (0);
never executed: qt_assert("false","qtestdata.cpp",94);
never executed: }
never evaluated: !(false)
never evaluated: 0
0
50 }
never executed: }
0
51 d->data[d->dataCount] = QMetaType::create(type, data); -
52 ++d->dataCount; -
53}
executed: }
Execution Count:183502
183502
54 -
55void *QTestData::data(int index) const -
56{ -
57 do { if (!(index >= 0)) qt_assert("index >= 0","qtestdata.cpp",102); } while (0);
never executed: qt_assert("index >= 0","qtestdata.cpp",102);
executed: }
Execution Count:180121
partially evaluated: !(index >= 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180121
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180121
0-180121
58 do { if (!(index < d->parent->elementCount())) qt_assert("index < d->parent->elementCount()","qtestdata.cpp",103); } while (0);
never executed: qt_assert("index < d->parent->elementCount()","qtestdata.cpp",103);
executed: }
Execution Count:180121
partially evaluated: !(index < d->parent->elementCount())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180121
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180121
0-180121
59 return d->data[index];
executed: return d->data[index];
Execution Count:180121
180121
60} -
61 -
62QTestTable *QTestData::parent() const -
63{ -
64 return d->parent;
executed: return d->parent;
Execution Count:542554
542554
65} -
66 -
67const char *QTestData::dataTag() const -
68{ -
69 return d->tag;
executed: return d->tag;
Execution Count:263713
263713
70} -
71 -
72int QTestData::dataCount() const -
73{ -
74 return d->dataCount;
executed: return d->dataCount;
Execution Count:177930
177930
75} -
76 -
77 -
78 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial