Some style cleanups. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx> --- tests/nft-parsing-test.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c index 3d26c3a..e147e79 100644 --- a/tests/nft-parsing-test.c +++ b/tests/nft-parsing-test.c @@ -193,8 +193,10 @@ static int test_json(const char *filename) if (json_object_get(root, "table") != NULL) { t = nft_table_alloc(); if (t != NULL) { - if (nft_table_parse(t, NFT_TABLE_PARSE_JSON, json) == 0) - ret = compare_test(TEST_JSON_TABLE, t, filename); + if (nft_table_parse(t, + NFT_TABLE_PARSE_JSON, json) == 0) + ret = compare_test(TEST_JSON_TABLE, + t, filename); else goto failparsing; @@ -203,8 +205,10 @@ static int test_json(const char *filename) } 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 = compare_test(TEST_JSON_CHAIN, c, filename); + if (nft_chain_parse(c, + NFT_CHAIN_PARSE_JSON, json) == 0) + ret = compare_test(TEST_JSON_CHAIN, + c, filename); else goto failparsing; @@ -213,8 +217,10 @@ static int test_json(const char *filename) } else if (json_object_get(root, "rule") != NULL) { r = nft_rule_alloc(); if (r != NULL) { - if (nft_rule_parse(r, NFT_RULE_PARSE_JSON, json) == 0) - ret = compare_test(TEST_JSON_RULE, r, filename); + if (nft_rule_parse(r, + NFT_RULE_PARSE_JSON, json) == 0) + ret = compare_test(TEST_JSON_RULE, + r, filename); else goto failparsing; @@ -229,17 +235,19 @@ static int test_json(const char *filename) goto failparsing; nft_set_free(s); - } + } } else if (json_object_get(root, "nftables") != NULL) { rs = nft_ruleset_alloc(); if (rs != NULL) { - if (nft_ruleset_parse(rs, NFT_RULESET_PARSE_JSON, json) == 0) - ret = compare_test(TEST_JSON_RULESET, rs, filename); + if (nft_ruleset_parse(rs, + NFT_RULESET_PARSE_JSON, json) == 0) + ret = compare_test(TEST_JSON_RULESET, + rs, filename); else goto failparsing; nft_ruleset_free(rs); - } + } } free(json); @@ -292,7 +300,8 @@ static int test_xml(const char *filename) t = nft_table_alloc(); if (t != NULL) { if (nft_table_parse(t, NFT_TABLE_PARSE_XML, xml) == 0) - ret = compare_test(TEST_XML_TABLE, t, filename); + ret = compare_test(TEST_XML_TABLE, + t, filename); else goto failparsing; @@ -302,7 +311,8 @@ static int test_xml(const char *filename) c = nft_chain_alloc(); if (c != NULL) { if (nft_chain_parse(c, NFT_CHAIN_PARSE_XML, xml) == 0) - ret = compare_test(TEST_XML_CHAIN, c, filename); + ret = compare_test(TEST_XML_CHAIN, + c, filename); else goto failparsing; -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html