Skip to content

Commit 1dedf1b

Browse files
committed
Register YANG versioning modules as internal modules
Add ietf-yang-semver and ietf-yang-revisions to the internal modules list so they are automatically available in all contexts. - Update context.c to include generated headers and module registrations - Update test_context.c to reflect new module count in test assertions
1 parent cc405b0 commit 1dedf1b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/context.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
#include "../models/[email protected]"
5353
#include "../models/[email protected]"
5454
#include "../models/[email protected]"
55+
#include "../models/[email protected]"
5556
#include "../models/[email protected]"
57+
#include "../models/[email protected]"
5658
#include "../models/[email protected]"
5759
#include "../models/[email protected]"
5860
#include "../models/[email protected]"
@@ -69,6 +71,8 @@ static struct internal_modules_s {
6971
{"yang", "2025-01-29", (const char *)yang_2025_01_29_yang, 1, LYS_IN_YANG},
7072
{"ietf-inet-types", "2013-07-15", (const char *)ietf_inet_types_2013_07_15_yang, 0, LYS_IN_YANG},
7173
{"ietf-yang-types", "2013-07-15", (const char *)ietf_yang_types_2013_07_15_yang, 0, LYS_IN_YANG},
74+
{"ietf-yang-semver", "2025-09-29", (const char *)ietf_yang_semver_2025_09_29_yang, 0, LYS_IN_YANG},
75+
{"ietf-yang-revisions", "2025-01-28", (const char *)ietf_yang_revisions_2025_01_28_yang, 0, LYS_IN_YANG},
7276
{"ietf-yang-schema-mount", "2019-01-14", (const char *)ietf_yang_schema_mount_2019_01_14_yang, 1, LYS_IN_YANG},
7377
{"ietf-yang-structure-ext", "2020-06-17", (const char *)ietf_yang_structure_ext_2020_06_17_yang, 0, LYS_IN_YANG},
7478
/* ietf-datastores and ietf-yang-library must be right here at the end of the list! */

tests/utests/basic/test_context.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ test_get_models(void **state)
476476

477477
unsigned int index = 0;
478478
const char *names[] = {
479-
"ietf-yang-metadata", "yang", "ietf-inet-types", "ietf-yang-types", "ietf-yang-schema-mount",
480-
"ietf-yang-structure-ext", "ietf-datastores", "ietf-yang-library", "a", "a", "a"
479+
"ietf-yang-metadata", "yang", "ietf-inet-types", "ietf-yang-types", "ietf-yang-semver",
480+
"ietf-yang-revisions", "ietf-yang-schema-mount", "ietf-yang-structure-ext", "ietf-datastores",
481+
"ietf-yang-library", "a", "a", "a"
481482
};
482483

483484
assert_int_equal(LY_SUCCESS, ly_in_new_memory(str0, &in0));
@@ -545,7 +546,7 @@ test_get_models(void **state)
545546
while ((mod = (struct lys_module *)ly_ctx_get_module_iter(UTEST_LYCTX, &index))) {
546547
assert_string_equal(names[index - 1], mod->name);
547548
}
548-
assert_int_equal(11, index);
549+
assert_int_equal(13, index);
549550

550551
/* cleanup */
551552
ly_in_free(in0, 0);

0 commit comments

Comments
 (0)