data tree CHANGE move macros to functions to cleanup API
Remove lyd_node_children() since it is just an old duplication of
LYD_CHILD and LYD_CHILD_NO_KEYS macros. As a consequence, these macros
are converted to the functions together with LYD_PARENT (same names, but
lowercase) since they have similar functionality in the API.
diff --git a/tests/utests/data/test_parser_xml.c b/tests/utests/data/test_parser_xml.c
index a263ef2..c98bc95 100644
--- a/tests/utests/data/test_parser_xml.c
+++ b/tests/utests/data/test_parser_xml.c
@@ -437,15 +437,15 @@
assert_null(tree->schema);
assert_string_equal(((struct lyd_node_opaq *)tree)->name, "rpc");
assert_non_null(((struct lyd_node_opaq *)tree)->attr);
- node = lyd_node_children(tree, 0);
+ node = lyd_child(tree);
assert_string_equal(node->schema->name, "edit-config");
- node = lyd_node_children(node, 0)->next;
+ node = lyd_child(node)->next;
assert_string_equal(node->schema->name, "config");
node = ((struct lyd_node_any *)node)->value.tree;
assert_non_null(node->schema);
assert_string_equal(node->schema->name, "cp");
- node = lyd_node_children(node, 0);
+ node = lyd_child(node);
/* z has no value */
assert_null(node->schema);
assert_string_equal(((struct lyd_node_opaq *)node)->name, "z");
@@ -519,7 +519,7 @@
assert_null(tree->schema);
assert_string_equal(((struct lyd_node_opaq *)tree)->name, "rpc");
assert_non_null(((struct lyd_node_opaq *)tree)->attr);
- node = lyd_node_children(tree, 0);
+ node = lyd_child(tree);
assert_null(node->schema);
assert_string_equal(((struct lyd_node_opaq *)node)->name, "action");
assert_null(((struct lyd_node_opaq *)node)->attr);
@@ -580,7 +580,7 @@
assert_null(tree->schema);
assert_string_equal(((struct lyd_node_opaq *)tree)->name, "notification");
assert_null(((struct lyd_node_opaq *)tree)->attr);
- node = lyd_node_children(tree, 0);
+ node = lyd_child(tree);
assert_null(node->schema);
assert_string_equal(((struct lyd_node_opaq *)node)->name, "eventTime");
assert_string_equal(((struct lyd_node_opaq *)node)->value, "2037-07-08T00:01:00Z");
@@ -654,7 +654,7 @@
assert_non_null(op);
assert_string_equal(op->schema->name, "act");
- node = lyd_node_children(op, 0);
+ node = lyd_child(op);
assert_non_null(node->schema);
assert_string_equal(node->schema->name, "al");
assert_true(node->schema->flags & LYS_CONFIG_R);
@@ -663,12 +663,12 @@
assert_null(tree->schema);
assert_string_equal(((struct lyd_node_opaq *)tree)->name, "rpc-reply");
assert_non_null(((struct lyd_node_opaq *)tree)->attr);
- node = lyd_node_children(tree, 0);
+ node = lyd_child(tree);
assert_non_null(node->schema);
assert_string_equal(node->schema->name, "c");
/* TODO print only rpc-reply node and then output subtree */
- lyd_print_tree(out, lyd_node_children(op, 0), LYD_XML, LYD_PRINT_SHRINK);
+ lyd_print_tree(out, lyd_child(op), LYD_XML, LYD_PRINT_SHRINK);
assert_string_equal(str,
"<al xmlns=\"urn:tests:a\">25</al>");
ly_out_reset(out);