##// END OF EJS Templates
Made more consistent plugin install path with CMake, removed useless plugin lookup path...
Made more consistent plugin install path with CMake, removed useless plugin lookup path Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1347:17e0dafec10c
r1398:728acc3a845d
Show More
FuzzingDefs.h
128 lines | 4.0 KiB | text/x-c | CLexer
Alexandre Leroux
Adds variable controller and properties to test structure...
r1169 #ifndef SCIQLOP_FUZZINGDEFS_H
#define SCIQLOP_FUZZINGDEFS_H
Made core module a git submodule, ready to start switching to new...
r1347 #include <Data/DateTimeRange.h>
Alexandre Leroux
Defines VariableState struct (1)...
r1187
Alexandre Leroux
Adds "number of operations" and "number of variables" properties for the tests
r1170 #include <QString>
Alexandre Leroux
Defines synchronization groups for fuzzing tests
r1202 #include <QUuid>
Alexandre Leroux
Implements "Variable creation" operation (1)...
r1176 #include <QVariantHash>
Alexandre Leroux
Defines VariableState struct (1)...
r1187 #include <memory>
Alexandre Leroux
Defines synchronization groups for fuzzing tests
r1202 #include <set>
Alexandre Leroux
Defines VariableState struct (1)...
r1187
Alexandre Leroux
Adds variable controller and properties to test structure...
r1169 // /////// //
// Aliases //
// /////// //
Alexandre Leroux
Implements "Variable creation" operation (1)...
r1176 using MetadataPool = std::vector<QVariantHash>;
Q_DECLARE_METATYPE(MetadataPool)
Alexandre Leroux
Adds variable controller and properties to test structure...
r1169 using Properties = QVariantHash;
Alexandre Leroux
Adds "number of operations" and "number of variables" properties for the tests
r1170 // ///////// //
// Constants //
// ///////// //
Alexandre Leroux
Wait for the end of an acquisition to validate an operation (3)...
r1215 /// Timeout set for data acquisition for an operation (in ms)
extern const QString ACQUISITION_TIMEOUT_PROPERTY;
Alexandre Leroux
Adds "number of operations" and "number of variables" properties for the tests
r1170 /// Max number of operations to generate
extern const QString NB_MAX_OPERATIONS_PROPERTY;
Alexandre Leroux
Sets the number of sync groups to create for fuzzing tests
r1204
/// Max number of sync groups to create through operations
extern const QString NB_MAX_SYNC_GROUPS_PROPERTY;
Alexandre Leroux
Adds "number of operations" and "number of variables" properties for the tests
r1170
/// Max number of variables to manipulate through operations
extern const QString NB_MAX_VARIABLES_PROPERTY;
Alexandre Leroux
Defines operations pool...
r1173 /// Set of operations available for the test
extern const QString AVAILABLE_OPERATIONS_PROPERTY;
Alexandre Leroux
Adds the ability to set cache tolerance for tests
r1191 /// Tolerance used for variable's cache (in ratio)
extern const QString CACHE_TOLERANCE_PROPERTY;
Alexandre Leroux
Some fixes...
r1190
/// Range with which the timecontroller is initialized
extern const QString INITIAL_RANGE_PROPERTY;
Alexandre Leroux
Completes fuzzing test structure by setting initial range for the time controller
r1178 /// Max range that an operation can reach
extern const QString MAX_RANGE_PROPERTY;
Alexandre Leroux
Implements "Variable creation" operation (1)...
r1176 /// Set of metadata that can be associated to a variable
extern const QString METADATA_POOL_PROPERTY;
/// Provider used to retrieve data
extern const QString PROVIDER_PROPERTY;
Alexandre Leroux
Randomizes the time to wait between each operations (defines min/max delays)
r1210 /// Min/max times left for an operation to execute
extern const QString OPERATION_DELAY_BOUNDS_PROPERTY;
Alexandre Leroux
Implements move operations (3)...
r1186
Alexandre Leroux
Adds validators to the fuzzing test...
r1195 /// Validators used to validate an operation
extern const QString VALIDATORS_PROPERTY;
Alexandre Leroux
Defines VariableState struct (1)...
r1187
Alexandre Leroux
Randomizes the number of operations to wait between calling validation (defines min/max frequencies)
r1211 /// Min/max number of operations to execute before calling validation of the current test's state
extern const QString VALIDATION_FREQUENCY_BOUNDS_PROPERTY;
Alexandre Leroux
Defines VariableState struct (1)...
r1187 // /////// //
// Structs //
// /////// //
class Variable;
struct VariableState {
std::shared_ptr<Variable> m_Variable{nullptr};
Renamed SqpRange to DateTimeRange, introduced VariableController2 to...
r1346 DateTimeRange m_Range{INVALID_RANGE};
Alexandre Leroux
Defines VariableState struct (1)...
r1187 };
Alexandre Leroux
Defines synchronization groups for fuzzing tests
r1202 using VariableId = int;
using VariablesPool = std::map<VariableId, VariableState>;
/**
* Defines a synchronization group for a fuzzing state. A group reports the variables synchronized
* with each other, and the current range of the group (i.e. range of the last synchronized variable
* that has been moved)
*/
struct SyncGroup {
std::set<VariableId> m_Variables{};
Renamed SqpRange to DateTimeRange, introduced VariableController2 to...
r1346 DateTimeRange m_Range{INVALID_RANGE};
Alexandre Leroux
Defines synchronization groups for fuzzing tests
r1202 };
using SyncGroupId = QUuid;
using SyncGroupsPool = std::map<SyncGroupId, SyncGroup>;
/**
* Defines a current state during a fuzzing state. It contains all the variables manipulated during
* the test, as well as the synchronization status of these variables.
*/
struct FuzzingState {
const SyncGroup &syncGroup(SyncGroupId id) const;
SyncGroup &syncGroup(SyncGroupId id);
const VariableState &variableState(VariableId id) const;
VariableState &variableState(VariableId id);
Alexandre Leroux
Implements canExecute() method of syn/desync operations
r1206 /// @return the identifier of the synchronization group in which the variable passed in
/// parameter is located. If the variable is not in any group, returns an invalid identifier
SyncGroupId syncGroupId(VariableId variableId) const;
Alexandre Leroux
Implements execute() method of sync operation
r1207 /// @return the set of synchronization group identifiers
std::vector<SyncGroupId> syncGroupsIds() const;
/// Updates fuzzing state according to a variable synchronization
/// @param variableId the variable that is synchronized
/// @param syncGroupId the synchronization group
void synchronizeVariable(VariableId variableId, SyncGroupId syncGroupId);
Alexandre Leroux
Implements execute() method of desync operation...
r1208 /// Updates fuzzing state according to a variable desynchronization
/// @param variableId the variable that is desynchronized
/// @param syncGroupId the synchronization group from which to remove the variable
void desynchronizeVariable(VariableId variableId, SyncGroupId syncGroupId);
Alexandre Leroux
Updates states of synchronized variables when there is a move operation
r1209 /// Updates the range of a variable and all variables to which it is synchronized
/// @param the variable for which to affect the range
/// @param the range to affect
Renamed SqpRange to DateTimeRange, introduced VariableController2 to...
r1346 void updateRanges(VariableId variableId, const DateTimeRange &newRange);
Alexandre Leroux
Defines synchronization groups for fuzzing tests
r1202
VariablesPool m_VariablesPool;
SyncGroupsPool m_SyncGroupsPool;
};
Alexandre Leroux
Adds variable controller and properties to test structure...
r1169 #endif // SCIQLOP_FUZZINGDEFS_H