@@ -20,13 +20,12 void TestVariable::testNotInCacheRangeList() | |||
|
20 | 20 | auto varRS = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 20, 0}}; |
|
21 | 21 | auto varRE = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 40, 0}}; |
|
22 | 22 | |
|
23 | auto sqpR = SqpRange{static_cast<double>(varRS.toMSecsSinceEpoch()), | |
|
24 | static_cast<double>(varRE.toMSecsSinceEpoch())}; | |
|
23 | auto sqpR = SqpRange{DateUtils::secondsSinceEpoch(varRS), DateUtils::secondsSinceEpoch(varRE)}; | |
|
25 | 24 | |
|
26 | 25 | auto varCRS = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 0, 0}}; |
|
27 | 26 | auto varCRE = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}}; |
|
28 | auto sqpCR = SqpRange{static_cast<double>(varCRS.toMSecsSinceEpoch()), | |
|
29 | static_cast<double>(varCRE.toMSecsSinceEpoch())}; | |
|
27 | auto sqpCR | |
|
28 | = SqpRange{DateUtils::secondsSinceEpoch(varCRS), DateUtils::secondsSinceEpoch(varCRE)}; | |
|
30 | 29 | |
|
31 | 30 | Variable var{"Var test", sqpR}; |
|
32 | 31 | var.setCacheRange(sqpCR); |
@@ -34,8 +33,7 void TestVariable::testNotInCacheRangeList() | |||
|
34 | 33 | // 1: [ts,te] < varTS |
|
35 | 34 | auto ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
36 | 35 | auto te = QDateTime{QDate{2017, 01, 01}, QTime{2, 1, 0, 0}}; |
|
37 | auto sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
38 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
36 | auto sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
39 | 37 | |
|
40 | 38 | auto notInCach = var.provideNotInCacheRangeList(sqp); |
|
41 | 39 | |
@@ -43,25 +41,23 void TestVariable::testNotInCacheRangeList() | |||
|
43 | 41 | |
|
44 | 42 | auto notInCachRange = notInCach.first(); |
|
45 | 43 | |
|
46 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
47 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
44 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
45 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
48 | 46 | |
|
49 | 47 | // 2: ts < varTS < te < varTE |
|
50 | 48 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
51 | 49 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}}; |
|
52 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
53 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
50 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
54 | 51 | notInCach = var.provideNotInCacheRangeList(sqp); |
|
55 | 52 | QCOMPARE(notInCach.size(), 1); |
|
56 | 53 | notInCachRange = notInCach.first(); |
|
57 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
58 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
54 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
55 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(varCRS)); | |
|
59 | 56 | |
|
60 | 57 | // 3: varTS < ts < te < varTE |
|
61 | 58 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 20, 0}}; |
|
62 | 59 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}}; |
|
63 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
64 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
60 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
65 | 61 | notInCach = var.provideNotInCacheRangeList(sqp); |
|
66 | 62 | QCOMPARE(notInCach.size(), 0); |
|
67 | 63 | |
@@ -69,38 +65,35 void TestVariable::testNotInCacheRangeList() | |||
|
69 | 65 | // 4: varTS < ts < varTE < te |
|
70 | 66 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 20, 0}}; |
|
71 | 67 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
72 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
73 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
68 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
74 | 69 | notInCach = var.provideNotInCacheRangeList(sqp); |
|
75 | 70 | QCOMPARE(notInCach.size(), 1); |
|
76 | 71 | notInCachRange = notInCach.first(); |
|
77 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
78 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
72 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(varCRE)); | |
|
73 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
79 | 74 | |
|
80 | 75 | // 5: varTS < varTE < ts < te |
|
81 | 76 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 20, 0}}; |
|
82 | 77 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
83 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
84 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
78 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
85 | 79 | notInCach = var.provideNotInCacheRangeList(sqp); |
|
86 | 80 | QCOMPARE(notInCach.size(), 1); |
|
87 | 81 | notInCachRange = notInCach.first(); |
|
88 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
89 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
82 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
83 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
90 | 84 | |
|
91 | 85 | // 6: ts <varTS < varTE < te |
|
92 | 86 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 1, 0, 0}}; |
|
93 | 87 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
94 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
95 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
88 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
96 | 89 | notInCach = var.provideNotInCacheRangeList(sqp); |
|
97 | 90 | QCOMPARE(notInCach.size(), 2); |
|
98 | 91 | notInCachRange = notInCach.first(); |
|
99 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
100 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
92 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
93 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(varCRS)); | |
|
101 | 94 | notInCachRange = notInCach[1]; |
|
102 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
103 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
95 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(varCRE)); | |
|
96 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
104 | 97 | } |
|
105 | 98 | |
|
106 | 99 | |
@@ -109,13 +102,12 void TestVariable::testInCacheRangeList() | |||
|
109 | 102 | auto varRS = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 20, 0}}; |
|
110 | 103 | auto varRE = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 40, 0}}; |
|
111 | 104 | |
|
112 | auto sqpR = SqpRange{static_cast<double>(varRS.toMSecsSinceEpoch()), | |
|
113 | static_cast<double>(varRE.toMSecsSinceEpoch())}; | |
|
105 | auto sqpR = SqpRange{DateUtils::secondsSinceEpoch(varRS), DateUtils::secondsSinceEpoch(varRE)}; | |
|
114 | 106 | |
|
115 | 107 | auto varCRS = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 0, 0}}; |
|
116 | 108 | auto varCRE = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}}; |
|
117 | auto sqpCR = SqpRange{static_cast<double>(varCRS.toMSecsSinceEpoch()), | |
|
118 | static_cast<double>(varCRE.toMSecsSinceEpoch())}; | |
|
109 | auto sqpCR | |
|
110 | = SqpRange{DateUtils::secondsSinceEpoch(varCRS), DateUtils::secondsSinceEpoch(varCRE)}; | |
|
119 | 111 | |
|
120 | 112 | Variable var{"Var test", sqpR}; |
|
121 | 113 | var.setCacheRange(sqpCR); |
@@ -123,8 +115,7 void TestVariable::testInCacheRangeList() | |||
|
123 | 115 | // 1: [ts,te] < varTS |
|
124 | 116 | auto ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
125 | 117 | auto te = QDateTime{QDate{2017, 01, 01}, QTime{2, 1, 0, 0}}; |
|
126 | auto sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
127 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
118 | auto sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
128 | 119 | |
|
129 | 120 | auto notInCach = var.provideInCacheRangeList(sqp); |
|
130 | 121 | |
@@ -133,54 +124,49 void TestVariable::testInCacheRangeList() | |||
|
133 | 124 | // 2: ts < varTS < te < varTE |
|
134 | 125 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
135 | 126 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}}; |
|
136 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
137 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
127 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
138 | 128 | notInCach = var.provideInCacheRangeList(sqp); |
|
139 | 129 | QCOMPARE(notInCach.size(), 1); |
|
140 | 130 | auto notInCachRange = notInCach.first(); |
|
141 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
142 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
131 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(varCRS)); | |
|
132 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
143 | 133 | |
|
144 | 134 | // 3: varTS < ts < te < varTE |
|
145 | 135 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 20, 0}}; |
|
146 | 136 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}}; |
|
147 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
148 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
137 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
149 | 138 | notInCach = var.provideInCacheRangeList(sqp); |
|
150 | 139 | QCOMPARE(notInCach.size(), 1); |
|
151 | 140 | notInCachRange = notInCach.first(); |
|
152 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
153 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
141 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
142 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
154 | 143 | |
|
155 | 144 | // 4: varTS < ts < varTE < te |
|
156 | 145 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 20, 0}}; |
|
157 | 146 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
158 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
159 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
147 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
160 | 148 | notInCach = var.provideInCacheRangeList(sqp); |
|
161 | 149 | QCOMPARE(notInCach.size(), 1); |
|
162 | 150 | notInCachRange = notInCach.first(); |
|
163 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
164 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
151 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
152 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(varCRE)); | |
|
165 | 153 | |
|
166 | 154 | // 5: varTS < varTE < ts < te |
|
167 | 155 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 20, 0}}; |
|
168 | 156 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
169 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
170 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
157 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
171 | 158 | notInCach = var.provideInCacheRangeList(sqp); |
|
172 | 159 | QCOMPARE(notInCach.size(), 0); |
|
173 | 160 | |
|
174 | 161 | // 6: ts <varTS < varTE < te |
|
175 | 162 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 1, 0, 0}}; |
|
176 | 163 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
177 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
178 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
164 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
179 | 165 | notInCach = var.provideInCacheRangeList(sqp); |
|
180 | 166 | QCOMPARE(notInCach.size(), 1); |
|
181 | 167 | notInCachRange = notInCach.first(); |
|
182 |
QCOMPARE(notInCachRange.m_TStart, |
|
|
183 |
QCOMPARE(notInCachRange.m_TEnd, |
|
|
168 | QCOMPARE(notInCachRange.m_TStart, DateUtils::secondsSinceEpoch(varCRS)); | |
|
169 | QCOMPARE(notInCachRange.m_TEnd, DateUtils::secondsSinceEpoch(varCRE)); | |
|
184 | 170 | } |
|
185 | 171 | |
|
186 | 172 |
@@ -22,18 +22,15 void TestVariableCacheController::testProvideNotInCacheDateTimeList() | |||
|
22 | 22 | |
|
23 | 23 | auto ts0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 0, 0}}; |
|
24 | 24 | auto te0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}}; |
|
25 | auto sqp0 = SqpRange{static_cast<double>(ts0.toMSecsSinceEpoch()), | |
|
26 | static_cast<double>(te0.toMSecsSinceEpoch())}; | |
|
25 | auto sqp0 = SqpRange{DateUtils::secondsSinceEpoch(ts0), DateUtils::secondsSinceEpoch(te0)}; | |
|
27 | 26 | |
|
28 | 27 | auto ts1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 6, 0, 0}}; |
|
29 | 28 | auto te1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 8, 0, 0}}; |
|
30 | auto sqp1 = SqpRange{static_cast<double>(ts1.toMSecsSinceEpoch()), | |
|
31 | static_cast<double>(te1.toMSecsSinceEpoch())}; | |
|
29 | auto sqp1 = SqpRange{DateUtils::secondsSinceEpoch(ts1), DateUtils::secondsSinceEpoch(te1)}; | |
|
32 | 30 | |
|
33 | 31 | auto ts2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 18, 0, 0}}; |
|
34 | 32 | auto te2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 20, 0, 0}}; |
|
35 | auto sqp2 = SqpRange{static_cast<double>(ts2.toMSecsSinceEpoch()), | |
|
36 | static_cast<double>(te2.toMSecsSinceEpoch())}; | |
|
33 | auto sqp2 = SqpRange{DateUtils::secondsSinceEpoch(ts2), DateUtils::secondsSinceEpoch(te2)}; | |
|
37 | 34 | |
|
38 | 35 | auto var0 = std::make_shared<Variable>("", sqp0); |
|
39 | 36 | |
@@ -44,210 +41,197 void TestVariableCacheController::testProvideNotInCacheDateTimeList() | |||
|
44 | 41 | // first case [ts,te] < ts0 |
|
45 | 42 | auto ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
46 | 43 | auto te = QDateTime{QDate{2017, 01, 01}, QTime{2, 1, 0, 0}}; |
|
47 | auto sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
48 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
44 | auto sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
49 | 45 | |
|
50 | 46 | |
|
51 | 47 | auto notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
52 | 48 | |
|
53 | 49 | QCOMPARE(notInCach.size(), 1); |
|
54 | 50 | auto notInCacheSqp = notInCach.first(); |
|
55 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
56 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
51 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
52 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
57 | 53 | |
|
58 | 54 | |
|
59 | 55 | // second case ts < ts0 && ts0 < te <= te0 |
|
60 | 56 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
61 | 57 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}}; |
|
62 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
63 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
58 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
64 | 59 | |
|
65 | 60 | |
|
66 | 61 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
67 | 62 | |
|
68 | 63 | QCOMPARE(notInCach.size(), 1); |
|
69 | 64 | notInCacheSqp = notInCach.first(); |
|
70 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
71 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
65 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
66 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0)); | |
|
72 | 67 | |
|
73 | 68 | // 3th case ts < ts0 && te0 < te <= ts1 |
|
74 | 69 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
75 | 70 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
76 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
77 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
71 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
78 | 72 | |
|
79 | 73 | |
|
80 | 74 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
81 | 75 | |
|
82 | 76 | QCOMPARE(notInCach.size(), 2); |
|
83 | 77 | notInCacheSqp = notInCach.first(); |
|
84 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
85 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
78 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
79 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0)); | |
|
86 | 80 | |
|
87 | 81 | notInCacheSqp = notInCach.at(1); |
|
88 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
89 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
82 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0)); | |
|
83 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
90 | 84 | |
|
91 | 85 | // 4th case ts < ts0 && ts1 < te <= te1 |
|
92 | 86 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
93 | 87 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 7, 0, 0}}; |
|
94 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
95 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
88 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
96 | 89 | |
|
97 | 90 | |
|
98 | 91 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
99 | 92 | |
|
100 | 93 | QCOMPARE(notInCach.size(), 2); |
|
101 | 94 | notInCacheSqp = notInCach.first(); |
|
102 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
103 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
95 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
96 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0)); | |
|
104 | 97 | |
|
105 | 98 | notInCacheSqp = notInCach.at(1); |
|
106 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
107 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
99 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0)); | |
|
100 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1)); | |
|
108 | 101 | |
|
109 | 102 | // 5th case ts < ts0 && te3 < te |
|
110 | 103 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}}; |
|
111 | 104 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 22, 0, 0}}; |
|
112 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
113 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
105 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
114 | 106 | |
|
115 | 107 | |
|
116 | 108 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
117 | 109 | |
|
118 | 110 | QCOMPARE(notInCach.size(), 4); |
|
119 | 111 | notInCacheSqp = notInCach.first(); |
|
120 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
121 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
112 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
113 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0)); | |
|
122 | 114 | |
|
123 | 115 | notInCacheSqp = notInCach.at(1); |
|
124 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
125 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
116 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0)); | |
|
117 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1)); | |
|
126 | 118 | |
|
127 | 119 | notInCacheSqp = notInCach.at(2); |
|
128 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
129 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
120 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te1)); | |
|
121 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts2)); | |
|
130 | 122 | |
|
131 | 123 | notInCacheSqp = notInCach.at(3); |
|
132 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
133 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
124 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te2)); | |
|
125 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
134 | 126 | |
|
135 | 127 | |
|
136 | 128 | // 6th case ts2 < ts |
|
137 | 129 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 45, 0, 0}}; |
|
138 | 130 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 47, 0, 0}}; |
|
139 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
140 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
131 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
141 | 132 | |
|
142 | 133 | |
|
143 | 134 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
144 | 135 | |
|
145 | 136 | QCOMPARE(notInCach.size(), 1); |
|
146 | 137 | notInCacheSqp = notInCach.first(); |
|
147 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
148 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
138 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
139 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
149 | 140 | |
|
150 | 141 | // 7th case ts = te0 && te < ts1 |
|
151 | 142 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}}; |
|
152 | 143 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
153 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
154 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
144 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
155 | 145 | |
|
156 | 146 | |
|
157 | 147 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
158 | 148 | |
|
159 | 149 | QCOMPARE(notInCach.size(), 1); |
|
160 | 150 | notInCacheSqp = notInCach.first(); |
|
161 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
162 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
151 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0)); | |
|
152 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
163 | 153 | |
|
164 | 154 | // 8th case ts0 < ts < te0 && te < ts1 |
|
165 | 155 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}}; |
|
166 | 156 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
167 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
168 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
157 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
169 | 158 | |
|
170 | 159 | |
|
171 | 160 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
172 | 161 | |
|
173 | 162 | QCOMPARE(notInCach.size(), 1); |
|
174 | 163 | notInCacheSqp = notInCach.first(); |
|
175 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
176 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
164 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0)); | |
|
165 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
177 | 166 | |
|
178 | 167 | // 9th case ts0 < ts < te0 && ts1 < te < te1 |
|
179 | 168 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}}; |
|
180 | 169 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 7, 0, 0}}; |
|
181 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
182 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
170 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
183 | 171 | |
|
184 | 172 | |
|
185 | 173 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
186 | 174 | |
|
187 | 175 | QCOMPARE(notInCach.size(), 1); |
|
188 | 176 | notInCacheSqp = notInCach.first(); |
|
189 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
190 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
177 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0)); | |
|
178 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1)); | |
|
191 | 179 | |
|
192 | 180 | // 10th case te1 < ts < te < ts2 |
|
193 | 181 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 9, 0, 0}}; |
|
194 | 182 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 10, 0, 0}}; |
|
195 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
196 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
183 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
197 | 184 | |
|
198 | 185 | |
|
199 | 186 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
200 | 187 | |
|
201 | 188 | QCOMPARE(notInCach.size(), 1); |
|
202 | 189 | notInCacheSqp = notInCach.first(); |
|
203 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
204 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
190 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
191 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
205 | 192 | |
|
206 | 193 | // 11th case te0 < ts < ts1 && te3 < te |
|
207 | 194 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
208 | 195 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 47, 0, 0}}; |
|
209 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
210 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
196 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
211 | 197 | |
|
212 | 198 | |
|
213 | 199 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
214 | 200 | |
|
215 | 201 | QCOMPARE(notInCach.size(), 3); |
|
216 | 202 | notInCacheSqp = notInCach.first(); |
|
217 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
218 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
203 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
204 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1)); | |
|
219 | 205 | |
|
220 | 206 | notInCacheSqp = notInCach.at(1); |
|
221 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
222 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
207 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te1)); | |
|
208 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts2)); | |
|
223 | 209 | |
|
224 | 210 | notInCacheSqp = notInCach.at(2); |
|
225 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
226 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
211 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te2)); | |
|
212 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
227 | 213 | |
|
228 | 214 | // 12th case te0 < ts < ts1 && te3 < te |
|
229 | 215 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}}; |
|
230 | 216 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 10, 0, 0}}; |
|
231 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
232 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
217 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
233 | 218 | |
|
234 | 219 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
235 | 220 | |
|
236 | 221 | QCOMPARE(notInCach.size(), 2); |
|
237 | 222 | notInCacheSqp = notInCach.first(); |
|
238 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
239 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
223 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts)); | |
|
224 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1)); | |
|
240 | 225 | |
|
241 | 226 | notInCacheSqp = notInCach.at(1); |
|
242 |
QCOMPARE(notInCacheSqp.m_TStart, |
|
|
243 |
QCOMPARE(notInCacheSqp.m_TEnd, |
|
|
227 | QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te1)); | |
|
228 | QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te)); | |
|
244 | 229 | |
|
245 | 230 | |
|
246 | 231 | // 12th case ts0 < ts < te0 |
|
247 | 232 | ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 10, 0}}; |
|
248 | 233 | te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 50, 0}}; |
|
249 | sqp = SqpRange{static_cast<double>(ts.toMSecsSinceEpoch()), | |
|
250 | static_cast<double>(te.toMSecsSinceEpoch())}; | |
|
234 | sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)}; | |
|
251 | 235 | |
|
252 | 236 | notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp); |
|
253 | 237 | QCOMPARE(notInCach.size(), 0); |
@@ -260,33 +244,27 void TestVariableCacheController::testAddDateTime() | |||
|
260 | 244 | |
|
261 | 245 | auto ts0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 0, 0}}; |
|
262 | 246 | auto te0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}}; |
|
263 | auto sqp0 = SqpRange{static_cast<double>(ts0.toMSecsSinceEpoch()), | |
|
264 | static_cast<double>(te0.toMSecsSinceEpoch())}; | |
|
247 | auto sqp0 = SqpRange{DateUtils::secondsSinceEpoch(ts0), DateUtils::secondsSinceEpoch(te0)}; | |
|
265 | 248 | |
|
266 | 249 | auto ts1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 6, 0, 0}}; |
|
267 | 250 | auto te1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 8, 0, 0}}; |
|
268 | auto sqp1 = SqpRange{static_cast<double>(ts1.toMSecsSinceEpoch()), | |
|
269 | static_cast<double>(te1.toMSecsSinceEpoch())}; | |
|
251 | auto sqp1 = SqpRange{DateUtils::secondsSinceEpoch(ts1), DateUtils::secondsSinceEpoch(te1)}; | |
|
270 | 252 | |
|
271 | 253 | auto ts2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 18, 0, 0}}; |
|
272 | 254 | auto te2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 20, 0, 0}}; |
|
273 | auto sqp2 = SqpRange{static_cast<double>(ts2.toMSecsSinceEpoch()), | |
|
274 | static_cast<double>(te2.toMSecsSinceEpoch())}; | |
|
255 | auto sqp2 = SqpRange{DateUtils::secondsSinceEpoch(ts2), DateUtils::secondsSinceEpoch(te2)}; | |
|
275 | 256 | |
|
276 | 257 | auto ts01 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}}; |
|
277 | 258 | auto te01 = QDateTime{QDate{2017, 01, 01}, QTime{2, 6, 0, 0}}; |
|
278 | auto sqp01 = SqpRange{static_cast<double>(ts01.toMSecsSinceEpoch()), | |
|
279 | static_cast<double>(te01.toMSecsSinceEpoch())}; | |
|
259 | auto sqp01 = SqpRange{DateUtils::secondsSinceEpoch(ts01), DateUtils::secondsSinceEpoch(te01)}; | |
|
280 | 260 | |
|
281 | 261 | auto ts3 = QDateTime{QDate{2017, 01, 01}, QTime{2, 14, 0, 0}}; |
|
282 | 262 | auto te3 = QDateTime{QDate{2017, 01, 01}, QTime{2, 16, 0, 0}}; |
|
283 | auto sqp3 = SqpRange{static_cast<double>(ts3.toMSecsSinceEpoch()), | |
|
284 | static_cast<double>(te3.toMSecsSinceEpoch())}; | |
|
263 | auto sqp3 = SqpRange{DateUtils::secondsSinceEpoch(ts3), DateUtils::secondsSinceEpoch(te3)}; | |
|
285 | 264 | |
|
286 | 265 | auto ts03 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}}; |
|
287 | 266 | auto te03 = QDateTime{QDate{2017, 01, 01}, QTime{2, 22, 0, 0}}; |
|
288 | auto sqp03 = SqpRange{static_cast<double>(ts03.toMSecsSinceEpoch()), | |
|
289 | static_cast<double>(te03.toMSecsSinceEpoch())}; | |
|
267 | auto sqp03 = SqpRange{DateUtils::secondsSinceEpoch(ts03), DateUtils::secondsSinceEpoch(te03)}; | |
|
290 | 268 | |
|
291 | 269 | |
|
292 | 270 | auto var0 = std::make_shared<Variable>("", sqp0); |
@@ -297,28 +275,28 void TestVariableCacheController::testAddDateTime() | |||
|
297 | 275 | auto dateCacheList = variableCacheController.dateCacheList(var0); |
|
298 | 276 | QCOMPARE(dateCacheList.count(), 1); |
|
299 | 277 | auto dateCache = dateCacheList.at(0); |
|
300 |
QCOMPARE(dateCache.m_TStart, |
|
|
301 |
QCOMPARE(dateCache.m_TEnd, |
|
|
278 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0)); | |
|
279 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te0)); | |
|
302 | 280 | |
|
303 | 281 | // 2nd case: add a second interval : sqp1 > sqp0 |
|
304 | 282 | variableCacheController.addDateTime(var0, sqp1); |
|
305 | 283 | dateCacheList = variableCacheController.dateCacheList(var0); |
|
306 | 284 | QCOMPARE(dateCacheList.count(), 2); |
|
307 | 285 | dateCache = dateCacheList.at(0); |
|
308 |
QCOMPARE(dateCache.m_TStart, |
|
|
309 |
QCOMPARE(dateCache.m_TEnd, |
|
|
286 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0)); | |
|
287 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te0)); | |
|
310 | 288 | |
|
311 | 289 | dateCache = dateCacheList.at(1); |
|
312 |
QCOMPARE(dateCache.m_TStart, |
|
|
313 |
QCOMPARE(dateCache.m_TEnd, |
|
|
290 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts1)); | |
|
291 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te1)); | |
|
314 | 292 | |
|
315 | 293 | // 3th case: merge sqp0 & sqp1 with sqp01 |
|
316 | 294 | variableCacheController.addDateTime(var0, sqp01); |
|
317 | 295 | dateCacheList = variableCacheController.dateCacheList(var0); |
|
318 | 296 | QCOMPARE(dateCacheList.count(), 1); |
|
319 | 297 | dateCache = dateCacheList.at(0); |
|
320 |
QCOMPARE(dateCache.m_TStart, |
|
|
321 |
QCOMPARE(dateCache.m_TEnd, |
|
|
298 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0)); | |
|
299 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te1)); | |
|
322 | 300 | |
|
323 | 301 | |
|
324 | 302 | // 4th case: add a second interval : sqp1 > sqp0 |
@@ -327,16 +305,16 void TestVariableCacheController::testAddDateTime() | |||
|
327 | 305 | dateCacheList = variableCacheController.dateCacheList(var0); |
|
328 | 306 | QCOMPARE(dateCacheList.count(), 3); |
|
329 | 307 | dateCache = dateCacheList.at(0); |
|
330 |
QCOMPARE(dateCache.m_TStart, |
|
|
331 |
QCOMPARE(dateCache.m_TEnd, |
|
|
308 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0)); | |
|
309 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te1)); | |
|
332 | 310 | |
|
333 | 311 | dateCache = dateCacheList.at(1); |
|
334 |
QCOMPARE(dateCache.m_TStart, |
|
|
335 |
QCOMPARE(dateCache.m_TEnd, |
|
|
312 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts3)); | |
|
313 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te3)); | |
|
336 | 314 | |
|
337 | 315 | dateCache = dateCacheList.at(2); |
|
338 |
QCOMPARE(dateCache.m_TStart, |
|
|
339 |
QCOMPARE(dateCache.m_TEnd, |
|
|
316 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts2)); | |
|
317 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te2)); | |
|
340 | 318 | |
|
341 | 319 | |
|
342 | 320 | // 5th case: merge all interval |
@@ -344,8 +322,8 void TestVariableCacheController::testAddDateTime() | |||
|
344 | 322 | dateCacheList = variableCacheController.dateCacheList(var0); |
|
345 | 323 | QCOMPARE(dateCacheList.count(), 1); |
|
346 | 324 | dateCache = dateCacheList.at(0); |
|
347 |
QCOMPARE(dateCache.m_TStart, |
|
|
348 |
QCOMPARE(dateCache.m_TEnd, |
|
|
325 | QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0)); | |
|
326 | QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te03)); | |
|
349 | 327 | } |
|
350 | 328 | |
|
351 | 329 |
General Comments 0
You need to be logged in to leave comments.
Login now