I am writing a test using GoogleTest for the following class and I am getting the above error.
class Base { // Other Functions; CSig objSig[50]; }
The Class CSig is as follows:
class CSig { //... constructor, destructor(empty) and some functions CMod *objMod; CDemod *objDemod; } CSig :: CSig { bIsInitialised = false; for (int i=0; i<MAX_NUM; i++) { PStrokePrev[i] = 0.0; } }
However, when I discard CSig objSig[50]
, the tests run fine.
What can I do to solve this issue? Also, I need to have CSig objSig[50]
in the Base class.
A SEH (Structured Exception Handling) exception is not a C++-exception that can be handled using c++-language constructs (try-catch) but it is raised from windows itself and points to some fundamental flaw. SEH-exceptions are very annoying because they do not cause normal stack unwinding which can lead to unclosed files or not-unlocked mutexes that should normally cleared by the destructors of the owning object. I have encountered SEH-exceptions when accessing memory that does not belong to the current process so I recommend looking at memory-related instructions in the constructor and destructor of CSig. You can read about SEH, for instance, here
The way I just found the problem was that in Visual Studio I went to Debug->Exceptions, and checked everything in the first column. Then run/debug your unit tests, and it will throw an exception on the line that the problem is at. That's where you need to debug/fix it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With