From a48ee0f0a31fb709a731bd55b9afc3e03de57f10 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Thu, 31 Oct 2013 13:36:34 +0100 Subject: test: report errors building XML tree Report error when building XML tree. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- tests/nft-parsing-test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c index 5eaaa1e..8f01233 100644 --- a/tests/nft-parsing-test.c +++ b/tests/nft-parsing-test.c @@ -273,12 +273,18 @@ static int test_xml(const char *filename) tree = mxmlLoadFile(NULL, fp, MXML_NO_CALLBACK); fclose(fp); - if (tree == NULL) + if (tree == NULL) { + printf("unable to build XML tree from file %s %s\n", filename, + FAILED_STR); return -1; + } xml = mxmlSaveAllocString(tree, MXML_NO_CALLBACK); - if (xml == NULL) + if (xml == NULL) { + printf("unable to alloc string from XML tree from %s %s\n", + filename, FAILED_STR); return -1; + } /* Check what parsing should be done */ if (strcmp(tree->value.opaque, "table") == 0) { -- cgit v1.2.3