##// END OF EJS Templates
Adds the ability to set cache tolerance for tests
Alexandre Leroux -
r1224:c4f25cb21c59
parent child
Show More
@@ -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 CACHE_TOLERANCE_PROPERTY = QStringLiteral("cacheTolerance");
6 7 const QString INITIAL_RANGE_PROPERTY = QStringLiteral("initialRange");
7 8 const QString MAX_RANGE_PROPERTY = QStringLiteral("maxRange");
8 9 const QString METADATA_POOL_PROPERTY = QStringLiteral("metadataPool");
@@ -30,6 +30,8 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 /// Tolerance used for variable's cache (in ratio)
34 extern const QString CACHE_TOLERANCE_PROPERTY;
33 35
34 36 /// Range with which the timecontroller is initialized
35 37 extern const QString INITIAL_RANGE_PROPERTY;
@@ -5,6 +5,7
5 5 #include "AmdaProvider.h"
6 6
7 7 #include <Network/NetworkController.h>
8 #include <Settings/SqpSettingsDefs.h>
8 9 #include <SqpApplication.h>
9 10 #include <Time/TimeController.h>
10 11 #include <Variable/Variable.h>
@@ -47,6 +48,7 const auto AVAILABLE_OPERATIONS_DEFAULT_VALUE
47 48 {FuzzingOperationType::PAN_RIGHT, 1.},
48 49 {FuzzingOperationType::ZOOM_IN, 1.},
49 50 {FuzzingOperationType::ZOOM_OUT, 1.}});
51 const auto CACHE_TOLERANCE_DEFAULT_VALUE = 0.2;
50 52
51 53 /// Delay between each operation (in ms)
52 54 const auto OPERATION_DELAY_DEFAULT_VALUE = 3000;
@@ -223,6 +225,12 void TestAmdaFuzzing::testFuzzing()
223 225 {
224 226 QFETCH(Properties, properties);
225 227
228 // Sets cache property
229 QSettings settings{};
230 auto cacheTolerance = properties.value(CACHE_TOLERANCE_PROPERTY, CACHE_TOLERANCE_DEFAULT_VALUE);
231 settings.setValue(GENERAL_TOLERANCE_AT_INIT_KEY, cacheTolerance);
232 settings.setValue(GENERAL_TOLERANCE_AT_UPDATE_KEY, cacheTolerance);
233
226 234 auto &variableController = sqpApp->variableController();
227 235 auto &timeController = sqpApp->timeController();
228 236
@@ -260,6 +268,9 int main(int argc, char *argv[])
260 268 "TestAmdaFuzzing.info=true\n");
261 269
262 270 SqpApplication app{argc, argv};
271 SqpApplication::setOrganizationName("LPP");
272 SqpApplication::setOrganizationDomain("lpp.fr");
273 SqpApplication::setApplicationName("SciQLop-TestFuzzing");
263 274 app.setAttribute(Qt::AA_Use96Dpi, true);
264 275 TestAmdaFuzzing testObject{};
265 276 QTEST_SET_MAIN_SOURCE_PATH
General Comments 0
You need to be logged in to leave comments. Login now