37 #include <boost/ref.hpp> 38 #include <boost/lexical_cast.hpp> 51 using boost::lexical_cast;
54 using LERR_(EXTERNAL);
66 return contains ( command2::check_.str()
67 , util::toString (val2check)
89 _Fmt fmt (
"invoked( %2d )");
91 randVal_ =
rani (100);
92 return fmt % randVal_;
102 command2::check_.seekp(0);
106 function<string()> randFun = bind (&CommandUse2_test::randomTxt,
this);
110 .operation (command2::operate)
111 .captureUndo (command2::capture)
112 .undoOperation (command2::undoIt)
113 .bind (randFun, &blowUp_);
120 check_defaultHandlingPattern();
125 Command::remove (
"test.command2");
126 Command::remove (
"test.command2.1");
134 check_defaultHandlingPattern()
140 bool success = com();
146 success = com.undo();
152 string current = command2::check_.str();
156 CHECK (command2::check_.str() == current);
159 success = com.undo();
161 CHECK (command2::check_.str() == current);
174 com.exec(HandlingPattern::SYNC_THROW);
178 string current = command2::check_.str();
182 CHECK (command2::check_.str() == current);
191 CHECK (command2::check_.str() == current);
195 CHECK (command2::check_.str() > current);
219 #define __DELAY__ usleep(10000); 221 bool thread_has_ended{
false};
225 CHECK (not thread_has_ended);
229 string cmdID {
"test.command2"};
230 string prevExecLog = command2::check_.str();
240 CHECK (prevExecLog != command2::check_.str());
250 CHECK (thread_has_ended);
252 lumiera_interfaceregistry_destroy();
Helper class used solely for defining a Command-Object.
HandlingPattern::ID setHandlingPattern(HandlingPattern::ID)
define a handling pattern to be used by default
static lib::Depend< SteamDispatcher > instance
storage for Singleton access
lumiera_err lumiera_error_peek(void)
Check current error state without clearing it Please avoid this function and use lumiera_error() if p...
static size_t definition_count()
void throwOnError()
Check the lumiera error state, which maybe was set by C-code.
int rani(uint bound=_iBOUND())
Dispatch and execute mutation operations on the High-level model.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
static Command get(Symbol cmdID)
Access existing command for use.
Command storeDef(Symbol newCmdID) const
create a clone definition
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
static lib::Depend< SessionCommand > facade
static storage for the facade access front-end
static size_t instance_count()
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Steam-Layer command frontend.
A collection of frequently used helper functions to support unit testing.
bool protocolled(TY val2check)
diagnostics: checks if the given value has been written to the test protocol (string stream) of comma...
Pre-defined command execution skeletons.
void lumiera_interfaceregistry_init(void)
Initialise the interface registry.
Global registry for interfaces (extension points).
Some dummy command functions used for building unit test cases.
Handle object representing a single Command instance to be used by client code.
void check_DispatcherInvocation()
static HandlingPattern const & get(ID id)
retrieve the pre-configured pattern
Actually defining a command and binding it to execution parameters.
Interface: Operation Skeleton how to invoke or undo a command.
Major public Interface to the Session subsystem of Lumiera GUI.
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container