A template that creates test cases by applying a functor to a test fixture object.
This template generates test cases that use an applicable for test execution.
That applicable is most likely generated from a member function of the test fixture class.
Note that the fixture class does not need to inherit from Test.
The fixture object and the applicable instance are owned by the test gadget. So when the
gadget is destroyed, this objects are deleted as well.
The template function apply could be used to construct the Applicable-instance for the test
action on the fly (see Applicable).
Note that there also versions of the apply functions that allow to specify
constant parameters for the member function. The test gadget itself could be easily created
with the makeTestGadget template functions:
template<class T> inline TestGadget<T>* makeTestGadget (
const string& name,
Applicable<T>* testFunc
);
template<class T> inline TestGadget<T>* makeTestGadget (
const string& name,
T* object,
Applicable<T>* testFunc,
bool releaseFixture = false
);
The first version constructs automatically a fixture instance which is owned by the
gadget (so it is also deleted when the gadget is destroyed). The second version allows
to specify the fixture object. Because such a function is needed when a fixture is
used for multiple gadgets, the releaseFixture parameter defaults to false.