@@ -18,8 +18,8 struct SqpRange { | |||
|
18 | 18 | static SqpRange fromDateTime(const QDate &startDate, const QTime &startTime, |
|
19 | 19 | const QDate &endDate, const QTime &endTime) |
|
20 | 20 | { |
|
21 | return {DateUtils::secondsSinceEpoch(QDateTime{startDate, startTime}), | |
|
22 | DateUtils::secondsSinceEpoch(QDateTime{endDate, endTime})}; | |
|
21 | return {DateUtils::secondsSinceEpoch(QDateTime{startDate, startTime, Qt::UTC}), | |
|
22 | DateUtils::secondsSinceEpoch(QDateTime{endDate, endTime, Qt::UTC})}; | |
|
23 | 23 | } |
|
24 | 24 | |
|
25 | 25 | /// Start time (UTC) |
@@ -3,6 +3,7 | |||
|
3 | 3 | const QString NB_MAX_OPERATIONS_PROPERTY = QStringLiteral("component"); |
|
4 | 4 | const QString NB_MAX_VARIABLES_PROPERTY = QStringLiteral("nbMaxVariables"); |
|
5 | 5 | const QString AVAILABLE_OPERATIONS_PROPERTY = QStringLiteral("availableOperations"); |
|
6 | const QString INITIAL_RANGE_PROPERTY = QStringLiteral("initialRange"); | |
|
6 | 7 | const QString MAX_RANGE_PROPERTY = QStringLiteral("maxRange"); |
|
7 | 8 | const QString METADATA_POOL_PROPERTY = QStringLiteral("metadataPool"); |
|
8 | 9 | const QString PROVIDER_PROPERTY = QStringLiteral("provider"); |
@@ -30,6 +30,10 extern const QString NB_MAX_VARIABLES_PROPERTY; | |||
|
30 | 30 | /// Set of operations available for the test |
|
31 | 31 | extern const QString AVAILABLE_OPERATIONS_PROPERTY; |
|
32 | 32 | |
|
33 | ||
|
34 | /// Range with which the timecontroller is initialized | |
|
35 | extern const QString INITIAL_RANGE_PROPERTY; | |
|
36 | ||
|
33 | 37 | /// Max range that an operation can reach |
|
34 | 38 | extern const QString MAX_RANGE_PROPERTY; |
|
35 | 39 |
@@ -34,11 +34,14 struct CreateOperation : public IFuzzingOperation { | |||
|
34 | 34 | = properties.value(PROVIDER_PROPERTY).value<std::shared_ptr<IDataProvider> >(); |
|
35 | 35 | |
|
36 | 36 | auto variableName = QString{"Var_%1"}.arg(QUuid::createUuid().toString()); |
|
37 | qCInfo(LOG_FuzzingOperations()) | |
|
37 | qCInfo(LOG_FuzzingOperations()).noquote() | |
|
38 | 38 | << "Creating variable" << variableName << "(metadata:" << variableMetadata << ")"; |
|
39 | 39 | |
|
40 | 40 | auto newVariable |
|
41 | 41 | = variableController.createVariable(variableName, variableMetadata, variableProvider); |
|
42 | ||
|
43 | // Updates variable's state | |
|
44 | variableState.m_Range = properties.value(INITIAL_RANGE_PROPERTY).value<SqpRange>(); | |
|
42 | 45 | std::swap(variableState.m_Variable, newVariable); |
|
43 | 46 | } |
|
44 | 47 | }; |
@@ -105,7 +108,7 struct MoveOperation : public IFuzzingOperation { | |||
|
105 | 108 | // Moves variable to its new range |
|
106 | 109 | auto newVariableRange = SqpRange{m_RangeStartMoveFun(variableRange.m_TStart, delta), |
|
107 | 110 | m_RangeEndMoveFun(variableRange.m_TEnd, delta)}; |
|
108 | qCInfo(LOG_FuzzingOperations()) | |
|
111 | qCInfo(LOG_FuzzingOperations()).noquote() | |
|
109 | 112 | << "Performing" << m_Label << "on" << variable->name() << "(from" << variableRange |
|
110 | 113 | << "to" << newVariableRange << ")..."; |
|
111 | 114 | variableController.onRequestDataLoading({variable}, newVariableRange, false); |
@@ -113,8 +113,8 public: | |||
|
113 | 113 | |
|
114 | 114 | void execute() |
|
115 | 115 | { |
|
116 | qCInfo(LOG_TestAmdaFuzzing()) << "Running" << nbMaxOperations() << "operations on" | |
|
117 | << nbMaxVariables() << "variable(s)..."; | |
|
116 | qCInfo(LOG_TestAmdaFuzzing()).noquote() << "Running" << nbMaxOperations() << "operations on" | |
|
117 | << nbMaxVariables() << "variable(s)..."; | |
|
118 | 118 | |
|
119 | 119 | auto canExecute = true; |
|
120 | 120 | for (auto i = 0; i < nbMaxOperations() && canExecute; ++i) { |
@@ -139,12 +139,12 public: | |||
|
139 | 139 | |
|
140 | 140 | } |
|
141 | 141 | else { |
|
142 | qCInfo(LOG_TestAmdaFuzzing()) | |
|
142 | qCInfo(LOG_TestAmdaFuzzing()).noquote() | |
|
143 | 143 | << "No more operations are available, the execution of the test will stop..."; |
|
144 | 144 | } |
|
145 | 145 | } |
|
146 | 146 | |
|
147 | qCInfo(LOG_TestAmdaFuzzing()) << "Execution of the test completed."; | |
|
147 | qCInfo(LOG_TestAmdaFuzzing()).noquote() << "Execution of the test completed."; | |
|
148 | 148 | } |
|
149 | 149 | |
|
150 | 150 | private: |
@@ -242,8 +242,9 void TestAmdaFuzzing::testFuzzing() | |||
|
242 | 242 | |
|
243 | 243 | // Sets initial range on time controller |
|
244 | 244 | SqpRange initialRange{initialRangeStart, initialRangeEnd}; |
|
245 | qCInfo(LOG_TestAmdaFuzzing()) << "Setting initial range to" << initialRange << "..."; | |
|
245 | qCInfo(LOG_TestAmdaFuzzing()).noquote() << "Setting initial range to" << initialRange << "..."; | |
|
246 | 246 | timeController.onTimeToUpdate(initialRange); |
|
247 | properties.insert(INITIAL_RANGE_PROPERTY, QVariant::fromValue(initialRange)); | |
|
247 | 248 | |
|
248 | 249 | FuzzingTest test{variableController, properties}; |
|
249 | 250 | test.execute(); |
General Comments 0
You need to be logged in to leave comments.
Login now