27 #include <boost/lexical_cast.hpp> 29 using boost::lexical_cast;
49 static void setCountParam (uint c) { TargetObj::cnt = c; }
56 int TargetObj::cnt = 0;
77 uint num{firstVal (arg)};
81 cout <<
_Fmt(
"testing TargetObj(%d) as Singleton\n") % num;
82 TargetObj::setCountParam(num);
83 TargetObj& t1 = singleton();
84 TargetObj& t2 = singleton();
86 CHECK (isSameObject(t1, t2),
"not a Singleton, got two different instances." );
88 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...
Simplistic 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, based directly on the referee's memory identities. ...