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
{{ message }}
This repository was archived by the owner on Jul 17, 2019. It is now read-only.
There is a problem I met using GMock with 3rdParty UT-engine based on exceptions handling.
If I enables throwing exceptions from GMock: ::testing::GTEST_FLAG(throw_on_failure) = true
Then in test case if I created a local Mock object with invalid expectation call then I will get exception in exception:
Because of invalid arguments passed to the method.
During stack unwinding we will destroy Mock object and will call VerifyAndClearExpectationsLocked(); from~FunctionMockerBase()
These behavior obviously leads to process termination.
The suggestion is to check whether we already in unhandled exception or not before Verifing expectations in destructor:
if (!std::uncaught_exception())
{
VerifyAndClearExpectationsLocked();
}
The text was updated successfully, but these errors were encountered:
There is a problem I met using GMock with 3rdParty UT-engine based on exceptions handling.
If I enables throwing exceptions from GMock:
::testing::GTEST_FLAG(throw_on_failure) = true
Then in test case if I created a local Mock object with invalid expectation call then I will get exception in exception:
VerifyAndClearExpectationsLocked();
from~FunctionMockerBase()
These behavior obviously leads to process termination.
The suggestion is to check whether we already in unhandled exception or not before Verifing expectations in destructor:
The text was updated successfully, but these errors were encountered: