34 #include <boost/lexical_cast.hpp> 42 using boost::lexical_cast;
43 using lib::test::showSizeof;
57 virtual operator string ()
const =0;
75 operator string()
const override 77 return "Impl-"+lexical_cast<
string> (ii);
125 CHECK (isSameObject(o1,o2));
127 TestFactory anotherFact;
128 CHECK (isnil (anotherFact));
131 TestFactory::Singleton<Implementation<ONE>> anotherSingletonHolder (anotherFact,ONE);
133 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...
Simple 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, bypassing any custom comparison operators.