29#include <boost/lexical_cast.hpp>
31using boost::lexical_cast;
41 using LERR_(LIFECYCLE);
55 virtual string identify() {
return "Interface"; }
70 virtual string identify() {
return "Implementation"; }
95 uint num{firstVal (arg)};
96 cout <<
_Fmt(
"using the Singleton should create TargetObj(%d)...\n") % num;
111 CHECK (isSameObject (t1, t2),
"not a Singleton, got two different instances." );
113 CHECK (
"Implementation" == t2.
identify());
115 cout <<
"calling a non-static method on the Singleton-"
This framework allows to (re)configure the lib::Depend front-end for dependency-injection.
Access point to singletons and other kinds of dependencies designated by type.
Helper to abstract creation and lifecycle of a dependency.
virtual string identify()
Target object to be instantiated as Singleton Allocates a variable amount of additional heap memory a...
virtual string identify()
static void setCountParam(uint c)
virtual void run(Arg arg)
void verify_error_detection()
Target object to be created by Test-Factories or as Singleton.
A front-end for using printf-style formatting.
Per type specific configuration of instances created as service dependencies.
Singleton services and Dependency Injection.
Implementation namespace for support and library code.
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Dummy target object to be created by factory for unit tests Used to verify sane memory management and...
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.