In my unit test case I want to check if the error message (written to STDERR FILENO) of a (failing) function is correct. For this I need to extract the error message from the FILE *stderr and convert it into a string format.
Does anyone know how to realize this?
IMHO, functions should just return a status code, but never print error messages. That'd solve your unit test problem as well.