Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
CommandMutation_test Class Reference

Description

Verify the behaviour of the type erased closure, which is used by Steam-Layer commands to implement the capturing and later re-invocation of a function.

See also
control::Command
control::CommandDef
control::Mutation
control::UndoMutation
command-basic-test.hpp

Definition at line 78 of file command-mutation-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void checkMutation ()
 
void checkUndoMutation ()
 
void checkStateCapturingMechanism ()
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

Definition at line 82 of file command-mutation-test.cpp.

References CommandMutation_test::checkMutation(), CommandMutation_test::checkStateCapturingMechanism(), and CommandMutation_test::checkUndoMutation().

+ Here is the call graph for this function:

◆ checkMutation()

void checkMutation ( )
inlineprivate
Test:
check the Mutation functor which is bound to our testFunc(int). Then create a argument closure and use this to invoke the Mutation and verify actually testFunc(param) is executed.

Definition at line 97 of file command-mutation-test.cpp.

References VERIFY_ERROR.

Referenced by CommandMutation_test::run().

+ Here is the caller graph for this function:

◆ checkUndoMutation()

void checkUndoMutation ( )
inlineprivate
Test:
check the special Mutation which is used to undo a command. This time, we use our testFunc(int) as implementation of the "undo" function; thus its parameter has now the meaning of an captured state value. Consequently this time the operation which is to be undone would have the signature void(void) . Obviously this is a rather silly "undo" function, but it is easy to check for unit testing. To carry out this test, we first have to trigger the state capturing mechanism; after that, invoking the UndoMutation will call the testFunc with the previously captured state.
Note
Mutation and UndoMutation are value objects, but they refer to a common command state, which for this test is modelled by local variables and which for the real commands is contained in a Command-StorageHolder

Definition at line 142 of file command-mutation-test.cpp.

References VERIFY_ERROR.

Referenced by CommandMutation_test::run().

+ Here is the caller graph for this function:

◆ checkStateCapturingMechanism()

void checkStateCapturingMechanism ( )
inlineprivate
Test:
check the undo memento capturing mechanism in isolation
See also
memento-tie-test.cpp more in-depth coverage

Definition at line 189 of file command-mutation-test.cpp.

Referenced by CommandMutation_test::run().

+ Here is the caller graph for this function:
+ Inheritance diagram for CommandMutation_test:
+ Collaboration diagram for CommandMutation_test:

The documentation for this class was generated from the following file: