I'm using Google Mock to Unit Test. I want the ability to switch between fake and mock. This is the Fake.
class Fake {
public:
void test(char val1, int val2) {
}
};
And here's the Mock.
class Mock {
public:
MOCK_METHOD2(func, void(int, char*));
MOCK_METHOD2(func, void(char, int));
void delegate() {
ON_CALL(*this, func).WillByDefault([this](char val1, int val2) {
fake_medusa_->test(val1, val2);
})
}
private:
Fake *fake_;
};
The error message is: error: call to member function 'gmock_func' is ambiguous
Does someone know what's the method to achieve overload here?