Hello,
is it possible to mock a function that returns a std::unique_ptr? The faked function shall return a nullptr. How can I do that?
example for the real function:
class A {
public:
std::unique_ptr<int> getIntPtr() { return 10;}
};
What I have tried but failed:
auto fakedObj = FAKE_ALL<A>();
WHEN_CALLED(fakedObj->getIntPtr()).Return(nullptr);
or
std::unique_ptr<int> nullPtr;
WHEN_CALLED(fakedObj->getIntPtr()).Return(nullPtr);
Thanks in advance!