##// END OF EJS Templates
Creates sync and desync operations and adds them to the fuzzing tests
Alexandre Leroux -
r1238:b0db13ba024e
parent child
Show More
@@ -149,6 +149,25 struct MoveOperation : public IFuzzingOperation {
149 149 QString m_Label;
150 150 };
151 151
152 struct SynchronizeOperation : public IFuzzingOperation {
153 bool canExecute(VariableId variableId, const FuzzingState &fuzzingState) const override
154 {
155 }
156
157 void execute(VariableId variableId, FuzzingState &fuzzingState,
158 VariableController &variableController, const Properties &) const override
159 {
160 }
161 };
162
163 struct DesynchronizeOperation : public IFuzzingOperation {
164 bool canExecute(VariableId variableId, const FuzzingState &fuzzingState) const override
165 {
166 }
167
168 void execute(VariableId variableId, FuzzingState &fuzzingState,
169 VariableController &variableController, const Properties &) const override
170 {
152 171 struct UnknownOperation : public IFuzzingOperation {
153 172 bool canExecute(VariableId, const FuzzingState &) const override { return false; }
154 173
@@ -197,6 +216,10 std::unique_ptr<IFuzzingOperation> FuzzingOperationFactory::create(FuzzingOperat
197 216 maxRange.m_TEnd - range.m_TEnd);
198 217 },
199 218 QStringLiteral("Zoom out operation"));
219 case FuzzingOperationType::SYNCHRONIZE:
220 return std::make_unique<SynchronizeOperation>();
221 case FuzzingOperationType::DESYNCHRONIZE:
222 return std::make_unique<DesynchronizeOperation>();
200 223 default:
201 224 // Default case returns unknown operation
202 225 break;
@@ -16,7 +16,16 class VariableController;
16 16 /**
17 17 * Enumeration of types of existing fuzzing operations
18 18 */
19 enum class FuzzingOperationType { CREATE, DELETE, PAN_LEFT, PAN_RIGHT, ZOOM_IN, ZOOM_OUT };
19 enum class FuzzingOperationType {
20 CREATE,
21 DELETE,
22 PAN_LEFT,
23 PAN_RIGHT,
24 ZOOM_IN,
25 ZOOM_OUT,
26 SYNCHRONIZE,
27 DESYNCHRONIZE
28 };
20 29
21 30 /// Interface that represents an operation that can be executed during a fuzzing test
22 31 struct IFuzzingOperation {
@@ -49,7 +49,9 const auto AVAILABLE_OPERATIONS_DEFAULT_VALUE = QVariant::fromValue(WeightedOper
49 49 {FuzzingOperationType::PAN_LEFT, 1.},
50 50 {FuzzingOperationType::PAN_RIGHT, 1.},
51 51 {FuzzingOperationType::ZOOM_IN, 1.},
52 {FuzzingOperationType::ZOOM_OUT, 1.}});
52 {FuzzingOperationType::ZOOM_OUT, 1.},
53 {FuzzingOperationType::SYNCHRONIZE, 0.8},
54 {FuzzingOperationType::DESYNCHRONIZE, 0.4}});
53 55 const auto CACHE_TOLERANCE_DEFAULT_VALUE = 0.2;
54 56
55 57 /// Delay between each operation (in ms)
General Comments 0
You need to be logged in to leave comments. Login now