I have some code:
boost::system::error_code clock_error;
const boost::chrono::steady_clock::time_point START =
boost::chrono::steady_clock::now(clock_error);
and I want to mock the now() function so my test code contains this:
boost::chrono::steady_clock::time_point start(boost::chrono::seconds(0));
boost::system::system_error clock_error(1, BOOST_CHRONO_SYSTEM_CATEGORY, "foo");
mocks.ExpectCallFuncOverload( (boost::chrono::steady_clock::time_point (boost::chrono::steady_clock::*) (boost::system::error_code& clock_error))
&boost::chrono::steady_clock::now)
.With(Out(clock_error))
.Return(start);
but this doesn’t compile. I get this error:
error: no matches converting function ‘now’ to type
‘boost::chrono::steady_clock::time_point (class
boost::chrono::steady_clock::)(class boost::system::error_code&) {aka
class boost::chrono::time_pointboost::chrono::steady_clock (class
boost::chrono::steady_clock::)(class boost::system::error_code&)}’
mocks.ExpectCallFuncOverload(In file included from …
note: candidates are: static boost::chrono::steady_clock::time_point
boost::chrono::steady_clock::now(boost::system::error_code&)static BOOST_CHRONO_INLINE time_point now(system::error_code & ec); ^
../../../KACotsCode/boost/boost/chrono/system_clocks.hpp:162:46: note:
static boost::chrono::steady_clock::time_point
boost::chrono::steady_clock::now()
static BOOST_CHRONO_INLINE time_point now() BOOST_NOEXCEPT;^
Can anybody spot the problem?