##// END OF EJS Templates
Adds "number of operations" and "number of variables" properties for the tests
Alexandre Leroux -
r1201:3da18e6983d5
parent child
Show More
@@ -1,2 +1,4
1 #include "FuzzingDefs.h"
1 #include "FuzzingDefs.h"
2
2
3 const QString NB_MAX_OPERATIONS_PROPERTY = QStringLiteral("component");
4 const QString NB_MAX_VARIABLES_PROPERTY = QStringLiteral("nbMaxVariables");
@@ -1,10 +1,21
1 #ifndef SCIQLOP_FUZZINGDEFS_H
1 #ifndef SCIQLOP_FUZZINGDEFS_H
2 #define SCIQLOP_FUZZINGDEFS_H
2 #define SCIQLOP_FUZZINGDEFS_H
3
3
4 #include <QString>
4 // /////// //
5 // /////// //
5 // Aliases //
6 // Aliases //
6 // /////// //
7 // /////// //
7
8
8 using Properties = QVariantHash;
9 using Properties = QVariantHash;
9
10
11 // ///////// //
12 // Constants //
13 // ///////// //
14
15 /// Max number of operations to generate
16 extern const QString NB_MAX_OPERATIONS_PROPERTY;
17
18 /// Max number of variables to manipulate through operations
19 extern const QString NB_MAX_VARIABLES_PROPERTY;
20
10 #endif // SCIQLOP_FUZZINGDEFS_H
21 #endif // SCIQLOP_FUZZINGDEFS_H
@@ -1,3 +1,4
1 #include "FuzzingDefs.h"
1 #include <Network/NetworkController.h>
2 #include <Network/NetworkController.h>
2 #include <SqpApplication.h>
3 #include <SqpApplication.h>
3 #include <Time/TimeController.h>
4 #include <Time/TimeController.h>
@@ -13,6 +14,13 Q_LOGGING_CATEGORY(LOG_TestAmdaFuzzing, "TestAmdaFuzzing")
13
14
14 namespace {
15 namespace {
15
16
17 // ///////// //
18 // Constants //
19 // ///////// //
20
21 // Defaults values used when the associated properties have not been set for the test
22 const auto NB_MAX_OPERATIONS_DEFAULT_VALUE = 100;
23 const auto NB_MAX_VARIABLES_DEFAULT_VALUE = 1;
16 /**
24 /**
17 * Class to run random tests
25 * Class to run random tests
18 */
26 */
@@ -27,10 +35,28 public:
27 void execute()
35 void execute()
28 {
36 {
29 /// @todo: complete
37 /// @todo: complete
38 qCInfo(LOG_TestAmdaFuzzing()) << "Running" << nbMaxOperations() << "operations on"
39 << nbMaxVariables() << "variables...";
40
30 qCInfo(LOG_TestAmdaFuzzing()) << "Execution of the test completed.";
41 qCInfo(LOG_TestAmdaFuzzing()) << "Execution of the test completed.";
31 }
42 }
32
43
33 private:
44 private:
45 int nbMaxOperations() const
46 {
47 static auto result
48 = m_Properties.value(NB_MAX_OPERATIONS_PROPERTY, NB_MAX_OPERATIONS_DEFAULT_VALUE)
49 .toInt();
50 return result;
51 }
52
53 int nbMaxVariables() const
54 {
55 static auto result
56 = m_Properties.value(NB_MAX_VARIABLES_PROPERTY, NB_MAX_VARIABLES_DEFAULT_VALUE).toInt();
57 return result;
58 }
59
34 VariableController &m_VariableController;
60 VariableController &m_VariableController;
35 Properties m_Properties;
61 Properties m_Properties;
36 };
62 };
General Comments 0
You need to be logged in to leave comments. Login now