test: add lib/strutils check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola
2012-02-26 13:31:18 +01:00
committed by Craig Small
parent abd113313d
commit 56ed9826a5
3 changed files with 34 additions and 1 deletions

View File

@ -46,6 +46,13 @@ double strtod_or_err(const char *str, const char *errmesg)
#ifdef TEST_PROGRAM
int main(int argc, char *argv[])
{
return EXIT_FAILURE;
if (argc < 2) {
error(EXIT_FAILURE, 0, "no arguments");
} else if (argc < 3) {
printf("%ld\n", strtol_or_err(argv[1], "strtol_or_err"));
} else {
printf("%lf\n", strtod_or_err(argv[2], "strtod_or_err"));
}
return EXIT_SUCCESS;
}
#endif /* TEST_PROGRAM */