38 string TEST_CMD =
"test.command1.handling";
54 log_.call (TEST_CMD,
"exec");
62 log_.call (TEST_CMD,
"undo");
77 return log_.verifyCall(
"exec").on(TEST_CMD);
83 return log_.verifyCall(
"undo").on(TEST_CMD)
144 typedef void Sig_oper(
int);
145 typedef long Sig_capt(
int);
146 typedef void Sig_undo(
int,
long);
171 using ArgTuple = std::tuple<int>;
172 const int ARGR{1 + rani (1000)};
175 com->setArguments(arg);
177 CHECK (com->canExec());
178 CHECK (!com->canUndo());
186 CHECK (com->canUndo());
195 CHECK (com->canExec());
196 CHECK (com->canUndo());
216 CHECK (com->canExec());
Implementation helper to bind Steam-Layer commands with arbitrary argument tuples.
Helper to log and verify the occurrence of events.
Steam-Layer Command implementation.
Registry managing command implementation objects (Singleton).
shared_ptr< CommandImpl > newCommandImpl(function< SIG_OPER > &operFunctor, function< SIG_CAPT > &captFunctor, function< SIG_UNDO > &undoFunctor)
set up a new command implementation frame
static lib::Depend< CommandRegistry > instance
storage for the singleton factory used to access CommandRegistry
size_t instance_count() const
Result (Status) of command execution.
Interface: Operation Skeleton how to invoke or undo a command.
static HandlingPattern const & get(ID id)
retrieve the pre-configured pattern
void useCustomHandler(PCommandImpl com)
PCommandImpl buildTestCommand(CommandRegistry ®istry)
create a command implementation frame usable for tests.
void checkUndo(PCommandImpl com)
void checkExec(PCommandImpl com)
void performExec(CommandImpl &command) const override
void performUndo(CommandImpl &command) const override
bool isValid() const override
Top level of the command implementation.
Managing command definitions and the storage of individual command objects.
Steam-Layer command frontend.
Support for verifying the occurrence of events from unit tests.
Pre-defined command execution skeletons.
HandlingPattern::ID TEST_PATTERN
void undoIt(int, int64_t oldVal)
void operate(int someVal)
int64_t check_
< test command just adding a given value
HandlingPattern const & HaPatt
shared_ptr< CommandImpl > PCommandImpl
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Some dummy command functions used for building unit test cases.