diff --git a/core/tests/Variable/TestVariableSync.cpp b/core/tests/Variable/TestVariableSync.cpp index a76e1df..539574d 100644 --- a/core/tests/Variable/TestVariableSync.cpp +++ b/core/tests/Variable/TestVariableSync.cpp @@ -1,6 +1,40 @@ #include #include +#include +#include +namespace { + +/** + * Interface representing an operation performed on a variable controller. + * This interface is used in tests to apply a set of operations and check the status of the + * controller after each operation + */ +struct IOperation { + virtual ~IOperation() = default; + /// Executes the operation on the variable controller + virtual void exec(VariableController &variableController) const = 0; +}; + +/** + * Test Iteration + * + * A test iteration includes an operation to be performed, and a set of expected ranges after each + * operation. Each range is tested after the operation to ensure that: + * - the range of the variable is the expected range + * - the data of the variable are those generated for the expected range + */ +struct Iteration { + std::shared_ptr m_Operation; ///< Operation to perform + std::map m_ExpectedRanges; ///< Expected ranges (by variable index) +}; + +using Iterations = std::vector; + +} // namespace + +Q_DECLARE_METATYPE(Iterations) + class TestVariableSync : public QObject { Q_OBJECT