summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAna Rey <anarey@gmail.com>2014-06-11 17:50:47 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2014-06-11 19:13:47 +0200
commite4e89ef3b7a84bd80a4b373220f09a70954d8cd3 (patch)
tree1c29e8f199133c6d193326835ec8a066a1d4ede8 /tests
parentba68a2c0f427ab533961a5eff3516f068ded7189 (diff)
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 <anarey@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/nft-parsing-test.c3
1 files changed, 2 insertions, 1 deletions
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;
}