eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.23k stars 169 forks source link

Can I mock a variadic function? #184

Open adks3489 opened 4 years ago

adks3489 commented 4 years ago

I am trying to mock a variadic function. But it seems not be able to find the matching function.

I'm using Visual Studio 2015. The compile error message is:

'fakeit::Mock<Foo>::stub': no matching overloaded function found

Is there any way I can mock variadic functions? Thanks.

struct Foo
{
    virtual void bar(const char* format, ...)
    {
    }
};
Mock<Foo> mock;
Fake(Method(mock, bar));
teramil commented 2 years ago

@adks3489 have you got any answers about the issue? I have the same problem.

adks3489 commented 2 years ago

@teramil Nope. I just make a fake implementation by self. I think it might not be able to do it.