42 using std::placeholders::_1;
43 using lib::test::showSizeof;
54 struct Num {
int n_; };
65 cout <<
"fabricate("<<base<<
", "<<offset<<
")" << endl;
67 product->n_ = base*offset;
79 typedef std::map<prodID, function<Num(int)> > DispatcherMap;
109 CHECK (
sizeof(theFact) ==
sizeof(DispatcherMap));
111 typedef TestFactory::Product PP;
115 CHECK (1*2 == p1->n_);
116 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.
Simple 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.