Commit 35546e56 authored by Walid Boudebouda's avatar Walid Boudebouda

vav_test: Also print test results when failing as expected

Output before:

PASS: <> with flags 7 as expected.
PASS: <foo> with flags 0 as expected.
PASS: <foo bar> with flags 0 as expected.
PASS: <foo bar> with flags 2 as expected.
PASS: <foo,bar> with flags 2 as expected.
PASS: <  foo  bar  > with flags 0 as expected.
PASS: <  foo  ,  bar  > with flags 2 as expected.
PASS: <foo bar > with flags 2 as expected.
PASS: <foo,bar,> with flags 2 as expected.
PASS: <foo "bar baz"> with flags 0 as expected.
PASS: <foo #bar> with flags 0 as expected.
PASS: <foo #bar> with flags 1 as expected.
PASS: <foo#bar> with flags 0 as expected.
PASS: <foo#bar> with flags 1 as expected.
PASS: <\> with flags 4 as expected.
PASS: <\x20> with flags 0 as expected.
PASS: <foo"bar> with flags 4 as expected.
PASS: <"foo""bar"> with flags 4 as expected.

Output after:

PASS: <> with flags 7 as expected.
PASS: <foo> with flags 0 as expected.
PASS: <foo bar> with flags 0 as expected.
PASS: <foo bar> with flags 2 as expected.
PASS: <foo,bar> with flags 2 as expected.
PASS: <  foo  bar  > with flags 0 as expected.
PASS: <  foo  ,  bar  > with flags 2 as expected.
PASS: <foo bar > with flags 2 as expected.
PASS: <foo,bar,> with flags 2 as expected.
PASS: <foo "bar baz"> with flags 0 as expected.
PASS: <foo #bar> with flags 0 as expected.
PASS: <foo #bar> with flags 1 as expected.
PASS: <foo#bar> with flags 0 as expected.
PASS: <foo#bar> with flags 1 as expected.
PASS: <\> with flags 4 as expected.
FAIL: <\> with flags 0 as expected.
FAIL: <\x> with flags 0 as expected.
FAIL: <\x2> with flags 0 as expected.
FAIL: <\x2O> with flags 0 as expected.
PASS: <\x20> with flags 0 as expected.
FAIL: <"foo> with flags 0 as expected.
PASS: <foo"bar> with flags 4 as expected.
FAIL: <foo"bar> with flags 0 as expected.
FAIL: <foo"bar> with flags 0 as expected.
PASS: <"foo""bar"> with flags 4 as expected.
FAIL: <"foo""bar"> with flags 0 as expected.
parent 631fb37b
......@@ -441,9 +441,6 @@ test_run(const struct test_case *tc, int *ret)
return (argv);
}
if (tc->argv[0] != NULL)
return (argv);
for (i = 1; i < argc && tc->argv[i] != NULL && argv[i] != NULL; i++) {
if (!strcmp(tc->argv[i], argv[i]))
continue;
......@@ -455,7 +452,7 @@ test_run(const struct test_case *tc, int *ret)
return (argv);
}
if (tc->argv[i] != NULL || argv[i] != NULL) {
if (tc->argv[0] == NULL && (tc->argv[i] != NULL || argv[i] != NULL)) {
act = i < argc ? "less" : "more";
printf(
"ERROR: Parsing string <%s> with flags %x, "
......
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