25 #include <boost/lexical_cast.hpp> 33 using boost::lexical_cast;
34 using lib::test::showSizeof;
48 virtual operator string ()
const =0;
66 operator string()
const override 68 return "Impl-"+lexical_cast<
string> (ii);
116 CHECK (isSameObject(o1,o2));
118 TestFactory anotherFact;
119 CHECK (isnil (anotherFact));
122 TestFactory::Singleton<Implementation<ONE>> anotherSingletonHolder (anotherFact,ONE);
124 CHECK (isSameObject(o2,o3));
Framework for building a configurable factory, to generate families of related objects.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
TestFactory theFact
Factory instance for the tests...
string showSizeof(size_t siz, string name)
for printing sizeof().
Implementation namespace for support and library code.
Factory for creating a family of objects by ID.
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...
A collection of frequently used helper functions to support unit testing.
Convenience shortcut for automatically setting up a production line, to fabricate a singleton instanc...
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...