Thanks,
Marshall
class MockObject {public:MOCK_METHOD0(ReturnsScopedPtrMock, Type*());virtual scoped_ptr<Type> ReturnsScopedPtr() OVERRIDE {return scoped_ptr<Type>(ReturnsScopedPtrMock());}};
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
You can use the following hack for such methods:class MockObject {public:MOCK_METHOD0(ReturnsScopedPtrMock, Type*());virtual scoped_ptr<Type> ReturnsScopedPtr() OVERRIDE {return scoped_ptr<Type>(ReturnsScopedPtrMock());}};Then you set expectations for ReturnsScopedPtrMock() instead of ReturnsScopedPtr(). You can also apply similar hack to mock methods that accept scoped_ptr<> parameters (for example see MockVideoStub in remoting/protocol/protocol_mock_objects.h). I don't think there is a better solution right now.
Reading through that other thread - did we ever start moving forward on migrating existing (or just new?) APIs to using scoped_ptr::Pass() instead of raw pointers? Or does Gmock provide enough friction that we're never really going to make widespread use of it?