diff mbox

[libnftables,4/6] test: report errors building XML tree

Message ID 20131031123634.32572.95881.stgit@nfdev.cica.es
State Accepted
Headers show

Commit Message

Arturo Borrero Oct. 31, 2013, 12:36 p.m. UTC
Report error when building XML tree.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 tests/nft-parsing-test.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Pablo Neira Ayuso Nov. 3, 2013, 9:31 p.m. UTC | #1
On Thu, Oct 31, 2013 at 01:36:34PM +0100, Arturo Borrero Gonzalez wrote:
> Report error when building XML tree.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c
index 5333dbd..3d26c3a 100644
--- a/tests/nft-parsing-test.c
+++ b/tests/nft-parsing-test.c
@@ -274,12 +274,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) {