mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
tree234.c: minor fixes to the test suite.
Added a missing #include of string.h; arranged that the test program reports the number of errors detected at the end so I don't have to search its entire output for "ERROR"; made the test program return a nonzero exit status if any error was found.
This commit is contained in:
parent
8001dd4cbb
commit
ff7418af73
@ -1014,6 +1014,9 @@ void *del234(tree234 * t, void *e)
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
int n_errors = 0;
|
||||
|
||||
/*
|
||||
* Error reporting function.
|
||||
@ -1026,6 +1029,7 @@ void error(char *fmt, ...)
|
||||
vfprintf(stdout, fmt, ap);
|
||||
va_end(ap);
|
||||
printf("\n");
|
||||
n_errors++;
|
||||
}
|
||||
|
||||
/* The array representation of the data. */
|
||||
@ -1480,7 +1484,8 @@ int main(void)
|
||||
delpostest(j);
|
||||
}
|
||||
|
||||
return 0;
|
||||
printf("%d errors found\n", n_errors);
|
||||
return (n_errors != 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user