I'm writing some testing functions for a project. The test function takes a function pointer, an expected value and a test value and checks them:
int TestIntInIntOut(int (*func)(int val), int expected, int testvalue);
However, I'm also testing functions which can take an enum as a parameter or as an exit value.
Suppose the following:
typedef enum { Zero, One, Two } MyEnum;
Is there a way I can pass an entire enum as a type? For any enum. For example:
int TestIntInEnumOut(?enum? (*func)(int val), ?enum? expected, int testvalue);
or
int TestEnumInIntOut(int (*func)(?enum? val), int expected, ?enum? testvalue);
(Sort of like what a generic in C# would allow.)