The header doesn't need to include anything except <stddef.h>
(to define size_t
).
These two externs are never used:
extern size_t passes;extern size_t failed;
We should just delete them - or perhaps change the shadowing declarations in the implementation file to refer to these globals instead.
Test output should go to stderr
rather than being mixed in with program results. Consider printing the file name as well as line number, so the usual tools can take users straight to the error location.
Please use a suitable variable for this size (or derive the related values using sizeof bar
):
char bar[81];
As it stands, there's too many places that need to be consistently modified if this value is adjusted.
We have a string here that assumes a specific output device:
printf("\033[0;31m");
That looks a mess on other terminal types, and hampers parsing when output is not a terminal.
The main()
always returns a success status, even when one or more tests fail. That's wrong, and makes it hard to use this test suite as part of a larger build process.