Hi,
I am new to GMOCK.
Trying to mock the method which is taking LPCTSTR as a parameter and returning LPCTSTR .
example: virtual LPCTSTR GetData(LPCTSTR key) const.
My mock looks like this MOCK_CONST_METHOD1(GetData, LPCTSTR(LPCTSTR key));
My expected call looks like this
CString str("tesing");
LPCTSTR key = str;
LPCTSTR csValue;
EXPECT_CALL(*obj, GetData(key)).WillOnce(Return(csPSValue));
/// Function body///
LPCTSTR CSomeInfo::Get(LPCTSTR key)
{
return GetData(key ); // mocked method
}
///
Here I always get null string as a return value. I was successfully mock the methods which are having integer, CString parameters but not able to do for LPCTSTR
Please help me.
Thanks,
Yogish