@@ -115,6 +115,30 Validators createValidators(const ValidatorsTypes &types) | |||
|
115 | 115 | } |
|
116 | 116 | |
|
117 | 117 | /** |
|
118 | * Validates all the variables' states passed in parameter, according to a set of validators | |
|
119 | * @param variablesPool the variables' states | |
|
120 | * @param validators the validators used for validation | |
|
121 | */ | |
|
122 | void validate(const VariablesPool &variablesPool, const Validators &validators) | |
|
123 | { | |
|
124 | for (const auto &variablesPoolEntry : variablesPool) { | |
|
125 | auto variableId = variablesPoolEntry.first; | |
|
126 | const auto &variableState = variablesPoolEntry.second; | |
|
127 | ||
|
128 | auto variableMessage = variableState.m_Variable ? variableState.m_Variable->name() | |
|
129 | : QStringLiteral("null variable"); | |
|
130 | qCInfo(LOG_TestAmdaFuzzing()).noquote() << "Validating state of variable at index" | |
|
131 | << variableId << "(" << variableMessage << ")..."; | |
|
132 | ||
|
133 | for (const auto &validator : validators) { | |
|
134 | validator->validate(VariableState{variableState}); | |
|
135 | } | |
|
136 | ||
|
137 | qCInfo(LOG_TestAmdaFuzzing()).noquote() << "Validation completed."; | |
|
138 | } | |
|
139 | } | |
|
140 | ||
|
141 | /** | |
|
118 | 142 | * Class to run random tests |
|
119 | 143 | */ |
|
120 | 144 | class FuzzingTest { |
@@ -155,6 +179,9 public: | |||
|
155 | 179 | |
|
156 | 180 | fuzzingOperation->execute(variableState, m_VariableController, m_Properties); |
|
157 | 181 | QTest::qWait(operationDelay()); |
|
182 | ||
|
183 | // Validates variables | |
|
184 | validate(m_VariablesPool, validators()); | |
|
158 | 185 | } |
|
159 | 186 | else { |
|
160 | 187 | qCInfo(LOG_TestAmdaFuzzing()).noquote() |
General Comments 0
You need to be logged in to leave comments.
Login now