Open AlexianMasson opened 5 years ago
Hey @alaenix,
FakeIt relies on internal compiler implementation. I don't think working in Release is expected. I found that even changing the level of debug information causes destructor mocks to fail. I'm not sure if this is your case.
I added this in the readme, after some similar issues:
"In MSC++, your project must have Edit And Continue debug mode on (https://msdn.microsoft.com/en-us/library/esaeyddf.aspx) which is same of /ZI compiler switch. If you don't use this, you will have exceptions mocking destructors (which includes unique_ptr and other smart pointers)."
Hi @ericlemes,
thanks for your response.
FakeIt relies on internal compiler implementation. I don't think working in Release is expected.
In my case, I used a CI system to build and test an application. To be close to user usage of the application, this tests are run on Release mode.
I found that even changing the level of debug information causes destructor mocks to fail. I'm not sure if this is your case.
I've seen this issue but i don't think this is my case.
I found a workaround by not using virtual destructor but I will eventually investigate the usage of WinGW on Release.
@eranpeer Regarding "Release mode", are there any limitations to expect with FakeIt?
Have same problem under GCC 5.4.0. CLang 4.0 works well
Same problem found using gcc 8.3.0 compiling for x86_64 for qemu using yocto.
The problem is workarounded compiling with -O0.
Hi,
one of my google test suite, that use for the first time the fakeit::Mock feature, had crashed but ONLY on a Windows 10 Win32 RELEASE build.
On Debug it works and on MacOs/Ubuntu system it works also but on Debug AND Release mode (using clang, didn't try with gcc).
I identify the problem but didn't understand it : The test suite crash when the mocked class have a virtual destructor.
Here is a minimalist example that crash on Windows 10 with Win32 on Release mode:
main.cpp
A.h
MockTest.h
MockTest.cpp
Solution to make the test suite works: Remove the virtual destructor...