I get following error in TestClass in expectOneCall ()
error C2664: 'MockFunctionCall::andReturnValue' : cannot convert
parameter 1 from 'FileInterfaceMock' to 'void *'
FileInterfaceMock pMock;
FileInterfaceContainer FileInterfaceContainer(&pMock);
//Here's the error C2664
mock("FileInterface").expectOneCall("openFile").andReturnValue(pMock);
Here's production file Mock same code as above. I changed it to
getPointerValue in openFile()
class FileInterfaceMock: public FileInterface
{
ProductionFile * openFile()
{
//getStringValue returns void *;
void *voidPtr =
mock("FileInterface").actualCall("openFile").returnValue().getPointerValue();
//Is it correct and expected way to
ProductionFile *pFile = (ProductionFile *)voidPtr;
return pFile;
}
};
Thanks for quick feedback.