Skip to content

Commit d326173

Browse files
committed
Adding test that is working in v3 but not in v4
1 parent c2ddd01 commit d326173

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module test-module {
2+
yang-version 1.1;
3+
namespace "test-module:test-module";
4+
prefix test-module;
5+
6+
list l1 {key k; leaf k {type string;} leaf v {type string;}}
7+
}

tests/utests/basic/test_context.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,26 @@ test_ylmem(void **state)
772772
/* seperate context to avoid double free during teadown */
773773
struct ly_ctx *ctx_test = NULL;
774774

775+
const char *yanglibrary_json =
776+
"{"
777+
" \"ietf-yang-library:modules-state\": {"
778+
" \"module-set-id\": \"e595da11ace92c0d881995fa7e56bbe86f1f48e9\","
779+
" \"module\": ["
780+
" {"
781+
" \"name\": \"test-module\","
782+
" \"revision\": \"2025-01-29\","
783+
" \"namespace\": \"test-module:test-module\","
784+
" \"conformance-type\": \"implement\""
785+
" }"
786+
" ]"
787+
" },"
788+
" \"ietf-yang-library:yang-library\": {"
789+
" \"content-id\": \"321566\""
790+
" }"
791+
"}";
792+
793+
assert_int_equal(LY_SUCCESS, ly_ctx_new_ylmem(TESTS_SRC "/modules/yang/", yanglibrary_json, LYD_JSON, 0, &ctx_test));
794+
775795
/* test invalid parameters */
776796
assert_int_equal(LY_EINVAL, ly_ctx_new_ylpath(NULL, NULL, LYD_XML, 0, &ctx_test));
777797
assert_int_equal(LY_EINVAL, ly_ctx_new_ylpath(NULL, TESTS_SRC, LYD_XML, 0, NULL));

0 commit comments

Comments
 (0)