diff options
Diffstat (limited to 'tests/nft-parsing-test.c')
-rw-r--r-- | tests/nft-parsing-test.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c index 0734f07..e111fd0 100644 --- a/tests/nft-parsing-test.c +++ b/tests/nft-parsing-test.c @@ -24,6 +24,7 @@ static int test_json(const char *filename) #ifdef JSON_PARSING int ret = -1; struct nft_table *t = NULL; + struct nft_chain *c = NULL; json_t *root; json_error_t error; char *json = NULL; @@ -47,6 +48,14 @@ static int test_json(const char *filename) nft_table_free(t); } + } else if (json_object_get(root, "chain") != NULL) { + c = nft_chain_alloc(); + if (c != NULL) { + if (nft_chain_parse(c, NFT_CHAIN_PARSE_JSON, json) == 0) + ret = 0; + + nft_chain_free(c); + } } return ret; |