I'm writing some unit tests in UnitTest++ and want to write a bunch of tests which share some common resources. I thought that this should work via their TEST_FIXTURE setup, but it seems to be constructing a new fixture for every test. Sample code:
#include <UnitTest++.h>
struct SomeFixture {
SomeFixture() {
// this line is hit twice
}
};
TEST_FIXTURE(SomeFixture, FirstTest) {
}
TEST_FIXTURE(SomeFixture, SecondTest) {
}
I feel like I must be doing something wrong; I had thought that the whole point of having the fixture was so that the setup/teardown code only happens once. Am I wrong on this? Is there something else I have to do to make it work that way?