##// END OF EJS Templates
Implements unit test (2)...
Alexandre Leroux -
r744:a0932f2ad0d7
parent child
Show More
@@ -1,7 +1,11
1 1 #include "CosinusProvider.h"
2 2
3 #include <Data/DataProviderParameters.h>
3 4 #include <Data/ScalarSeries.h>
4 5 #include <SqpApplication.h>
6 #include <Time/TimeController.h>
7 #include <Variable/Variable.h>
8 #include <Variable/VariableController.h>
5 9
6 10 #include <QObject>
7 11 #include <QtTest>
@@ -19,6 +23,9 const auto TESTS_RESOURCES_PATH = QFileInfo{
19 23 /// Format of dates in data files
20 24 const auto DATETIME_FORMAT = QStringLiteral("yyyy/MM/dd hh:mm:ss:zzz");
21 25
26 /// Delay after each operation on the variable before validating it (in ms)
27 const auto OPERATION_DELAY = 250;
28
22 29 /// Generates the data series from the reading of a data stream
23 30 std::shared_ptr<IDataSeries> readDataStream(QTextStream &stream)
24 31 {
@@ -82,6 +89,22 void TestCosinusAcquisition::testAcquisition()
82 89 QTextStream dataStream{&dataFile};
83 90 auto dataSeries = readDataStream(dataStream);
84 91
92 // Creates variable
93 QFETCH(SqpRange, initialRange);
94 sqpApp->timeController().onTimeToUpdate(initialRange);
95 auto provider = std::make_shared<CosinusProvider>();
96 auto variable = sqpApp->variableController().createVariable("MMS", {}, provider);
97
98 QTest::qWait(OPERATION_DELAY);
99 // Makes operations on the variable
100 QFETCH(std::vector<SqpRange>, operations);
101 for (const auto &operation : operations) {
102 // Asks request on the variable and waits during its execution
103 sqpApp->variableController().onRequestDataLoading({variable}, operation,
104 variable->range(), true);
105
106 QTest::qWait(OPERATION_DELAY);
107 }
85 108 }
86 109 else {
87 110 QFAIL("Can't read input data file");
General Comments 0
You need to be logged in to leave comments. Login now