@@ -1,6 +1,7 | |||
|
1 | 1 | #include "FuzzingDefs.h" |
|
2 | 2 | |
|
3 | 3 | const QString NB_MAX_OPERATIONS_PROPERTY = QStringLiteral("component"); |
|
4 | const QString NB_MAX_SYNC_GROUPS_PROPERTY = QStringLiteral("nbSyncGroups"); | |
|
4 | 5 | const QString NB_MAX_VARIABLES_PROPERTY = QStringLiteral("nbMaxVariables"); |
|
5 | 6 | const QString AVAILABLE_OPERATIONS_PROPERTY = QStringLiteral("availableOperations"); |
|
6 | 7 | const QString CACHE_TOLERANCE_PROPERTY = QStringLiteral("cacheTolerance"); |
@@ -26,6 +26,9 using Properties = QVariantHash; | |||
|
26 | 26 | /// Max number of operations to generate |
|
27 | 27 | extern const QString NB_MAX_OPERATIONS_PROPERTY; |
|
28 | 28 | |
|
29 | /// Max number of sync groups to create through operations | |
|
30 | extern const QString NB_MAX_SYNC_GROUPS_PROPERTY; | |
|
31 | ||
|
29 | 32 | /// Max number of variables to manipulate through operations |
|
30 | 33 | extern const QString NB_MAX_VARIABLES_PROPERTY; |
|
31 | 34 |
@@ -41,6 +41,7 using Validators = std::vector<std::shared_ptr<IFuzzingValidator> >; | |||
|
41 | 41 | |
|
42 | 42 | // Defaults values used when the associated properties have not been set for the test |
|
43 | 43 | const auto NB_MAX_OPERATIONS_DEFAULT_VALUE = 100; |
|
44 | const auto NB_MAX_SYNC_GROUPS_DEFAULT_VALUE = 1; | |
|
44 | 45 | const auto NB_MAX_VARIABLES_DEFAULT_VALUE = 1; |
|
45 | 46 | const auto AVAILABLE_OPERATIONS_DEFAULT_VALUE = QVariant::fromValue(WeightedOperationsTypes{ |
|
46 | 47 | {FuzzingOperationType::CREATE, 1.}, |
@@ -148,6 +149,13 public: | |||
|
148 | 149 | for (auto variableId = 0; variableId < nbMaxVariables(); ++variableId) { |
|
149 | 150 | m_FuzzingState.m_VariablesPool[variableId] = VariableState{}; |
|
150 | 151 | } |
|
152 | ||
|
153 | // Inits sync groups and registers them into the variable controller | |
|
154 | for (auto i = 0; i < nbMaxSyncGroups(); ++i) { | |
|
155 | auto syncGroupId = SyncGroupId::createUuid(); | |
|
156 | variableController.onAddSynchronizationGroupId(syncGroupId); | |
|
157 | m_FuzzingState.m_SyncGroupsPool[syncGroupId] = SyncGroup{}; | |
|
158 | } | |
|
151 | 159 | } |
|
152 | 160 | |
|
153 | 161 | void execute() |
@@ -197,6 +205,14 private: | |||
|
197 | 205 | return result; |
|
198 | 206 | } |
|
199 | 207 | |
|
208 | int nbMaxSyncGroups() const | |
|
209 | { | |
|
210 | static auto result | |
|
211 | = m_Properties.value(NB_MAX_SYNC_GROUPS_PROPERTY, NB_MAX_SYNC_GROUPS_DEFAULT_VALUE) | |
|
212 | .toInt(); | |
|
213 | return result; | |
|
214 | } | |
|
215 | ||
|
200 | 216 | int nbMaxVariables() const |
|
201 | 217 | { |
|
202 | 218 | static auto result |
General Comments 0
You need to be logged in to leave comments.
Login now