Lumiera  0.pre.03
»edit your freedom«
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 87 of file command-mutation-test.cpp.

Private Member Functions

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

Member Function Documentation

◆ 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 104 of file command-mutation-test.cpp.

◆ 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 149 of file command-mutation-test.cpp.

◆ 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 196 of file command-mutation-test.cpp.

+ Inheritance diagram for CommandMutation_test:
+ Collaboration diagram for CommandMutation_test:

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