Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | static const uint initial_cache_size = 128; | - |
5 | | - |
6 | QSqlCachedResultPrivate::QSqlCachedResultPrivate(QSqlCachedResult *q, const QSqlDriver *drv) | - |
7 | : QSqlResultPrivate(q, drv), | - |
8 | rowCacheEnd(0), | - |
9 | colCount(0), | - |
10 | atEnd(false) | - |
11 | { | - |
12 | }executed 1930 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 1930 |
13 | | - |
14 | void QSqlCachedResultPrivate::cleanup() | - |
15 | { | - |
16 | cache.clear(); | - |
17 | atEnd = false; | - |
18 | colCount = 0; | - |
19 | rowCacheEnd = 0; | - |
20 | }executed 8636 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 8636 |
21 | | - |
22 | void QSqlCachedResultPrivate::init(int count, bool fo) | - |
23 | { | - |
24 | ((!(count)) ? qt_assert("count",__FILE__,81) : qt_noop()); | - |
25 | cleanup(); | - |
26 | forwardOnly = fo; | - |
27 | colCount = count; | - |
28 | if (foTRUE | evaluated 639 times by 9 testsEvaluated by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 485 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) { | 485-639 |
29 | cache.resize(count); | - |
30 | rowCacheEnd = count; | - |
31 | }executed 639 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
else { | 639 |
32 | cache.resize(initial_cache_size * count); | - |
33 | }executed 485 times by 8 tests: end of block Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 485 |
34 | } | - |
35 | | - |
36 | int QSqlCachedResultPrivate::nextIndex() | - |
37 | { | - |
38 | if (forwardOnlyTRUE | evaluated 2237 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 34599 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) | 2237-34599 |
39 | returnexecuted 2237 times by 8 tests: return 0; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
0;executed 2237 times by 8 tests: return 0; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 2237 |
40 | int newIdx = rowCacheEnd; | - |
41 | if (newIdx + colCount > cache.size()TRUE | evaluated 244 times by 3 testsEvaluated by:- tst_QItemModel
- tst_QSqlQueryModel
- tst_QSqlTableModel
| FALSE | evaluated 34355 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) | 244-34355 |
42 | cache.resize(qMin(cache.size() * 2, cache.size() + 10000));executed 244 times by 3 tests: cache.resize(qMin(cache.size() * 2, cache.size() + 10000)); Executed by:- tst_QItemModel
- tst_QSqlQueryModel
- tst_QSqlTableModel
| 244 |
43 | rowCacheEnd += colCount; | - |
44 | | - |
45 | returnexecuted 34599 times by 8 tests: return newIdx; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
newIdx;executed 34599 times by 8 tests: return newIdx; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 34599 |
46 | } | - |
47 | | - |
48 | bool QSqlCachedResultPrivate::canSeek(int i) const | - |
49 | { | - |
50 | if (forwardOnlyTRUE | evaluated 2238 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 3388 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
|| i < 0TRUE | never evaluated | FALSE | evaluated 3388 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) | 0-3388 |
51 | returnexecuted 2238 times by 8 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
false;executed 2238 times by 8 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 2238 |
52 | returnexecuted 3388 times by 8 tests: return rowCacheEnd >= (i + 1) * colCount; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
rowCacheEnd >= (i + 1) * colCount;executed 3388 times by 8 tests: return rowCacheEnd >= (i + 1) * colCount; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 3388 |
53 | } | - |
54 | | - |
55 | void QSqlCachedResultPrivate::revertLast() | - |
56 | { | - |
57 | if (forwardOnlyTRUE | evaluated 558 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 280 times by 6 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) | 280-558 |
58 | return;executed 558 times by 8 tests: return; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 558 |
59 | rowCacheEnd -= colCount; | - |
60 | }executed 280 times by 6 tests: end of block Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 280 |
61 | | - |
62 | inline int QSqlCachedResultPrivate::cacheCount() const | - |
63 | { | - |
64 | ((!(!forwardOnly)) ? qt_assert("!forwardOnly",__FILE__,121) : qt_noop()); | - |
65 | ((!(colCount)) ? qt_assert("colCount",__FILE__,122) : qt_noop()); | - |
66 | returnexecuted 17 times by 3 tests: return rowCacheEnd / colCount; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
rowCacheEnd / colCount;executed 17 times by 3 tests: return rowCacheEnd / colCount; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
| 17 |
67 | } | - |
68 | | - |
69 | | - |
70 | | - |
71 | QSqlCachedResult::QSqlCachedResult(QSqlCachedResultPrivate &d) | - |
72 | : QSqlResult(d) | - |
73 | { | - |
74 | }executed 1930 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 1930 |
75 | | - |
76 | void QSqlCachedResult::init(int colCount) | - |
77 | { | - |
78 | QSqlCachedResultPrivate * const d = d_func(); | - |
79 | d->init(colCount, isForwardOnly()); | - |
80 | }executed 1124 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 1124 |
81 | | - |
82 | bool QSqlCachedResult::fetch(int i) | - |
83 | { | - |
84 | QSqlCachedResultPrivate * const d = d_func(); | - |
85 | if ((TRUE | never evaluated | FALSE | evaluated 2662 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
!isActive())TRUE | never evaluated | FALSE | evaluated 2662 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
|| (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2660 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
i < 0)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 2660 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
) | 0-2662 |
86 | returnexecuted 2 times by 1 test: return false; false;executed 2 times by 1 test: return false; | 2 |
87 | if (at() == iTRUE | evaluated 1716 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| FALSE | evaluated 944 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
) | 944-1716 |
88 | returnexecuted 1716 times by 5 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
true;executed 1716 times by 5 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| 1716 |
89 | if (d->forwardOnlyTRUE | evaluated 1 time by 1 test | FALSE | evaluated 943 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
) { | 1-943 |
90 | | - |
91 | if (at() > iTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
|| at() == QSql::AfterLastRowTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
92 | return never executed: return false; false;never executed: return false; | 0 |
93 | while(at() < i - 1TRUE | evaluated 3 times by 1 test | FALSE | evaluated 1 time by 1 test |
) { | 1-3 |
94 | if (!gotoNext(d->cache, -1)TRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
) | 0-3 |
95 | return never executed: return false; false;never executed: return false; | 0 |
96 | setAt(at() + 1); | - |
97 | }executed 3 times by 1 test: end of block | 3 |
98 | if (!gotoNext(d->cache, 0)TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
99 | return never executed: return false; false;never executed: return false; | 0 |
100 | setAt(at() + 1); | - |
101 | returnexecuted 1 time by 1 test: return true; true;executed 1 time by 1 test: return true; | 1 |
102 | } | - |
103 | if (d->canSeek(i)TRUE | evaluated 539 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| FALSE | evaluated 404 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
) { | 404-539 |
104 | setAt(i); | - |
105 | returnexecuted 539 times by 5 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
true;executed 539 times by 5 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| 539 |
106 | } | - |
107 | if (d->rowCacheEnd > 0TRUE | evaluated 13 times by 3 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
| FALSE | evaluated 391 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
) | 13-391 |
108 | setAt(d->cacheCount());executed 13 times by 3 tests: setAt(d->cacheCount()); Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
| 13 |
109 | while (at() < i + 1TRUE | evaluated 34438 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| FALSE | evaluated 132 times by 4 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlTableModel
|
) { | 132-34438 |
110 | if (!cacheNext()TRUE | evaluated 272 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| FALSE | evaluated 34166 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
) { | 272-34166 |
111 | if (d->canSeek(i)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 270 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
|
) | 2-270 |
112 | break;executed 2 times by 1 test: break; | 2 |
113 | returnexecuted 270 times by 5 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
false;executed 270 times by 5 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| 270 |
114 | } | - |
115 | }executed 34166 times by 5 tests: end of block Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| 34166 |
116 | setAt(i); | - |
117 | | - |
118 | returnexecuted 134 times by 4 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlTableModel
true;executed 134 times by 4 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlTableModel
| 134 |
119 | } | - |
120 | | - |
121 | bool QSqlCachedResult::fetchNext() | - |
122 | { | - |
123 | QSqlCachedResultPrivate * const d = d_func(); | - |
124 | if (d->canSeek(at() + 1)TRUE | evaluated 1750 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| FALSE | evaluated 1958 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) { | 1750-1958 |
125 | setAt(at() + 1); | - |
126 | returnexecuted 1750 times by 5 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
true;executed 1750 times by 5 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| 1750 |
127 | } | - |
128 | returnexecuted 1958 times by 8 tests: return cacheNext(); Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
cacheNext();executed 1958 times by 8 tests: return cacheNext(); Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 1958 |
129 | } | - |
130 | | - |
131 | bool QSqlCachedResult::fetchPrevious() | - |
132 | { | - |
133 | returnexecuted 40 times by 3 tests: return fetch(at() - 1); Executed by:- tst_QSqlQuery
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
fetch(at() - 1);executed 40 times by 3 tests: return fetch(at() - 1); Executed by:- tst_QSqlQuery
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| 40 |
134 | } | - |
135 | | - |
136 | bool QSqlCachedResult::fetchFirst() | - |
137 | { | - |
138 | QSqlCachedResultPrivate * const d = d_func(); | - |
139 | if (d->forwardOnlyTRUE | evaluated 615 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 88 times by 4 testsEvaluated by:- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlThread
|
&& at() != QSql::BeforeFirstRowTRUE | never evaluated | FALSE | evaluated 615 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) { | 0-615 |
140 | return never executed: return false; false;never executed: return false; | 0 |
141 | } | - |
142 | if (d->canSeek(0)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 702 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) { | 1-702 |
143 | setAt(0); | - |
144 | returnexecuted 1 time by 1 test: return true; true;executed 1 time by 1 test: return true; | 1 |
145 | } | - |
146 | returnexecuted 702 times by 8 tests: return cacheNext(); Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
cacheNext();executed 702 times by 8 tests: return cacheNext(); Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 702 |
147 | } | - |
148 | | - |
149 | bool QSqlCachedResult::fetchLast() | - |
150 | { | - |
151 | QSqlCachedResultPrivate * const d = d_func(); | - |
152 | if (d->atEndTRUE | evaluated 4 times by 1 test | FALSE | evaluated 6 times by 1 test |
) { | 4-6 |
153 | if (d->forwardOnlyTRUE | never evaluated | FALSE | evaluated 4 times by 1 test |
) | 0-4 |
154 | return never executed: return false; false;never executed: return false; | 0 |
155 | else | - |
156 | returnexecuted 4 times by 1 test: return fetch(d->cacheCount() - 1); fetch(d->cacheCount() - 1);executed 4 times by 1 test: return fetch(d->cacheCount() - 1); | 4 |
157 | } | - |
158 | | - |
159 | int i = at(); | - |
160 | while (fetchNext()TRUE | evaluated 22 times by 1 test | FALSE | evaluated 6 times by 1 test |
) | 6-22 |
161 | ++executed 22 times by 1 test: ++i; i;executed 22 times by 1 test: ++i; | 22 |
162 | if (d->forwardOnlyTRUE | evaluated 2 times by 1 test | FALSE | evaluated 4 times by 1 test |
&& at() == QSql::AfterLastRowTRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) { | 0-4 |
163 | setAt(i); | - |
164 | returnexecuted 2 times by 1 test: return true; true;executed 2 times by 1 test: return true; | 2 |
165 | } else { | - |
166 | returnexecuted 4 times by 1 test: return fetch(i); fetch(i);executed 4 times by 1 test: return fetch(i); | 4 |
167 | } | - |
168 | } | - |
169 | | - |
170 | QVariant QSqlCachedResult::data(int i) | - |
171 | { | - |
172 | const QSqlCachedResultPrivate * const d = d_func(); | - |
173 | int idx = d->forwardOnlyTRUE | evaluated 5649 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 3489 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
? i : at() * d->colCount + i; | 3489-5649 |
174 | if (i >= d->colCountTRUE | never evaluated | FALSE | evaluated 9138 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
|| i < 0TRUE | never evaluated | FALSE | evaluated 9138 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
|| at() < 0TRUE | never evaluated | FALSE | evaluated 9138 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
|| idx >= d->rowCacheEndTRUE | never evaluated | FALSE | evaluated 9138 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) | 0-9138 |
175 | return never executed: return QVariant(); QVariant();never executed: return QVariant(); | 0 |
176 | | - |
177 | returnexecuted 9138 times by 8 tests: return d->cache.at(idx); Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
d->cache.at(idx);executed 9138 times by 8 tests: return d->cache.at(idx); Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 9138 |
178 | } | - |
179 | | - |
180 | bool QSqlCachedResult::isNull(int i) | - |
181 | { | - |
182 | const QSqlCachedResultPrivate * const d = d_func(); | - |
183 | int idx = d->forwardOnlyTRUE | never evaluated | FALSE | evaluated 10 times by 1 test |
? i : at() * d->colCount + i; | 0-10 |
184 | if (i >= d->colCountTRUE | evaluated 1 time by 1 test | FALSE | evaluated 9 times by 1 test |
|| i < 0TRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
|| at() < 0TRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
|| idx >= d->rowCacheEndTRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
) | 0-9 |
185 | returnexecuted 1 time by 1 test: return true; true;executed 1 time by 1 test: return true; | 1 |
186 | | - |
187 | returnexecuted 9 times by 1 test: return d->cache.at(idx).isNull(); d->cache.at(idx).isNull();executed 9 times by 1 test: return d->cache.at(idx).isNull(); | 9 |
188 | } | - |
189 | | - |
190 | void QSqlCachedResult::cleanup() | - |
191 | { | - |
192 | QSqlCachedResultPrivate * const d = d_func(); | - |
193 | setAt(QSql::BeforeFirstRow); | - |
194 | setActive(false); | - |
195 | d->cleanup(); | - |
196 | }executed 7512 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 7512 |
197 | | - |
198 | void QSqlCachedResult::clearValues() | - |
199 | { | - |
200 | QSqlCachedResultPrivate * const d = d_func(); | - |
201 | setAt(QSql::BeforeFirstRow); | - |
202 | d->rowCacheEnd = 0; | - |
203 | d->atEnd = false; | - |
204 | }executed 119111 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 119111 |
205 | | - |
206 | bool QSqlCachedResult::cacheNext() | - |
207 | { | - |
208 | QSqlCachedResultPrivate * const d = d_func(); | - |
209 | if (d->atEndTRUE | evaluated 262 times by 5 testsEvaluated by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| FALSE | evaluated 36836 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) | 262-36836 |
210 | returnexecuted 262 times by 5 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
false;executed 262 times by 5 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
| 262 |
211 | | - |
212 | if(isForwardOnly()TRUE | evaluated 2237 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 34599 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) { | 2237-34599 |
213 | d->cache.resize(d->colCount); | - |
214 | }executed 2237 times by 8 tests: end of block Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 2237 |
215 | | - |
216 | if (!gotoNext(d->cache, d->nextIndex())TRUE | evaluated 838 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| FALSE | evaluated 35998 times by 8 testsEvaluated by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
|
) { | 838-35998 |
217 | d->revertLast(); | - |
218 | d->atEnd = true; | - |
219 | returnexecuted 838 times by 8 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
false;executed 838 times by 8 tests: return false; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 838 |
220 | } | - |
221 | setAt(at() + 1); | - |
222 | returnexecuted 35998 times by 8 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
true;executed 35998 times by 8 tests: return true; Executed by:- tst_QItemModel
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 35998 |
223 | } | - |
224 | | - |
225 | int QSqlCachedResult::colCount() const | - |
226 | { | - |
227 | const QSqlCachedResultPrivate * const d = d_func(); | - |
228 | return never executed: return d->colCount; d->colCount;never executed: return d->colCount; | 0 |
229 | } | - |
230 | | - |
231 | QSqlCachedResult::ValueCache &QSqlCachedResult::cache() | - |
232 | { | - |
233 | QSqlCachedResultPrivate * const d = d_func(); | - |
234 | return never executed: return d->cache; d->cache;never executed: return d->cache; | 0 |
235 | } | - |
236 | | - |
237 | void QSqlCachedResult::virtual_hook(int id, void *data) | - |
238 | { | - |
239 | QSqlResult::virtual_hook(id, data); | - |
240 | } never executed: end of block | 0 |
241 | | - |
242 | void QSqlCachedResult::detachFromResultSet() | - |
243 | { | - |
244 | cleanup(); | - |
245 | } never executed: end of block | 0 |
246 | | - |
247 | void QSqlCachedResult::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy) | - |
248 | { | - |
249 | QSqlResult::setNumericalPrecisionPolicy(policy); | - |
250 | cleanup(); | - |
251 | }executed 2794 times by 9 tests: end of block Executed by:- tst_QItemModel
- tst_QSql
- tst_QSqlDatabase
- tst_QSqlDriver
- tst_QSqlQuery
- tst_QSqlQueryModel
- tst_QSqlRelationalTableModel
- tst_QSqlTableModel
- tst_QSqlThread
| 2794 |
252 | | - |
253 | | - |
254 | | - |
| | |