I used something like this:
CESTER_BEFORE_ALL(inst,
std::vector setup;
inst->arg = & setup;
)
This did not work because the destructor for 'setup' was called before any of the tests were actually called.
This should be a big Warning in the documentation for CESTER_BEFORE_ALL. I know the example uses dynamic allocation which gets around the problem, but it does not explain why. I think it needs a clear statement that you must use data that is not automatically deallocated.
In hindsight I understand why this is, but it took me a while to figure out why I was crashing and I think others will make the same mistake.
I used something like this:
This did not work because the destructor for 'setup' was called before any of the tests were actually called.
This should be a big Warning in the documentation for CESTER_BEFORE_ALL. I know the example uses dynamic allocation which gets around the problem, but it does not explain why. I think it needs a clear statement that you must use data that is not automatically deallocated.
In hindsight I understand why this is, but it took me a while to figure out why I was crashing and I think others will make the same mistake.