Hi,
I did encounter a problem, didn’t have a time to do a sample test to reproduce it.
This is the setup:
IObjectStoreAccess* objectStoreMock = FAKE<IObjectStoreAccess>();
WHEN_CALLED(objectStoreMock->separator()).Return('/');
The tested code
auto stam1 = store->separator();
if (repositoryPath.empty())
{
dp_error << "empty datapool path" << repositoryPath << endl;
}
else if (repositoryPath.back() == m_objectStore->separator())//store->separator())
{
dp_error << "path used should not include separator suffix:" << repositoryPath << endl;
}
The problem is in the function call in the else if. If I use a local variable then I do get the mock return. However if the function call is in the if clause I get an exception.
What am I missing?