Assuming we are talking about C static functions then the easiest solution to this is to make the functions non-static when you are compiling a debug build. This means the symbols will be available for you to use in your unit tests. This only works if there is no aliasing of symbols though.
If you define the symbol DEBUG
on all debug builds then something like:
#ifdef DEBUG
#define debug_export
#else
#define debug_export static
#endif
and then define your static functions like this
debug_export void foo(void)
{
...
}
and either include the declarations conditionally in the header file or manually import them in your unit test file:
extern void foo(void);
Other ways around it are to either include the unit tests in the source file itself (a bit of a mess if it gets out of hand), not bother unit testing the function (a bit of a cop-out) or to mark the function as dll-local rather than static and ensure that your unit tests are part of that dynamic object.