data tree FEATURE option to skip list key children
diff --git a/tests/utests/data/test_merge.c b/tests/utests/data/test_merge.c
index c109c74..da53069 100644
--- a/tests/utests/data/test_merge.c
+++ b/tests/utests/data/test_merge.c
@@ -575,7 +575,7 @@
st->source = NULL;
/* c should be replaced and now be default */
- assert_true(lyd_node_children(st->target)->flags & LYD_DEFAULT);
+ assert_true(lyd_node_children(st->target, 0)->flags & LYD_DEFAULT);
}
static void
@@ -616,7 +616,7 @@
assert_int_equal(lyd_merge(&st->target, st->source, LYD_MERGE_EXPLICIT), LY_SUCCESS);
/* c should not be replaced, so c remains not default */
- assert_false(lyd_node_children(st->target)->flags & LYD_DEFAULT);
+ assert_false(lyd_node_children(st->target, 0)->flags & LYD_DEFAULT);
}
static void
diff --git a/tests/utests/data/test_parser_xml.c b/tests/utests/data/test_parser_xml.c
index 3671b32..18b54d4 100644
--- a/tests/utests/data/test_parser_xml.c
+++ b/tests/utests/data/test_parser_xml.c
@@ -432,9 +432,9 @@
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);
+ node = lyd_node_children(tree, 0);
assert_string_equal(node->schema->name, "edit-config");
- node = lyd_node_children(node)->next;
+ node = lyd_node_children(node, 0)->next;
assert_string_equal(node->schema->name, "config");
node = ((struct lyd_node_any *)node)->value.tree;
/* l1 key c has invalid value */
@@ -443,7 +443,7 @@
node = node->next;
assert_non_null(node->schema);
assert_string_equal(node->schema->name, "cp");
- node = lyd_node_children(node);
+ node = lyd_node_children(node, 0);
/* z has no value */
assert_null(node->schema);
assert_string_equal(((struct lyd_node_opaq *)node)->name, "z");
@@ -510,7 +510,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);
+ node = lyd_node_children(tree, 0);
assert_null(node->schema);
assert_string_equal(((struct lyd_node_opaq *)node)->name, "action");
assert_null(((struct lyd_node_opaq *)node)->attr);
@@ -568,7 +568,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);
+ node = lyd_node_children(tree, 0);
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");
@@ -634,7 +634,7 @@
assert_non_null(op);
assert_string_equal(op->schema->name, "act");
- node = lyd_node_children(op);
+ node = lyd_node_children(op, 0);
assert_non_null(node->schema);
assert_string_equal(node->schema->name, "al");
assert_true(node->schema->flags & LYS_CONFIG_R);
@@ -643,12 +643,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);
+ node = lyd_node_children(tree, 0);
assert_non_null(node->schema);
assert_string_equal(node->schema->name, "c");
/* TODO print only rpc-reply node and then output subtree */
- lyd_print(out, lyd_node_children(op), LYD_XML, 0);
+ lyd_print(out, lyd_node_children(op, 0), LYD_XML, 0);
assert_string_equal(str,
"<al xmlns=\"urn:tests:a\">25</al>");
ly_out_reset(out);
diff --git a/tests/utests/data/test_types.c b/tests/utests/data/test_types.c
index 7775abd..47dd5e4 100644
--- a/tests/utests/data/test_types.c
+++ b/tests/utests/data/test_types.c
@@ -1171,7 +1171,7 @@
assert_non_null(tree = lyd_parse_mem(s->ctx, data, LYD_XML, LYD_VALOPT_DATA_ONLY));
tree = tree->prev;
assert_int_equal(LYS_CONTAINER, tree->schema->nodetype);
- leaf = (struct lyd_node_term*)(lyd_node_children(lyd_node_children(tree))->prev);
+ leaf = (struct lyd_node_term*)(lyd_node_children(lyd_node_children(tree, 0), 0)->prev);
assert_int_equal(LYS_LEAF, leaf->schema->nodetype);
assert_string_equal("lr1", leaf->schema->name);
assert_string_equal("y", leaf->value.canonical_cache);
@@ -1183,7 +1183,7 @@
assert_non_null(tree = lyd_parse_mem(s->ctx, data, LYD_XML, LYD_VALOPT_DATA_ONLY));
tree = tree->prev;
assert_int_equal(LYS_CONTAINER, tree->schema->nodetype);
- leaf = (struct lyd_node_term*)(lyd_node_children(lyd_node_children(tree)->prev->prev)->prev);
+ leaf = (struct lyd_node_term*)(lyd_node_children(lyd_node_children(tree, 0)->prev->prev, 0)->prev);
assert_int_equal(LYS_LEAF, leaf->schema->nodetype);
assert_string_equal("lr2", leaf->schema->name);
assert_string_equal("y", leaf->value.canonical_cache);
@@ -1196,7 +1196,7 @@
assert_non_null(tree = lyd_parse_mem(s->ctx, data, LYD_XML, LYD_VALOPT_DATA_ONLY));
tree = tree->prev;
assert_int_equal(LYS_CONTAINER, tree->schema->nodetype);
- leaf = (struct lyd_node_term*)(lyd_node_children(lyd_node_children(tree)->prev)->prev);
+ leaf = (struct lyd_node_term*)(lyd_node_children(lyd_node_children(tree, 0)->prev, 0)->prev);
assert_int_equal(LYS_LEAF, leaf->schema->nodetype);
assert_string_equal("lr3", leaf->schema->name);
assert_string_equal("c", leaf->value.canonical_cache);
diff --git a/tests/utests/data/test_validation.c b/tests/utests/data/test_validation.c
index ce0a9a4..39b8681 100644
--- a/tests/utests/data/test_validation.c
+++ b/tests/utests/data/test_validation.c
@@ -490,8 +490,8 @@
data = "<cont xmlns=\"urn:tests:a\"><a>val</a><b>val_b</b></cont><c xmlns=\"urn:tests:a\">val_c</c>";
assert_int_equal(LY_SUCCESS, lyd_parse_xml_data(ctx, data, LYD_VALOPT_DATA_ONLY, &tree));
assert_non_null(tree);
- assert_string_equal("a", lyd_node_children(tree)->schema->name);
- assert_int_equal(LYD_WHEN_TRUE, lyd_node_children(tree)->flags);
+ assert_string_equal("a", lyd_node_children(tree, 0)->schema->name);
+ assert_int_equal(LYD_WHEN_TRUE, lyd_node_children(tree, 0)->flags);
assert_string_equal("c", tree->next->schema->name);
assert_int_equal(LYD_WHEN_TRUE, tree->next->flags);
lyd_free_all(tree);