aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wsbatch.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/wsbatch.c b/tests/wsbatch.c
index 5d986db..372c3ba 100644
--- a/tests/wsbatch.c
+++ b/tests/wsbatch.c
@@ -33,42 +33,44 @@ runtest (const char **input, struct wordsplit *wsinit, int flags)
for (i = 0; input[i]; i++)
{
size_t j;
const char *text = input[i];
struct wordsplit ws = *wsinit;
i++;
for (j = 0; input[i+j]; j++);
count++;
if (wordsplit (text, &ws, flags))
{
- fprintf (stderr, "E: %s: parse failed\n", input);
+ fprintf (stderr, "E: %s: parse failed\n", text);
errors++;
}
else if (ws.ws_wordc != j)
{
fprintf (stderr, "E: %s: wrong number of fields (%lu/%lu)\n",
- text, ws.ws_wordc, j);
+ text,
+ (unsigned long) ws.ws_wordc, (unsigned long) j);
errors++;
}
else
{
size_t k;
for (k = 0; k < ws.ws_wordc; k++)
if (strcmp (ws.ws_wordv[k], input[i + k]))
{
fprintf (stderr, "E: %s: word %lu mismatch: %s/%s\n",
- text, k, ws.ws_wordv[k], input[i + k]);
+ text, (unsigned long) k,
+ ws.ws_wordv[k], input[i + k]);
errors++;
break;
}
}
i += j;
}
}
const char *testv[] = {
"a bcd", "a", "bcd", NULL,
"a bcd \tef 13 456", "a", "bcd", "ef", "13", "456", NULL,
"a \"s p a c e\" b", "a", "s p a c e", "b", NULL,
@@ -129,18 +131,18 @@ main ()
runtest (testv, &ws, WRDSF_DEFFLAGS);
ws.ws_comment = "#";
runtest (testcmt, &ws, WRDSF_DEFFLAGS|WRDSF_COMMENT);
ws.ws_delim = ":\n";
runtest (testcol, &ws, WRDSF_NOVAR | WRDSF_NOCMD | WRDSF_DELIM);
ws.ws_delim = " =,";
runtest (testcol2, &ws,
WRDSF_NOVAR | WRDSF_NOCMD | WRDSF_DELIM | WRDSF_RETURN_DELIMS);
- printf ("Tests: %lu\n", count);
+ printf ("Tests: %lu\n", (unsigned long) count);
if (errors)
- printf ("Failures: %lu\n", errors);
+ printf ("Failures: %lu\n", (unsigned long) errors);
return errors ? 1 : 0;
}

Return to:

Send suggestions and report system problems to the System administrator.