36 #include <boost/lexical_cast.hpp> 38 using boost::lexical_cast;
58 static void setCountParam (uint c) { TargetObj::cnt = c; }
65 int TargetObj::cnt = 0;
86 uint num= isnil(arg)? 1 : lexical_cast<uint>(arg[1]);
90 cout <<
_Fmt(
"testing TargetObj(%d) as Singleton\n") % num;
91 TargetObj::setCountParam(num);
92 TargetObj& t1 = singleton();
93 TargetObj& t2 = singleton();
95 CHECK (isSameObject(t1, t2),
"not a Singleton, got two different instances." );
97 cout <<
"calling a non-static method on the Singleton instance" <<endl
Dummy target object to be created by factory for unit tests Used to verify sane memory management and...
A front-end for using printf-style formatting.
Access point to singletons and other kinds of dependencies designated by type.
Implementation namespace for support and library code.
Target object to be created by Test-Factories or as Singleton.
Target object to be instantiated as Singleton Allocates a variable amount of additional heap memory a...
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Singleton services and Dependency Injection.
Helper to abstract creation and lifecycle of a dependency.
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.