Auto status change to "Under Review"
@@ -276,32 +276,33 void testSyncCase1WithAborting() | |||||
276 | iterations.push_back({std::make_shared<Synchronize>(0, syncId)}); |
|
276 | iterations.push_back({std::make_shared<Synchronize>(0, syncId)}); | |
277 | iterations.push_back({std::make_shared<Synchronize>(1, syncId)}); |
|
277 | iterations.push_back({std::make_shared<Synchronize>(1, syncId)}); | |
278 |
|
278 | |||
279 |
// Moves var0: ranges of var0, var1 |
|
279 | // Moves var0: ranges of var0, var1 | |
280 |
auto |
|
280 | auto currentRange = range({12, 30}, {13, 30}); | |
281 | iterations.push_back({std::make_shared<Move>(0, newRange), {{0, newRange}, {1, newRange}}}); |
|
281 | iterations.push_back( | |
|
282 | {std::make_shared<Move>(0, currentRange), {{0, currentRange}, {1, currentRange}}}); | |||
282 |
|
283 | |||
283 |
// Moves var |
|
284 | // Moves var0: ranges of var0, var1 | |
284 |
|
|
285 | auto pendingRange = range({13, 0}, {14, 0}); | |
285 | iterations.push_back({std::make_shared<Move>(0, newRange), {{0, newRange}, {1, newRange}}}); |
|
286 | iterations.push_back( | |
|
287 | {std::make_shared<Move>(0, pendingRange), {{0, pendingRange}, {1, pendingRange}}}); | |||
286 |
|
288 | |||
287 |
// Moves var |
|
289 | // Moves var0: ranges of var0, var1 | |
288 |
|
|
290 | pendingRange = range({13, 30}, {14, 30}); | |
289 | iterations.push_back( |
|
291 | iterations.push_back( | |
290 |
{std::make_shared<Move>(0, |
|
292 | {std::make_shared<Move>(0, pendingRange), {{0, pendingRange}, {1, pendingRange}}}); | |
291 |
|
293 | |||
292 |
// |
|
294 | // moves var0: | |
293 | // - ranges of var0 and var1 change |
|
295 | // - ranges of var0 and var1 change | |
294 | // - range of var2 doesn't change anymore |
|
296 | auto var2Range = pendingRange; | |
295 | auto var2Range = newRange; |
|
297 | pendingRange = range({13, 45}, {14, 45}); | |
296 | newRange = range({13, 45}, {14, 45}); |
|
298 | iterations.push_back( | |
297 | iterations.push_back({std::make_shared<Synchronize>(2, syncId, false)}); |
|
299 | {std::make_shared<Move>(0, pendingRange), {{0, pendingRange}, {1, pendingRange}}}); | |
298 | iterations.push_back({std::make_shared<Move>(0, newRange), {{0, newRange}, {1, newRange}}}); |
|
|||
299 |
|
300 | |||
300 | // Shifts var0: although var1 is synchronized with var0, its range doesn't change |
|
301 | // Shifts var0: although var1 is synchronized with var0, its range doesn't change | |
301 |
auto var1Range = |
|
302 | auto var1Range = pendingRange; | |
302 |
|
|
303 | pendingRange = range({14, 45}, {15, 45}); | |
303 | iterations.push_back( |
|
304 | iterations.push_back( | |
304 |
{std::make_shared<Move>(0, |
|
305 | {std::make_shared<Move>(0, pendingRange, false), {{0, pendingRange}, {1, pendingRange}}}); | |
305 |
|
306 | |||
306 | // Moves var0 through several operations: |
|
307 | // Moves var0 through several operations: | |
307 | // - range of var0 changes |
|
308 | // - range of var0 changes | |
@@ -318,15 +319,15 void testSyncCase1WithAborting() | |||||
318 | // {std::make_shared<Move>(0, newRange), {{0, oldRange}, {1, expectedRange}}}); |
|
319 | // {std::make_shared<Move>(0, newRange), {{0, oldRange}, {1, expectedRange}}}); | |
319 |
|
320 | |||
320 | // Pan left |
|
321 | // Pan left | |
321 |
moveVar0(range({14, 30}, {15, 30}), range({1 |
|
322 | moveVar0(range({14, 30}, {15, 30}), range({14, 30}, {15, 30})); | |
322 | // Pan right |
|
323 | // Pan right | |
323 |
moveVar0(range({16, 0}, {17, 0}), range({1 |
|
324 | moveVar0(range({16, 0}, {17, 0}), range({16, 0}, {17, 0})); | |
324 | // Zoom in |
|
325 | // Zoom in | |
325 |
moveVar0(range({16, 30}, {16, 45}), range({1 |
|
326 | moveVar0(range({16, 30}, {16, 45}), range({16, 30}, {16, 45})); | |
326 | // Zoom out |
|
327 | // Zoom out | |
327 |
moveVar0(range({16, 15}, {17, 0}), range({1 |
|
328 | moveVar0(range({16, 15}, {17, 0}), range({16, 15}, {17, 0})); | |
328 |
|
329 | |||
329 |
QTest::newRow("syncWithAborting1") << syncId << |
|
330 | QTest::newRow("syncWithAborting1") << syncId << currentRange << std::move(creations) | |
330 | << std::move(iterations) << 200; |
|
331 | << std::move(iterations) << 200; | |
331 | } |
|
332 | } | |
332 |
|
333 | |||
@@ -509,6 +510,7 void TestVariableSync::testSyncWithAborting() | |||||
509 | // Compares variable's range to the expected range |
|
510 | // Compares variable's range to the expected range | |
510 | QVERIFY(variable != nullptr); |
|
511 | QVERIFY(variable != nullptr); | |
511 | auto range = variable->range(); |
|
512 | auto range = variable->range(); | |
|
513 | qInfo() << "range vs expected range" << range << variable->range(); | |||
512 | QCOMPARE(range, expectedRange); |
|
514 | QCOMPARE(range, expectedRange); | |
513 |
|
515 | |||
514 | // Compares variable's data with values expected for its range |
|
516 | // Compares variable's data with values expected for its range |
@@ -144,6 +144,7 void TestCosinusAcquisition::testAcquisition() | |||||
144 | auto validateVariable |
|
144 | auto validateVariable | |
145 | = [dataSeries](std::shared_ptr<Variable> variable, const SqpRange &range) { |
|
145 | = [dataSeries](std::shared_ptr<Variable> variable, const SqpRange &range) { | |
146 | // Checks that the variable's range has changed |
|
146 | // Checks that the variable's range has changed | |
|
147 | qInfo() << "range vs expected range" << variable->range() << range; | |||
147 | QCOMPARE(variable->range(), range); |
|
148 | QCOMPARE(variable->range(), range); | |
148 |
|
149 | |||
149 | // Checks the variable's data series |
|
150 | // Checks the variable's data series | |
@@ -157,15 +158,17 void TestCosinusAcquisition::testAcquisition() | |||||
157 | auto variable = sqpApp->variableController().createVariable( |
|
158 | auto variable = sqpApp->variableController().createVariable( | |
158 | "MMS", {{COSINUS_TYPE_KEY, "scalar"}, {COSINUS_FREQUENCY_KEY, 100.}}, provider); |
|
159 | "MMS", {{COSINUS_TYPE_KEY, "scalar"}, {COSINUS_FREQUENCY_KEY, 100.}}, provider); | |
159 |
|
160 | |||
|
161 | ||||
160 | QFETCH(int, operationDelay); |
|
162 | QFETCH(int, operationDelay); | |
161 | QTest::qWait(operationDelay); |
|
163 | QTest::qWait(operationDelay); | |
162 | validateVariable(variable, initialRange); |
|
164 | validateVariable(variable, initialRange); | |
163 |
|
165 | |||
|
166 | QTest::qWait(operationDelay); | |||
164 | // Makes operations on the variable |
|
167 | // Makes operations on the variable | |
165 | QFETCH(std::vector<SqpRange>, operations); |
|
168 | QFETCH(std::vector<SqpRange>, operations); | |
166 | for (const auto &operation : operations) { |
|
169 | for (const auto &operation : operations) { | |
167 | // Asks request on the variable and waits during its execution |
|
170 | // Asks request on the variable and waits during its execution | |
168 |
sqpApp->variableController().onRequestDataLoading({variable}, operation, |
|
171 | sqpApp->variableController().onRequestDataLoading({variable}, operation, false); | |
169 |
|
172 | |||
170 | QTest::qWait(operationDelay); |
|
173 | QTest::qWait(operationDelay); | |
171 | validateVariable(variable, operation); |
|
174 | validateVariable(variable, operation); | |
@@ -174,7 +177,7 void TestCosinusAcquisition::testAcquisition() | |||||
174 |
|
177 | |||
175 | for (const auto &operation : operations) { |
|
178 | for (const auto &operation : operations) { | |
176 | // Asks request on the variable and waits during its execution |
|
179 | // Asks request on the variable and waits during its execution | |
177 |
sqpApp->variableController().onRequestDataLoading({variable}, operation, |
|
180 | sqpApp->variableController().onRequestDataLoading({variable}, operation, false); | |
178 | } |
|
181 | } | |
179 | QTest::qWait(operationDelay); |
|
182 | QTest::qWait(operationDelay); | |
180 | validateVariable(variable, operations.back()); |
|
183 | validateVariable(variable, operations.back()); |
General Comments 3
Merge lasted acquisition developpement on main Sciqlop branch
You need to be logged in to leave comments.
Login now