Oh, one alternative is also to not call that function :)
You can call, instead, a virtual function that does nothing except to call that function, then you can mock out the other function :)
Something like this (coded in email):
class prodCode
{
public:
void nonVirtualFunction();
};
class myCode
{
public:
void methodUnderTest() {
// nonVirtualFunction is the one I originally want to call, but it is non-virtual
virtualVersionOfNonVirtualFunction();
}
virtual void virtualVersionOfNonVirtualFunction() {
a->nonVirtualFunction();
}
}
This way you wrap around the function that you can't mock. Does that help?
Bas