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
ON_CALL and EXPECT_CALL cause a mock object to be referenced in a global
table Google Mock keeps. Therefore if the user code forgets to delete a
mock object, a leak checker won't be able to detect it since the object is
still reachable from the global table. This is bad as the verification of
expectations is done in the mock object's destructor.
We should use some kind of weak pointer instead of void* to reference the
mock objects in the global table.
Original issue reported on code.google.com by zhanyong...@gmail.com on 6 Feb 2009 at 7:48
The text was updated successfully, but these errors were encountered:
Vlad suggested:
> Why can't googlemock release all the pointers before exiting RUN_ALL_TESTS
when
> run under gtest?
Good point. Better yet, googlemock could report them as errors. This is
especially useful where a heap checker cannot be used.
> This can be done once gtest's test listener interface is
> published.
Yes. Or we can use a global test environment, which is already
supported. We just need to make sure that googlemock's environment is torn
down after all other test environments.
Original comment by zhanyong...@gmail.com on 26 Feb 2009 at 7:11
Original issue reported on code.google.com by
zhanyong...@gmail.com
on 6 Feb 2009 at 7:48The text was updated successfully, but these errors were encountered: