0

I use Visual Studio Native Unit Test Framework for C++. When an assertion fails, next statements aren't executed and local objects destructors are called, so it seems like an exception is thrown, but I can't catch any C++ exception by catch (...) clause. After some experiments, I noticed that __int2c() call (that triggers the 2c interrupt, due to documentation), for example, has the same effect. By this day I was aware only about exceptions that have such behavior. Could you give me some hint about what can be the reason in this case?

UPDATE:

Here is a code sample

void func()
{
    struct Foo
    {
        ~Foo()
        {
            // this code is executed
        }
    };

    Foo foo;

    try
    {
        Assert::IsTrue(false);
    }
    catch (...)
    {
        // this code is not executed 
    }

    // this code is not executed
}
undermind
  • 1,779
  • 13
  • 33

0 Answers0