From e4e89ef3b7a84bd80a4b373220f09a70954d8cd3 Mon Sep 17 00:00:00 2001 From: Ana Rey Date: Wed, 11 Jun 2014 17:50:47 +0200 Subject: 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 --- tests/nft-parsing-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c index 2a15109..57a5730 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; } -- cgit v1.2.3