You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi @k1988 !
No, this is not a bug, the output looks valid.
The test_case7 is supposed to demonstrate that the exceptions thrown from the manually loaded module can be captured by this module.
They are not supposed to be captured by tests.exe, but by the exception handlers within the test_case7. So, for example:
voidmake_exception2()
{
std::cout << __FUNCTION__ << ": Throwing exception:" << std::endl;
__try {
RaiseException(STATUS_INTEGER_DIVIDE_BY_ZERO, 0, 0, 0); // here we throw an exception
}
__except (EXCEPTION_EXECUTE_HANDLER) {
std::cout << "Exception handled: STATUS_INTEGER_DIVIDE_BY_ZERO" << std::endl; // the appropriate handler should be found and executed
}
}
The exception handler comes in the __except block, and if everything is ok, it should be found and executed. And indeed your output shows a message proving that it was executed.
In your case (make_exception3), you added one more exception, and you didn't create any handler for it. Your exception is not in any try-except block. That's why no handler could be found in the test_case7, and it got passed to test.exe. It is a normal situation, and not a bug.
My environment:
I run the tests by :
tests.exe 18 test_case7\test_case7.exe
.I got the outputs:
Then the tests.exe exit. but "Exception captured by the caller" has never been triggered.
If i add a new function in test_case7:
Then the tests.exe captured the new excption.
So, is this a bug?
PS:I'm sorry for my English, I used a translation tool.
The text was updated successfully, but these errors were encountered: