Lumiera  0.pre.03
»edit your freedom«
test-dummy-commands.hpp File Reference

Go to the source code of this file.

Description

Some dummy command functions used for building unit test cases.

Any of these functions comes in triples of operation function, undo state capturing function and UNDO function. They are placed into a nested test namespace, together with some global variables, usable as backdoor to verify the effect of calling these functions.

See also
command-use1-test.cpp
CommandBasic_test simple complete command definition example

Definition in file test-dummy-commands.hpp.

#include "lib/error.hpp"
#include "lib/test/test-helper.hpp"
#include "steam/control/command-setup.hpp"
#include <functional>
#include <sstream>
#include <string>

Typedefs

typedef function< string()> FunS
 

Functions

int64_t capture (int)
 
string capture (FunS, bool *)
 
ulong capture ()
 
void operate (int someVal)
 
void operate (FunS func, bool *fail)
 
void operate ()
 
void undoIt (int, int64_t oldVal)
 
void undoIt (FunS, bool *fail, string previousProtocol)
 
void undoIt (ulong oldVal)
 

Variables

CommandSetup test_Dummy_command1
 test dummy command to add the argument to a global variable
 
CommandSetup test_Dummy_command2
 test dummy command to invoke the given functor and append the result onto a global log string buffer
 
CommandSetup test_Dummy_command3
 test dummy command to increment a global variable; no arguments
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::control
 Steam-Layer dispatcher, controller and administrative facilities.