Commit 7119d790 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Avoid printing %s,NULL in case of errors we do not expect.

Fixes #2879
parent 708cec81
...@@ -349,15 +349,17 @@ main(int argc, char *argv[]) ...@@ -349,15 +349,17 @@ main(int argc, char *argv[])
for (tc = test_cases; tc->str; ++tc) { for (tc = test_cases; tc->str; ++tc) {
e = VNUM_2bytes(tc->str, &val, tc->rel); e = VNUM_2bytes(tc->str, &val, tc->rel);
if (e != tc->err) { if (e != NULL)
printf("%s: VNUM_2bytes(\"%s\", %ju) (%s) != (%s)\n", val = 0;
*argv, tc->str, tc->rel, tc->err, e); if (e == tc->err && val == tc->val)
++ec; continue;
} else if (e == NULL && val != tc->val) { ++ec;
printf("%s: VNUM_2bytes(\"%s\", %ju) %ju != %ju (%s)\n", printf("%s: VNUM_2bytes(\"%s\", %ju)\n",
*argv, tc->str, tc->rel, val, tc->val, e); *argv, tc->str, tc->rel);
++ec; printf("\tExpected:\tstatus %s - value %ju\n",
} tc->err ? tc->err : "Success", tc->val);
printf("\tGot:\t\tstatus %s - value %ju\n",
e ? e : "Success", val);
} }
if (!isnan(VNUM_duration(NULL))) { if (!isnan(VNUM_duration(NULL))) {
printf("%s: VNUM_Duration(NULL) fail\n", *argv); printf("%s: VNUM_Duration(NULL) fail\n", *argv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment