I have a class that has a method which accepts variable arguments:
class MyClass
{
public:
virtual void myprint(const char* format, ...) = 0;
};
I was trying to mock the above class
class Mock : public MyClass
{
public:
MOCK_METHOD1(myprint, void (const char* format, ...));
}
But it gives my compilation issues:
error: 'Result' in 'struct testing::internal::Function<void(const char*, ...)>' does not name a type
MOCK_METHOD1(myprint, void (const char* format, ...));
^
error: incomplete type 'testing::internal::Function<void(const char*, ...)>' used in nested name specifier
error: incomplete type 'testing::internal::Function<void(const char*, ...)>' used in nested name specifier
error: template argument 1 is invalid
error: field 'gmock1_print_15' has incomplete type 'testing::internal::FunctionMocker<void(const char*, ...)>'
How can I mock a method that takes variable arguments as a parameter?