Where a side-effect function is a void func(void *). In this design, the side-effect function wouldn't get access to any of the arguments to the call it is side-effecting, but it could use the void* to hold a counter if it needs to have a different side-effect on different calls.
Sometimes, it's unavoidable that a mock needs to have side-effects.
I think a pretty light-weight and satisfying solution would be something like this:
Where a side-effect function is a
void func(void *)
. In this design, the side-effect function wouldn't get access to any of the arguments to the call it is side-effecting, but it could use thevoid*
to hold a counter if it needs to have a different side-effect on different calls.