unit tests: use the unit test infrastructure better

Allow UNITTEST_STOP to return the error code, use the fail & abort
macros to indicate test failure and return success instead of fail if
the unit test can't test anything because of missing features at
compile-time.  A couple of tests could never fail because they were
overriding the failure return code.
This commit is contained in:
Dan Fandrich 2023-04-01 08:59:38 -07:00
parent 419a745da6
commit a13ef31d0f
7 changed files with 60 additions and 79 deletions

View file

@ -79,7 +79,6 @@ static const char *filecontents[] = {
UNITTEST_START
{
size_t i;
for(i = 0; i < NUMTESTS; i++) {
FILE *fp;
@ -157,6 +156,4 @@ UNITTEST_START
fclose(fp);
fprintf(stderr, "OK\n");
}
return 0;
}
UNITTEST_STOP