Describe the bug
Unit tests using mocks should use a separate mock object instance per test. Right now some of our tests use global mock instances, which can possibly become corrupt as state gets transferred between tests. This can cause reporting of wrong reasons for test failure.
See #150 for a description of the behavior and reproducible results.
Fixing this requires going through the unit test files in Common/test and either declaring the mock in a test fixture, or declaring one instance of the mock object per test (the former is cleaner and preferred, see an example).
Describe the bug Unit tests using mocks should use a separate mock object instance per test. Right now some of our tests use global mock instances, which can possibly become corrupt as state gets transferred between tests. This can cause reporting of wrong reasons for test failure.
See #150 for a description of the behavior and reproducible results.
In googlemock examples, the Mock* object is declared within the
TEST()
block: https://github.com/google/googletest/blob/master/googlemock/docs/ForDummies.md#using-mocks-in-testsAdditional context
Fixing this requires going through the unit test files in
Common/test
and either declaring the mock in a test fixture, or declaring one instance of the mock object per test (the former is cleaner and preferred, see an example).