daniel_bostrom
12 years agoNew Contributor
C++ MFC unit tests always succeed
I am trying to run a number of unit tests for a MFC application; I have set it up according to the MFC unit test sample that is bundled with TestComplete. The problem is that my test methods always succeed, even when I want them to fail. Your sample works but when I copy the same test methods over to my project the ones that used to fail now all of a sudden succeed. For example this succeeds in my project:
void CMyTestClass::DoDivByZero(void)
{
int y, x;
Log["Message"]("CMyTestClass.DoDivByZero");
x = 0;
y = 10 / x;
throw "Exception";
}
Any idea what could be wrong?
Thanks
Daniel
void CMyTestClass::DoDivByZero(void)
{
int y, x;
Log["Message"]("CMyTestClass.DoDivByZero");
x = 0;
y = 10 / x;
throw "Exception";
}
Any idea what could be wrong?
Thanks
Daniel