@@ -1,7 +1,11 | |||||
1 | #include "CosinusProvider.h" |
|
1 | #include "CosinusProvider.h" | |
2 |
|
2 | |||
|
3 | #include <Data/DataProviderParameters.h> | |||
3 | #include <Data/ScalarSeries.h> |
|
4 | #include <Data/ScalarSeries.h> | |
4 | #include <SqpApplication.h> |
|
5 | #include <SqpApplication.h> | |
|
6 | #include <Time/TimeController.h> | |||
|
7 | #include <Variable/Variable.h> | |||
|
8 | #include <Variable/VariableController.h> | |||
5 |
|
9 | |||
6 | #include <QObject> |
|
10 | #include <QObject> | |
7 | #include <QtTest> |
|
11 | #include <QtTest> | |
@@ -19,6 +23,9 const auto TESTS_RESOURCES_PATH = QFileInfo{ | |||||
19 | /// Format of dates in data files |
|
23 | /// Format of dates in data files | |
20 | const auto DATETIME_FORMAT = QStringLiteral("yyyy/MM/dd hh:mm:ss:zzz"); |
|
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 | /// Generates the data series from the reading of a data stream |
|
29 | /// Generates the data series from the reading of a data stream | |
23 | std::shared_ptr<IDataSeries> readDataStream(QTextStream &stream) |
|
30 | std::shared_ptr<IDataSeries> readDataStream(QTextStream &stream) | |
24 | { |
|
31 | { | |
@@ -82,6 +89,22 void TestCosinusAcquisition::testAcquisition() | |||||
82 | QTextStream dataStream{&dataFile}; |
|
89 | QTextStream dataStream{&dataFile}; | |
83 | auto dataSeries = readDataStream(dataStream); |
|
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 | else { |
|
109 | else { | |
87 | QFAIL("Can't read input data file"); |
|
110 | QFAIL("Can't read input data file"); |
General Comments 0
You need to be logged in to leave comments.
Login now