Hi Gianni, A mock object can either fail directly when a call is made that’s invalid, or if no call happens it must be «verified» to know all calls are done and to check if any unanswered call is remaining. The verification is either done manually (using MOCK_VERIFY for instance) or automatically when the mock object is destroyed. Here you are doing neither given you’re creating a naked pointer and never delete it. Does that make sense? MAT.
I think you probably have analyzed the problem correcty, but short of changing the policy I don’t think there is a way out of it. Out of curiosity how does BOOST_REQUIRE behave when it fails in a thread, as it’s what abort in the default policy is modelled after if I remember correctly?
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<mock::exception>'
You’re destroying MockPanel object twice, you should probably use std::make_shared to instantiate a shared pointer instead of MockPanel mockPanel; std::shared_ptr<mockpanel> panel { &mockPanel };
You’re destroying the shared pointer twice, you should probably use std::make_shared to instantiate a shared pointer instead of MockPanel mockPanel; std::shared_ptr<mockpanel> panel { &mockPanel };
Hi Gianni, Sorry I don’t have access to a C++ compiler at the moment so cannot verify this. What happens if you only set the first two expectations MOCK_EXPECT(macAddressFinderMock->find).with(mock::any, "192.168.0.223").never(); MOCK_EXPECT(macAddressFinderMock->find).with(mock::any, "192.168.0.222").returns("AA-BB-CC-DD-EE-FF"); and call it with "192.168.0.223"? MAT.
Turtle 1.3.1 has been released !
test succeed with one() or never() indifferently