46 #include <boost/ref.hpp> 47 #include <boost/lexical_cast.hpp> 60 using boost::lexical_cast;
63 using LERR_(EXTERNAL);
75 return contains ( command2::check_.str()
76 , util::toString (val2check)
98 _Fmt fmt (
"invoked( %2d )");
100 randVal_ = rand() % 100;
101 return fmt % randVal_;
110 command2::check_.seekp(0);
114 function<string()> randFun = bind (&CommandUse2_test::randomTxt,
this);
118 .operation (command2::operate)
119 .captureUndo (command2::capture)
120 .undoOperation (command2::undoIt)
121 .bind (randFun, &blowUp_);
128 check_defaultHandlingPattern();
133 Command::remove (
"test.command2");
134 Command::remove (
"test.command2.1");
142 check_defaultHandlingPattern()
148 bool success = com();
154 success = com.undo();
160 string current = command2::check_.str();
164 CHECK (command2::check_.str() == current);
167 success = com.undo();
169 CHECK (command2::check_.str() == current);
182 com.exec(HandlingPattern::SYNC_THROW);
186 string current = command2::check_.str();
190 CHECK (command2::check_.str() == current);
199 CHECK (command2::check_.str() == current);
203 CHECK (command2::check_.str() > current);
227 #define __DELAY__ usleep(10000); 229 bool thread_has_ended{
false};
233 CHECK (not thread_has_ended);
237 string cmdID {
"test.command2"};
238 string prevExecLog = command2::check_.str();
248 CHECK (prevExecLog != command2::check_.str());
258 CHECK (thread_has_ended);
260 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.
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()
Simple 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