I have recently started to try to set up unit testing for my project. However, it is not working properly for classes.
I set it up using the directions from the question Unresolved externals when compiling unit tests for Visual C++ 2012.
What will happen is that the tests will start fine, but then there will be a memory access error (C0000005). This does not happen all of the time though. It will generally fail every two or three attempts, but can fail as often as one in every 20. It does not seem to matter what other functions are in the code.
When I try to debug the test, the first time a variable is accessed or used, the test will fail.
I am trying out two different testing frameworks, Boost.test (using Boost Unit Test Adapter) and Native Unit Tests. Both of them are having the same problems.
I know that the dll and the test application both use the same calling convention (__cdecl).
What is bizarre is that the test will work for a while, then suddenly begin to fail.
The project is available here.
Reinstalling Visual Studios did not help.