Hippomocks have OnCallFuncOverload macro for mocking overloaded function call. I'm trying to use for mocking function with variable count of args. Can anyone give an example for overloaded function with variable count of args?
My code
void Verbose(LPCTSTR pszFormat, ...);
void Verbose(int level, LPCTSTR pszFormat, ...);
vlevel Verbose(vlevel level, LPCTSTR pszFormat, ...);
I'm trying this code
TEST_F(VerboseTests, test)
{
MockRepository mocks;
mocks.OnCallFuncOverload((void(*)(int,LPCTSTR,...))Verbose);
}
Compiler output:
hippomocks/hippomocks.h:3241:103: error: invalid conversion from ‘void (*)(int, LPCTSTR, ...) {aka void (*)(int, const char*, ...)}’ to ‘void (*)(int, const char*)’ [-fpermissive]
#define OnCallFuncOverload(func) RegisterExpect_<__LINE__>(func, HM_NS Any, #func, __FILE__, __LINE__)