Open torbjoernk opened 6 years ago
Hmm, it looks like there is a singleton being used now, so using two repos no longer works. The example is a skinned down example where, due to complex setup, it was necessary to introduce a second repository to change the order of destructor calls, or rather the point in time when the expectations on a mock are evaluated. Is there any way to achieve such an effect using other means?
We were able to workaround our need for two separate mock repositories. Thus, this issue isn't relevant for us any more.
When using more than one mock repository, the destructor of the second mock repository fails with a memory access violation at hippomocks.h:942 when calling
TestFinished()
on the reporter of the second repository asMockRepoInstanceHolder<0>::instance = nullptr;
andMockRepoInstanceHolder<0>::reporter = nullptr;
has been called in the destructor of the first mock repository.Sample code: