The current way I am using it with cppunit is to clear out a bunch of
static state that my system has. Everything in my system interfaces
through a static Factory class to build primitives that communicate
with IPC and such. I want to ensure that the TestFactory double is
created at the beginning of every spec and doesn't maintain any old
state from previous specs. Here is my cppunit one:
class Initializer : public CPPUNIT_NS::TestListener
{
private:
TestFactory* factory;
public:
void startTest( CPPUNIT_NS::Test *test )
{
factory = new TestFactory();
CoreData::LocalFactory::Clear();
}
void endTest( CPPUNIT_NS::Test *test )
{
delete factory;
}
};
On Jul 11, 11:39 am, Joakim Karlsson <
joakim.h.karls...@gmail.com>
wrote: