schema internal MAINTENANCE removed new_mods set
... because it is not necessary to have it in the ::lys_parser_ctx.
And it is not used at all in the yang_parse_sub/module or
yin_parse_sub/module functions. In other functions
(lys_resolve_import_include, lys_parse_submodule,
lysp_load_submodules), new_mods is passed as a parameter.
diff --git a/tests/utests/schema/test_parser_yang.c b/tests/utests/schema/test_parser_yang.c
index 3190d40..e48abc4 100644
--- a/tests/utests/schema/test_parser_yang.c
+++ b/tests/utests/schema/test_parser_yang.c
@@ -589,7 +589,6 @@
struct lysp_module *mod = NULL;
struct lysp_submodule *submod = NULL;
struct lys_module *m;
- struct ly_set new_mods = {0};
struct lys_yang_parser_ctx *ctx_p;
mod = mod_renew(YCTX);
@@ -761,7 +760,7 @@
in.current = "module " SCHEMA_BEGINNING "} module q {namespace urn:q;prefixq;}";
m = calloc(1, sizeof *m);
m->ctx = YCTX->parsed_mod->mod->ctx;
- assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m, &new_mods));
+ assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m));
CHECK_LOG_CTX("Trailing garbage \"module q {names...\" after module, expected end-of-input.", "Line number 1.");
yang_parser_ctx_free(ctx_p);
lys_module_free(m);
@@ -769,7 +768,7 @@
in.current = "prefix " SCHEMA_BEGINNING "}";
m = calloc(1, sizeof *m);
m->ctx = YCTX->parsed_mod->mod->ctx;
- assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m, &new_mods));
+ assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m));
CHECK_LOG_CTX("Invalid keyword \"prefix\", expected \"module\" or \"submodule\".", "Line number 1.");
yang_parser_ctx_free(ctx_p);
lys_module_free(m);
@@ -777,7 +776,7 @@
in.current = "module " SCHEMA_BEGINNING "leaf enum {type enumeration {enum seven { position 7;}}}}";
m = calloc(1, sizeof *m);
m->ctx = YCTX->parsed_mod->mod->ctx;
- assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m, &new_mods));
+ assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m));
CHECK_LOG_CTX("Invalid keyword \"position\" as a child of \"enum\".", "Line number 1.");
yang_parser_ctx_free(ctx_p);
lys_module_free(m);
diff --git a/tests/utests/schema/test_parser_yin.c b/tests/utests/schema/test_parser_yin.c
index 66b454d..21d5994 100644
--- a/tests/utests/schema/test_parser_yin.c
+++ b/tests/utests/schema/test_parser_yin.c
@@ -3681,7 +3681,6 @@
struct lys_module *mod;
struct lys_yin_parser_ctx *yin_ctx = NULL;
struct ly_in *in = NULL;
- struct ly_set new_mods = {0};
mod = calloc(1, sizeof *mod);
mod->ctx = UTEST_LYCTX;
@@ -3707,10 +3706,9 @@
" </md:annotation>\n"
"</module>\n";
assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
- assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &new_mods), LY_SUCCESS);
+ assert_int_equal(yin_parse_module(&yin_ctx, in, mod), LY_SUCCESS);
assert_null(mod->parsed->exts->child->next->child);
assert_string_equal(mod->parsed->exts->child->next->arg, "test");
- ly_set_erase(&new_mods, NULL);
lys_module_free(mod);
yin_parser_ctx_free(yin_ctx);
ly_in_free(in, 0);
@@ -3748,8 +3746,7 @@
" </list>\n"
"</module>\n";
assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
- assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &new_mods), LY_SUCCESS);
- ly_set_erase(&new_mods, NULL);
+ assert_int_equal(yin_parse_module(&yin_ctx, in, mod), LY_SUCCESS);
lys_module_free(mod);
yin_parser_ctx_free(yin_ctx);
ly_in_free(in, 0);
@@ -3764,8 +3761,7 @@
" <prefix value=\"foo\"/>\n"
"</module>\n";
assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
- assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &new_mods), LY_SUCCESS);
- ly_set_erase(&new_mods, NULL);
+ assert_int_equal(yin_parse_module(&yin_ctx, in, mod), LY_SUCCESS);
lys_module_free(mod);
yin_parser_ctx_free(yin_ctx);
ly_in_free(in, 0);
@@ -3777,7 +3773,7 @@
data = "<submodule name=\"example-foo\" xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">"
"</submodule>\n";
assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
- assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &new_mods), LY_EINVAL);
+ assert_int_equal(yin_parse_module(&yin_ctx, in, mod), LY_EINVAL);
CHECK_LOG_CTX("Input data contains submodule which cannot be parsed directly without its main module.", NULL);
lys_module_free(mod);
yin_parser_ctx_free(yin_ctx);
@@ -3792,7 +3788,7 @@
"</module>\n"
"<module>";
assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
- assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &new_mods), LY_EVALID);
+ assert_int_equal(yin_parse_module(&yin_ctx, in, mod), LY_EVALID);
CHECK_LOG_CTX("Trailing garbage \"<module>\" after module, expected end-of-input.", "Line number 6.");
lys_module_free(mod);
yin_parser_ctx_free(yin_ctx);