Commands: static registration for the existing test dummy commands
Up to now, these dummy functions where used by various unit tests directly, by creating command definitions within the test fixture. But since it is foreseeable that we'll need dummy commands for various further unit tests, it seems adequate to setup a global static registration with the newly created system of command registrations for these dummies.
This commit is contained in:
parent
a91d03b60a
commit
a13270a6b8
2 changed files with 48 additions and 0 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
|
||||
#include "proc/control/test-dummy-commands.hpp"
|
||||
#include "proc/control/command-def.hpp"
|
||||
|
||||
|
||||
|
||||
|
|
@ -48,4 +49,37 @@ namespace test {
|
|||
}
|
||||
|
||||
|
||||
/* ==== global static prototype definitions for these commands ==== */
|
||||
|
||||
/**
|
||||
* @remark The following definition(s) will be evaluated automatically ON_GLOBAL_INIT
|
||||
* They result in "prototype" definitions of these dummy commands to be
|
||||
* registered under the names as used here in the macro invocation.
|
||||
* Thus `test_Dummy_command1` will invoke command1::operate(int) etc.
|
||||
* @see CommandSetup_test
|
||||
*/
|
||||
|
||||
COMMAND_DEFINITION (test_Dummy_command1)
|
||||
{
|
||||
def.operation(command1::operate)
|
||||
.captureUndo(command1::capture)
|
||||
.undoOperation(command1::undoIt);
|
||||
};
|
||||
|
||||
COMMAND_DEFINITION (test_Dummy_command2)
|
||||
{
|
||||
def.operation(command2::operate)
|
||||
.captureUndo(command2::capture)
|
||||
.undoOperation(command2::undoIt);
|
||||
};
|
||||
|
||||
COMMAND_DEFINITION (test_Dummy_command3)
|
||||
{
|
||||
def.operation(command3::operate)
|
||||
.captureUndo(command3::capture)
|
||||
.undoOperation(command3::undoIt);
|
||||
};
|
||||
|
||||
|
||||
|
||||
}}} // namespace proc::control::test
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
#include "lib/error.hpp"
|
||||
#include "lib/test/test-helper.hpp"
|
||||
#include "proc/control/command-setup.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <sstream>
|
||||
|
|
@ -151,5 +152,18 @@ namespace test {
|
|||
}
|
||||
|
||||
|
||||
/* ==== global static prototype definitions for these commands ==== */
|
||||
|
||||
/** test dummy command to add the argument to a global variable */
|
||||
extern CommandSetup test_Dummy_command1;
|
||||
|
||||
/** test dummy command to invoke the given functor and
|
||||
* append the result onto a global log string buffer */
|
||||
extern CommandSetup test_Dummy_command2;
|
||||
|
||||
/** test dummy command to increment a global variable; no arguments */
|
||||
extern CommandSetup test_Dummy_command3;
|
||||
|
||||
|
||||
}}} // namespace proc::control::test
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue