dictionary REFACTOR unify functions pattern to return LY_ERR
Change API functions manipulating with libyang dictionary to return
LY_ERR value as a primary indicator of the result and the value from the
dictionary is returned via optional output parameter.
diff --git a/tests/utests/schema/test_parser_yin.c b/tests/utests/schema/test_parser_yin.c
index e5fa612..94df4f0 100644
--- a/tests/utests/schema/test_parser_yin.c
+++ b/tests/utests/schema/test_parser_yin.c
@@ -1630,9 +1630,10 @@
{
struct test_parser_yin_state *st = *state;
const char *data;
- const char *pat = lydict_insert(st->ctx, "\006pattern", 8);
+ const char *pat;
struct lysp_ext_instance *exts = NULL;
+ assert_int_equal(LY_SUCCESS, lydict_insert(st->ctx, "\006pattern", 8, &pat));
data = ELEMENT_WRAPPER_START "<modifier value=\"invert-match\">" EXT_SUBELEM "</modifier>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, data, &pat, NULL, &exts), LY_SUCCESS);
assert_string_equal(pat, "\x015pattern");
@@ -1643,7 +1644,7 @@
exts = NULL;
FREE_STRING(st->ctx, pat);
- pat = lydict_insert(st->ctx, "\006pattern", 8);
+ assert_int_equal(LY_SUCCESS, lydict_insert(st->ctx, "\006pattern", 8, &pat));
data = ELEMENT_WRAPPER_START "<modifier value=\"invert\" />" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, data, &pat, NULL, NULL), LY_EVALID);
logbuf_assert("Invalid value \"invert\" of \"value\" attribute in \"modifier\" element. Only valid value is \"invert-match\". Line number 1.");