##// END OF EJS Templates
Implements move operations (3)...
Alexandre Leroux -
r1219:df2174f7c4bf
parent child
Show More
@@ -6,3 +6,4 const QString AVAILABLE_OPERATIONS_PROPERTY = QStringLiteral("availableOperation
6 6 const QString MAX_RANGE_PROPERTY = QStringLiteral("maxRange");
7 7 const QString METADATA_POOL_PROPERTY = QStringLiteral("metadataPool");
8 8 const QString PROVIDER_PROPERTY = QStringLiteral("provider");
9 const QString OPERATION_DELAY_PROPERTY = QStringLiteral("operationDelay");
@@ -35,4 +35,7 extern const QString METADATA_POOL_PROPERTY;
35 35 /// Provider used to retrieve data
36 36 extern const QString PROVIDER_PROPERTY;
37 37
38 /// Time left for an operation to execute
39 extern const QString OPERATION_DELAY_PROPERTY;
40
38 41 #endif // SCIQLOP_FUZZINGDEFS_H
@@ -41,7 +41,14 using VariablesPool = std::map<VariableId, std::shared_ptr<Variable> >;
41 41 const auto NB_MAX_OPERATIONS_DEFAULT_VALUE = 100;
42 42 const auto NB_MAX_VARIABLES_DEFAULT_VALUE = 1;
43 43 const auto AVAILABLE_OPERATIONS_DEFAULT_VALUE
44 = QVariant::fromValue(WeightedOperationsTypes{{FuzzingOperationType::CREATE, 1.}});
44 = QVariant::fromValue(WeightedOperationsTypes{{FuzzingOperationType::CREATE, 1.},
45 {FuzzingOperationType::PAN_LEFT, 1.},
46 {FuzzingOperationType::PAN_RIGHT, 1.},
47 {FuzzingOperationType::ZOOM_IN, 1.},
48 {FuzzingOperationType::ZOOM_OUT, 1.}});
49
50 /// Delay between each operation (in ms)
51 const auto OPERATION_DELAY_DEFAULT_VALUE = 3000;
45 52
46 53 // /////// //
47 54 // Methods //
@@ -127,6 +134,7 public:
127 134 auto fuzzingOperation = variableOperation.second;
128 135
129 136 fuzzingOperation->execute(variable, m_VariableController, m_Properties);
137 QTest::qWait(operationDelay());
130 138
131 139 // Updates variable pool with the new state of the variable after operation
132 140 m_VariablesPool[variableId] = variable;
@@ -156,6 +164,13 private:
156 164 return result;
157 165 }
158 166
167 int operationDelay() const
168 {
169 static auto result
170 = m_Properties.value(OPERATION_DELAY_PROPERTY, OPERATION_DELAY_DEFAULT_VALUE).toInt();
171 return result;
172 }
173
159 174 WeightedOperationsPool operationsPool() const
160 175 {
161 176 static auto result = createOperationsPool(
General Comments 0
You need to be logged in to leave comments. Login now