From: Ana Rey Date: Wed, 11 Jun 2014 15:50:47 +0000 (+0200) Subject: tests: nft-parsing-test: Display error reason when testing XML X-Git-Tag: libnftnl-1.0.2~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e89ef3b7a84bd80a4b373220f09a70954d8cd3;p=thirdparty%2Flibnftnl.git tests: nft-parsing-test: Display error reason when testing XML Add the use of system errors (nft_parse_perror) in test_xml to know which node is not found. Example: parsing xmlfiles/75-ruleset.xml: FAILED (Invalid argument) Reason : Node "flags" not found [ I have mangled this patch to rename this the current 'fail' message to 'Reason' --pablo ] Signed-off-by: Ana Rey Signed-off-by: Pablo Neira Ayuso --- diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c index 2a15109b..57a57303 100644 --- a/tests/nft-parsing-test.c +++ b/tests/nft-parsing-test.c @@ -140,7 +140,7 @@ failparsing: fclose(fp); printf("parsing %s: ", filename); printf("\033[31mFAILED\e[0m (%s)\n", strerror(errno)); - nft_parse_perror("fail", err); + nft_parse_perror("Reason", err); return -1; } @@ -177,6 +177,7 @@ failparsing: fclose(fp); printf("parsing %s: ", filename); printf("\033[31mFAILED\e[0m (%s)\n", strerror(errno)); + nft_parse_perror("Reason", err); return -1; }