Does google mock method support optional parameters?
I'm mocking a class. The original method is
virtual bool create(const char* filename, const char* data=NULL, uint16 port=0);
And I derive from the base class to produce the mock class:
class MockBaseClass public BaseClass
{
public:
BaseClass();
MOCK_METHOD1( create, bool(const char* filename, const char* data, uint16 port) );
};
This produces an following error
: error C2118: negative subscript
: error C2660: 'testing::internal::FunctionMocker<Function>::Invoke' : function does not take 1 arguments
with
[
Function=bool (const char *,const char *,uint16)
]
: error C2660: 'testing::internal::FunctionMocker<Function>::With' : function does not take 1 arguments
with
[
Function=bool (const char *,const char *,uint16)
]
If optional parameters are not supported by googlemock, is a solution to make my mock method work?
Regards
Amit