I have an interface that has its methods all declared as __stdcall that cause compilation errors whenever I try to stub/fake them. I am using the mstest single header with Visual Studio 2015 update 3.
an example illustrating the issue. Given the following interface:
class DependencyInterface
{
public:
~DependencyInterface() {}
virtual int RegularMethod(int foo, int bar) = 0;
virtual int __stdcall StdCallMethod(int foo, int bar) = 0;
};
and the following unit test code:
When(Method(mock, RegularMethod)); // works fine
When(Method(mock, StdCallMethod)); // compile error
This will produce the following errors (there are more C2784 then I listed, looks like one for each version of the stub function).
C2672
'fakeit::Mock::stub': no matching overloaded function found
C2784
'fakeit::MockingContext<void,arglist...> fakeit::Mock::stub(R (thiscall T::* )(arglist...) volatile const)': could not deduce template argument for 'R (thiscall T::* )(arglist...) volatile const' from 'int (__stdcall DependencyInterface::* )(int,int)'
I have an interface that has its methods all declared as __stdcall that cause compilation errors whenever I try to stub/fake them. I am using the mstest single header with Visual Studio 2015 update 3.
an example illustrating the issue. Given the following interface:
and the following unit test code:
This will produce the following errors (there are more C2784 then I listed, looks like one for each version of the stub function).
C2672::stub': no matching overloaded function found
'fakeit::Mock
C2784::stub(R (thiscall T::* )(arglist...) volatile const)': could not deduce template argument for 'R (thiscall T::* )(arglist...) volatile const' from 'int (__stdcall DependencyInterface::* )(int,int)'
'fakeit::MockingContext<void,arglist...> fakeit::Mock