33 using std::placeholders::_1;
34 using lib::test::showSizeof;
45 struct Num {
int n_; };
56 cout <<
"fabricate("<<base<<
", "<<offset<<
")" << endl;
58 product->n_ = base*offset;
70 typedef std::map<prodID, function<Num(int)> > DispatcherMap;
100 CHECK (
sizeof(theFact) ==
sizeof(DispatcherMap));
102 typedef TestFactory::Product PP;
106 CHECK (1*2 == p1->n_);
107 CHECK (2*3 == p2->n_);
factory::MultiFact< Num(int), prodID, factory::BuildRefcountPtr > TestFactory
the factory instantiation used for this test
Framework for building a configurable factory, to generate families of related objects.
TestFactory theFact
Factory instance for the tests...
string showSizeof(size_t siz, string name)
for printing sizeof().
Implementation namespace for support and library code.
Num * fabricateNumberz(int base, int offset)
dummy "factory" function to be invoked
Factory for creating a family of objects by ID.
Simplistic test class runner.
A collection of frequently used helper functions to support unit testing.
void defineProduction(ID id, FUNC &&fun)
to set up a production line, associated with a specific ID
Wrapper taking ownership, by wrapping into smart-ptr.