yin parser CHANGE use uri instead of prefix in name of extension elements
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 46d8028..9fe8859 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -2846,17 +2846,27 @@
return LY_SUCCESS;
}
-char *
+const char *
name2nsname(struct yin_parser_ctx *ctx, const char *name, size_t name_len, const char *prefix, size_t prefix_len)
{
const struct lyxml_ns *ns = lyxml_ns_get(&ctx->xml_ctx, prefix, prefix_len);
- size_t len = strlen(ns->uri) + name_len + 1;
+ LY_CHECK_ERR_RET(!ns, LOGINT(ctx->xml_ctx.ctx), NULL);
- char *temp = malloc(sizeof(*temp) * len);
- strcpy(temp, ns->uri);
- strncat(temp, name, name_len);
-
- return lydict_insert_zc(ctx->xml_ctx.ctx, temp);
+ size_t ns_len = strlen(ns->uri);
+ size_t len = ns_len + name_len + 1; /* +1 because of ':' delimiter between ns and actual name */
+
+ char *result;
+ char *temp;
+ temp = result = malloc(sizeof(*temp) * (len + 1)); /* +1 for '\0' terminator */
+ LY_CHECK_ERR_RET(!temp, LOGMEM(ctx->xml_ctx.ctx), NULL);
+
+ strcpy(result, ns->uri);
+ result[ns_len] = ':';
+ temp = &result[ns_len + 1];
+ strncpy(temp, name, name_len);
+ result[len] = '\0';
+
+ return lydict_insert_zc(ctx->xml_ctx.ctx, result);
}
LY_ERR
@@ -2931,8 +2941,7 @@
switch (kw) {
/* call responsible function */
case LY_STMT_EXTENSION_INSTANCE:
- ret = yin_parse_extension_instance(ctx, attrs, data, name2fname(name, prefix_len),
- len2flen(name_len, prefix_len),
+ ret = yin_parse_extension_instance(ctx, attrs, data, name, name_len, prefix, prefix_len,
kw2lyext_substmt(current_element),
(subelem->dest) ? *((uint32_t*)subelem->dest) : 0, exts);
break;
@@ -3146,8 +3155,9 @@
}
LY_ERR
-yin_parse_extension_instance(struct yin_parser_ctx *ctx, struct yin_arg_record *attrs, const char **data, const char *ext_name,
- int ext_name_len, LYEXT_SUBSTMT subelem, uint32_t subelem_index, struct lysp_ext_instance **exts)
+yin_parse_extension_instance(struct yin_parser_ctx *ctx, struct yin_arg_record *attrs, const char **data,
+ const char *ext_name, size_t ext_name_len, const char *ext_prefix, size_t ext_prefix_len,
+ LYEXT_SUBSTMT subelem, uint32_t subelem_index, struct lysp_ext_instance **exts)
{
LY_ERR ret = LY_SUCCESS;
char *out;
@@ -3162,7 +3172,8 @@
e->yin = 0;
/* store name and insubstmt info */
- e->name = lydict_insert(ctx->xml_ctx.ctx, ext_name, ext_name_len);
+ e->name = name2nsname(ctx, ext_name, ext_name_len, ext_prefix, ext_prefix_len);
+ LY_CHECK_RET(!e->name, LY_EMEM);
e->insubstmt = subelem;
e->insubstmt_index = subelem_index;
e->yin |= LYS_YIN;
@@ -3378,15 +3389,18 @@
struct yin_arg_record *attrs = NULL;
struct yin_arg_record *iter = NULL;
- /* allocate new structure for element */
- *element = calloc(1, sizeof(**element));
- LY_CHECK_ERR_RET(!(*element), LOGMEM(ctx->xml_ctx.ctx), LY_EMEM);
- (*element)->stmt = lydict_insert(ctx->xml_ctx.ctx, prefix ? prefix : name, prefix_len ? prefix_len + name_len + 1 : name_len);
- LY_CHECK_RET(!(*element)->stmt, LY_EMEM);
- /* TODO map prefix to module name */
-
+ /* load all attributes for correct namespace evaluation */
ret = yin_load_attributes(ctx, data, &attrs);
LY_CHECK_GOTO(ret, cleanup);
+
+ /* allocate new structure for element */
+ *element = calloc(1, sizeof(**element));
+ LY_CHECK_ERR_GOTO(!(*element), LOGMEM(ctx->xml_ctx.ctx); ret = LY_EMEM, cleanup);
+ //(*element)->stmt = lydict_insert(ctx->xml_ctx.ctx, prefix ? prefix : name, prefix_len ? prefix_len + name_len + 1 : name_len);
+ (*element)->stmt = name2nsname(ctx, name, name_len, prefix, prefix_len);
+ LY_CHECK_ERR_GOTO(!(*element)->stmt, ret = LY_EMEM, cleanup);
+ /* TODO map prefix to module name */
+
(*element)->kw = yin_match_keyword(ctx, name, name_len, prefix, prefix_len, parent);
last = (*element)->child;
diff --git a/src/parser_yin.h b/src/parser_yin.h
index 0e5d56c..7dd9b6d 100644
--- a/src/parser_yin.h
+++ b/src/parser_yin.h
@@ -234,8 +234,10 @@
* @param[in,out] ctx Yin parser context for logging and to store current state.
* @param[in] attrs [Sized array](@ref sizedarrays) of attributes of extension instance.
* @param[in,out] data Data to read from, always moved to currently handled character.
- * @param[in] ext_name Name of the extension element.
- * @param[in] ext_name_len Length of extension name.
+ * @param[in] name Name of the extension element.
+ * @param[in] name_len Length of extension name.
+ * @param[in] prefix Prefix of extension name.
+ * @param[in] prefix_len Length of extension prefix.
* @param[in] subelem Type of the keyword this extension instance is a subelement of.
* @param[in] subelem_index Index of the keyword instance this extension instance is a subelement of
* @param[in,out] exts Extension instance to add to.
@@ -243,8 +245,8 @@
* @return LY_ERR values.
*/
LY_ERR yin_parse_extension_instance(struct yin_parser_ctx *ctx, struct yin_arg_record *attrs, const char **data,
- const char *ext_name, int ext_name_len, LYEXT_SUBSTMT subelem,
- uint32_t subelem_index, struct lysp_ext_instance **exts);
+ const char *ext_name, size_t ext_name_len, const char *ext_prefix, size_t ext_prefix_len,
+ LYEXT_SUBSTMT subelem, uint32_t subelem_index, struct lysp_ext_instance **exts);
/**
* @brief Parse yin element into generic structure.
@@ -260,8 +262,8 @@
*
* @return LY_ERR values.
*/
-LY_ERR yin_parse_element_generic(struct yin_parser_ctx *ctx, const char *name, size_t name_len, const char *prefix, size_t prefix_len, enum ly_stmt parent,
- const char **data, struct lysp_stmt **element);
+LY_ERR yin_parse_element_generic(struct yin_parser_ctx *ctx, const char *name, size_t name_len, const char *prefix,
+ size_t prefix_len, enum ly_stmt parent, const char **data, struct lysp_stmt **element);
/**
* @brief Parse module element.
diff --git a/tests/src/test_parser_yin.c b/tests/src/test_parser_yin.c
index 80736c9..856f107 100644
--- a/tests/src/test_parser_yin.c
+++ b/tests/src/test_parser_yin.c
@@ -66,7 +66,7 @@
int store = -1; /* negative for infinite logging, positive for limited logging */
/* set to 0 to printing error messages to stderr instead of checking them in code */
-#define ENABLE_LOGGER_CHECKING 0
+#define ENABLE_LOGGER_CHECKING 1
#if ENABLE_LOGGER_CHECKING
static void
@@ -376,7 +376,7 @@
ret = yin_parse_element_generic(st->yin_ctx, name, name_len, prefix, prefix_len, LY_STMT_EXTENSION_INSTANCE, &data, &exts.child);
assert_int_equal(ret, LY_SUCCESS);
assert_int_equal(st->yin_ctx->xml_ctx.status, LYXML_END);
- assert_string_equal(exts.child->stmt, "myext:elem");
+ assert_string_equal(exts.child->stmt, "urn:example:extensions:elem");
assert_string_equal(exts.child->arg, "text_value");
assert_string_equal(exts.child->child->stmt, "attr");
assert_string_equal(exts.child->child->arg, "value");
@@ -388,7 +388,7 @@
lyxml_get_element(&st->yin_ctx->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
ret = yin_parse_element_generic(st->yin_ctx, name, name_len, prefix, prefix_len, LY_STMT_EXTENSION_INSTANCE, &data, &exts.child);
assert_int_equal(ret, LY_SUCCESS);
- assert_string_equal(exts.child->stmt, "myext:elem");
+ assert_string_equal(exts.child->stmt, "urn:example:extensions:elem");
assert_null(exts.child->child);
assert_null(exts.child->arg);
assert_int_equal(st->yin_ctx->xml_ctx.status, LYXML_END);
@@ -409,10 +409,9 @@
const char *data = "<myext:ext value1=\"test\" value=\"test2\" xmlns:myext=\"urn:example:extensions\"><myext:subelem>text</myext:subelem></myext:ext>";
lyxml_get_element(&st->yin_ctx->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
yin_load_attributes(st->yin_ctx, &data, &args);
- ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name2fname(name, prefix_len),
- len2flen(name_len, prefix_len), LYEXT_SUBSTMT_CONTACT, 0, &exts);
+ ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name, name_len, prefix, prefix_len, LYEXT_SUBSTMT_CONTACT, 0, &exts);
assert_int_equal(ret, LY_SUCCESS);
- assert_string_equal(exts->name, "myext:ext");
+ assert_string_equal(exts->name, "urn:example:extensions:ext");
assert_int_equal(exts->insubstmt_index, 0);
assert_true(exts->insubstmt == LYEXT_SUBSTMT_CONTACT);
assert_true(exts->yin & LYS_YIN);
@@ -425,7 +424,7 @@
assert_null(exts->child->next->child);
assert_true(exts->child->next->flags & LYS_YIN_ATTR);
- assert_string_equal(exts->child->next->next->stmt, "myext:subelem");
+ assert_string_equal(exts->child->next->next->stmt, "urn:example:extensions:subelem");
assert_string_equal(exts->child->next->next->arg, "text");
assert_null(exts->child->next->next->child);
assert_null(exts->child->next->next->next);
@@ -441,9 +440,9 @@
data = "<myext:extension-elem xmlns:myext=\"urn:example:extensions\" />";
lyxml_get_element(&st->yin_ctx->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
yin_load_attributes(st->yin_ctx, &data, &args);
- ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name, name_len, LYEXT_SUBSTMT_CONTACT, 0, &exts);
+ ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name, name_len, prefix, prefix_len, LYEXT_SUBSTMT_CONTACT, 0, &exts);
assert_int_equal(ret, LY_SUCCESS);
- assert_string_equal(exts->name, "extension-elem");
+ assert_string_equal(exts->name, "urn:example:extensions:extension-elem");
assert_null(exts->argument);
assert_null(exts->child);
assert_int_equal(exts->insubstmt, LYEXT_SUBSTMT_CONTACT);
@@ -468,10 +467,10 @@
"</myext:ext>";
lyxml_get_element(&st->yin_ctx->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
yin_load_attributes(st->yin_ctx, &data, &args);
- ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name, name_len, LYEXT_SUBSTMT_CONTACT, 0, &exts);
+ ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name, name_len, prefix, prefix_len, LYEXT_SUBSTMT_CONTACT, 0, &exts);
assert_int_equal(ret, LY_SUCCESS);
- assert_string_equal(exts->name, "ext");
+ assert_string_equal(exts->name, "urn:example:extensions:ext");
assert_null(exts->argument);
assert_int_equal(exts->insubstmt, LYEXT_SUBSTMT_CONTACT);
assert_int_equal(exts->insubstmt_index, 0);
@@ -486,12 +485,12 @@
assert_null(exts->child->next->child);
assert_true(exts->child->next->flags & LYS_YIN_ATTR);
- assert_string_equal(exts->child->next->next->stmt, "myext:ext-sub1");
+ assert_string_equal(exts->child->next->next->stmt, "urn:example:extensions:ext-sub1");
assert_null(exts->child->next->next->arg);
assert_null(exts->child->next->next->child);
assert_int_equal(exts->child->next->next->flags, 0);
- assert_string_equal(exts->child->next->next->next->stmt, "myext:ext-sub2");
+ assert_string_equal(exts->child->next->next->next->stmt, "urn:example:extensions:ext-sub2");
assert_null(exts->child->next->next->next->arg);
assert_int_equal(exts->child->next->next->next->flags, 0);
assert_string_equal(exts->child->next->next->next->child->stmt, "sattr1");
@@ -499,12 +498,12 @@
assert_null(exts->child->next->next->next->child->child);
assert_true(exts->child->next->next->next->child->flags & LYS_YIN_ATTR);
- assert_string_equal(exts->child->next->next->next->child->next->stmt, "myext:ext-sub21");
+ assert_string_equal(exts->child->next->next->next->child->next->stmt, "urn:example:extensions:ext-sub21");
assert_null(exts->child->next->next->next->child->next->arg);
assert_null(exts->child->next->next->next->child->next->next);
assert_int_equal(exts->child->next->next->next->child->next->flags, 0);
- assert_string_equal(exts->child->next->next->next->child->next->child->stmt, "myext:ext-sub211");
+ assert_string_equal(exts->child->next->next->next->child->next->child->stmt, "urn:example:extensions:ext-sub211");
assert_null(exts->child->next->next->next->child->next->child->arg);
assert_int_equal(exts->child->next->next->next->child->next->child->flags, 0);
assert_null(exts->child->next->next->next->child->next->child->next);
@@ -515,7 +514,7 @@
assert_null(exts->child->next->next->next->child->next->child->child->child);
assert_true(exts->child->next->next->next->child->next->child->child->flags & LYS_YIN_ATTR);
- assert_string_equal(exts->child->next->next->next->next->stmt, "myext:ext-sub3");
+ assert_string_equal(exts->child->next->next->next->next->stmt, "urn:example:extensions:ext-sub3");
assert_null(exts->child->next->next->next->next->arg);
assert_null(exts->child->next->next->next->next->next);
assert_int_equal(exts->child->next->next->next->next->flags, 0);
@@ -548,7 +547,7 @@
"</myext:extension-elem>";
lyxml_get_element(&st->yin_ctx->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
yin_load_attributes(st->yin_ctx, &data, &args);
- ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name, name_len, LYEXT_SUBSTMT_CONTACT, 0, &exts);
+ ret = yin_parse_extension_instance(st->yin_ctx, args, &data, name, name_len, prefix, prefix_len, LYEXT_SUBSTMT_CONTACT, 0, &exts);
assert_int_equal(ret, LY_SUCCESS);
assert_string_equal(exts->child->arg, "act-name");
assert_string_equal(exts->child->next->arg, "target");
@@ -649,7 +648,7 @@
assert_int_equal(st->yin_ctx->xml_ctx.status, LYXML_END);
/* check parsed values */
assert_string_equal(def, "default-value");
- assert_string_equal(exts->name, "myext:custom");
+ assert_string_equal(exts->name, "urn:example:extensions:custom");
assert_string_equal(exts->argument, "totally amazing extension");
assert_string_equal(value, "wsefsdf");
assert_string_equal(units, "radians");
@@ -882,7 +881,7 @@
assert_true((type.enums->flags & LYS_STATUS_DEPRC) && (type.enums->flags & LYS_SET_VALUE));
assert_string_equal(type.enums->dsc, "desc...");
assert_string_equal(type.enums->ref, "ref...");
- assert_string_equal(type.enums->exts->name, "myext:c-define");
+ assert_string_equal(type.enums->exts->name, "urn:example:extensions:c-define");
assert_int_equal(type.enums->exts->insubstmt_index, 0);
assert_int_equal(type.enums->exts->insubstmt, LYEXT_SUBSTMT_SELF);
lysp_type_free(st->ctx, &type);
@@ -922,7 +921,7 @@
assert_true((type.bits->flags & LYS_STATUS_DEPRC) && (type.bits->flags & LYS_SET_VALUE));
assert_string_equal(type.bits->dsc, "desc...");
assert_string_equal(type.bits->ref, "ref...");
- assert_string_equal(type.bits->exts->name, "myext:c-define");
+ assert_string_equal(type.bits->exts->name, "urn:example:extensions:c-define");
assert_int_equal(type.bits->exts->insubstmt_index, 0);
assert_int_equal(type.bits->exts->insubstmt, LYEXT_SUBSTMT_SELF);
lysp_type_free(st->ctx, &type);
@@ -952,10 +951,10 @@
"<organization><text>organization...</text>" EXT_SUBELEM EXT_SUBELEM "</organization>"
ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &value, NULL, &exts, true), LY_SUCCESS);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_ORGANIZATION);
- assert_string_equal(exts[1].name, "myext:c-define");
+ assert_string_equal(exts[1].name, "urn:example:extensions:c-define");
assert_int_equal(exts[1].insubstmt_index, 0);
assert_int_equal(exts[1].insubstmt, LYEXT_SUBSTMT_ORGANIZATION);
assert_string_equal(value, "organization...");
@@ -969,7 +968,7 @@
"<contact><text>contact...</text>" EXT_SUBELEM "</contact>"
ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &value, NULL, &exts, true), LY_SUCCESS);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_CONTACT);
assert_string_equal(value, "contact...");
@@ -984,7 +983,7 @@
ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &value, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(value, "description...");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_DESCRIPTION);
FREE_STRING(st->ctx, value);
@@ -998,7 +997,7 @@
ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &value, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(value, "reference...");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_REFERENCE);
FREE_STRING(st->ctx, value);
@@ -1062,7 +1061,7 @@
assert_string_equal(imports->rev, "2015-01-01");
assert_string_equal(imports->dsc, "import description");
assert_string_equal(imports->ref, "import reference");
- assert_string_equal(imports->exts->name, "myext:c-define");
+ assert_string_equal(imports->exts->name, "urn:example:extensions:c-define");
assert_int_equal(imports->exts->insubstmt, LYEXT_SUBSTMT_SELF);
assert_int_equal(imports->exts->insubstmt_index, 0);
FREE_ARRAY(st->ctx, imports, lysp_import_free);
@@ -1123,7 +1122,7 @@
data = ELEMENT_WRAPPER_START "<status value=\"obsolete\">"EXT_SUBELEM"</status>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &flags, NULL, &exts, true), LY_SUCCESS);
assert_true(flags & LYS_STATUS_OBSLT);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_STATUS);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1159,7 +1158,7 @@
assert_true(ext->flags & LYS_STATUS_CURR);
assert_string_equal(ext->dsc, "ext_desc");
assert_string_equal(ext->ref, "ext_ref");
- assert_string_equal(ext->exts[0].name, "myext:c-define");
+ assert_string_equal(ext->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(ext->exts[0].insubstmt_index, 0);
assert_int_equal(ext->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_ext_free(st->ctx, ext);
@@ -1192,7 +1191,7 @@
data = ELEMENT_WRAPPER_START "<yin-element value=\"false\">" EXT_SUBELEM "</yin-element>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &flags, NULL, &exts, true), LY_SUCCESS);
assert_true(flags & LYS_YINELEM_TRUE);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_YINELEM);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1222,7 +1221,7 @@
assert_int_equal(test_element_helper(st, &data, &version, NULL, &exts, true), LY_SUCCESS);
assert_true(version & LYS_VERSION_1_1);
assert_int_equal(st->yin_ctx->mod_version, LYS_VERSION_1_1);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_VERSION);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1252,7 +1251,7 @@
data = ELEMENT_WRAPPER_START "<mandatory value=\"false\">" EXT_SUBELEM "</mandatory>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &man, NULL, &exts, true), LY_SUCCESS);
assert_int_equal(man, LYS_MAND_FALSE);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_MANDATORY);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1284,7 +1283,7 @@
assert_int_equal(test_element_helper(st, &data, &arg_meta, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(arg, "arg-name");
assert_true(flags & LYS_YINELEM_TRUE);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_ARGUMENT);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1323,7 +1322,7 @@
"</identity>";
assert_int_equal(test_element_helper(st, &data, &bases, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(*bases, "base-name");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_BASE);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1340,7 +1339,7 @@
assert_int_equal(test_element_helper(st, &data, &type, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(*type.bases, "base-name");
assert_true(type.flags & LYS_SET_BASE);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_BASE);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1365,7 +1364,7 @@
assert_int_equal(test_element_helper(st, &data, &submod, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(submod.belongsto, "module-name");
assert_string_equal(submod.prefix, "pref");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_BELONGSTO);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1392,7 +1391,7 @@
data = ELEMENT_WRAPPER_START "<config value=\"true\">" EXT_SUBELEM "</config>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &flags, NULL, &exts, true), LY_SUCCESS);
assert_true(flags & LYS_CONFIG_W);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_CONFIG);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1422,7 +1421,7 @@
data = ELEMENT_WRAPPER_START "<default value=\"defaul-value\">"EXT_SUBELEM"</default>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &val, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(val, "defaul-value");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_DEFAULT);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1448,7 +1447,7 @@
data = ELEMENT_WRAPPER_START "<error-app-tag value=\"val\">"EXT_SUBELEM"</error-app-tag>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &val, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(val, "val");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_ERRTAG);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1474,7 +1473,7 @@
data = ELEMENT_WRAPPER_START "<error-message><value>val</value>"EXT_SUBELEM"</error-message>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &val, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(val, "val");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_ERRMSG);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1502,7 +1501,7 @@
/* valid value */
data = ELEMENT_WRAPPER_START "<fraction-digits value=\"10\">"EXT_SUBELEM"</fraction-digits>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &type, NULL, NULL, true), LY_SUCCESS);
- assert_string_equal(type.exts[0].name, "myext:c-define");
+ assert_string_equal(type.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(type.exts[0].insubstmt_index, 0);
assert_int_equal(type.exts[0].insubstmt, LYEXT_SUBSTMT_FRACDIGITS);
assert_int_equal(type.fraction_digits, 10);
@@ -1544,7 +1543,7 @@
data = ELEMENT_WRAPPER_START "<if-feature name=\"local-storage\">"EXT_SUBELEM"</if-feature>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &iffeatures, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(*iffeatures, "local-storage");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_IFFEATURE);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1586,7 +1585,7 @@
assert_string_equal(type.length->dsc, "desc");
assert_string_equal(type.length->ref, "ref");
assert_true(type.flags & LYS_SET_LENGTH);
- assert_string_equal(type.length->exts[0].name, "myext:c-define");
+ assert_string_equal(type.length->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(type.length->exts[0].insubstmt_index, 0);
assert_int_equal(type.length->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_type_free(st->ctx, &type);
@@ -1623,7 +1622,7 @@
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, true), LY_SUCCESS);
assert_string_equal(pat, "\x015pattern");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_MODIFIER);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1650,7 +1649,7 @@
data = ELEMENT_WRAPPER_START "<namespace uri=\"ns\">" EXT_SUBELEM "</namespace>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &ns, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(ns, "ns");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_NAMESPACE);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1675,7 +1674,7 @@
assert_int_equal(test_element_helper(st, &data, &type, NULL, NULL, true), LY_SUCCESS);
assert_string_equal("p&th-val", type.path);
assert_true(type.flags & LYS_SET_PATH);
- assert_string_equal(type.exts[0].name, "myext:c-define");
+ assert_string_equal(type.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(type.exts[0].insubstmt_index, 0);
assert_int_equal(type.exts[0].insubstmt, LYEXT_SUBSTMT_PATH);
lysp_type_free(st->ctx, &type);
@@ -1708,7 +1707,7 @@
assert_string_equal(type.patterns->eapptag, "err-app-tag-value");
assert_string_equal(type.patterns->emsg, "err-msg-value");
assert_string_equal(type.patterns->ref, "pattern-ref");
- assert_string_equal(type.patterns->exts[0].name, "myext:c-define");
+ assert_string_equal(type.patterns->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(type.patterns->exts[0].insubstmt_index, 0);
assert_int_equal(type.patterns->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_type_free(st->ctx, &type);
@@ -1736,7 +1735,7 @@
assert_int_equal(test_element_helper(st, &data, &en, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(en.value, 55);
assert_true(en.flags & LYS_SET_VALUE);
- assert_string_equal(en.exts[0].name, "myext:c-define");
+ assert_string_equal(en.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(en.exts[0].insubstmt_index, 0);
assert_int_equal(en.exts[0].insubstmt, LYEXT_SUBSTMT_VALUE);
FREE_ARRAY(st->ctx, en.exts, lysp_ext_instance_free);
@@ -1765,7 +1764,7 @@
assert_int_equal(test_element_helper(st, &data, &en, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(en.value, 55);
assert_true(en.flags & LYS_SET_VALUE);
- assert_string_equal(en.exts[0].name, "myext:c-define");
+ assert_string_equal(en.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(en.exts[0].insubstmt_index, 0);
assert_int_equal(en.exts[0].insubstmt, LYEXT_SUBSTMT_POSITION);
FREE_ARRAY(st->ctx, en.exts, lysp_ext_instance_free);
@@ -1821,7 +1820,7 @@
data = ELEMENT_WRAPPER_START "<prefix value=\"pref\">" EXT_SUBELEM "</prefix>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &value, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(value, "pref");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_PREFIX);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1860,7 +1859,7 @@
assert_string_equal(type.range->emsg, "err-msg");
assert_string_equal(type.range->ref, "ref");
assert_true(type.flags & LYS_SET_RANGE);
- assert_string_equal(type.range->exts[0].name, "myext:c-define");
+ assert_string_equal(type.range->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(type.range->exts[0].insubstmt_index, 0);
assert_int_equal(type.range->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_type_free(st->ctx, &type);
@@ -1887,7 +1886,7 @@
assert_int_equal(test_element_helper(st, &data, &type, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(type.require_instance, 1);
assert_true(type.flags & LYS_SET_REQINST);
- assert_string_equal(type.exts[0].name, "myext:c-define");
+ assert_string_equal(type.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(type.exts[0].insubstmt_index, 0);
assert_int_equal(type.exts[0].insubstmt, LYEXT_SUBSTMT_REQINSTANCE);
lysp_type_free(st->ctx, &type);
@@ -1918,7 +1917,7 @@
data = ELEMENT_WRAPPER_START "<revision-date date=\"2000-01-01\">"EXT_SUBELEM"</revision-date>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, rev, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(rev, "2000-01-01");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_REVISIONDATE);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1945,7 +1944,7 @@
data = ELEMENT_WRAPPER_START "<unique tag=\"tag\">"EXT_SUBELEM"</unique>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &values, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(*values, "tag");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_UNIQUE);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -1974,7 +1973,7 @@
data = ELEMENT_WRAPPER_START "<units name=\"name\">"EXT_SUBELEM"</units>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &values, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(values, "name");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_UNITS);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -2008,7 +2007,7 @@
assert_string_equal(when->cond, "cond");
assert_string_equal(when->dsc, "desc");
assert_string_equal(when->ref, "ref");
- assert_string_equal(when->exts[0].name, "myext:c-define");
+ assert_string_equal(when->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(when->exts[0].insubstmt_index, 0);
assert_int_equal(when->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_when_free(st->ctx, when);
@@ -2085,7 +2084,7 @@
assert_string_equal(type.range->arg, "range");
assert_int_equal(type.require_instance, 1);
assert_string_equal(type.types->name, "sub-type-name");
- assert_string_equal(type.exts[0].name, "myext:c-define");
+ assert_string_equal(type.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(type.exts[0].insubstmt_index, 0);
assert_int_equal(type.exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
assert_true(type.flags & LYS_SET_BASE);
@@ -2123,7 +2122,7 @@
assert_int_equal(test_element_helper(st, &data, &refine, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(refine.max, 0);
assert_true(refine.flags & LYS_SET_MAX);
- assert_string_equal(refine.exts[0].name, "myext:c-define");
+ assert_string_equal(refine.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(refine.exts[0].insubstmt_index, 0);
assert_int_equal(refine.exts[0].insubstmt, LYEXT_SUBSTMT_MAX);
FREE_ARRAY(st->ctx, refine.exts, lysp_ext_instance_free);
@@ -2132,7 +2131,7 @@
assert_int_equal(test_element_helper(st, &data, &list, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(list.max, 5);
assert_true(list.flags & LYS_SET_MAX);
- assert_string_equal(list.exts[0].name, "myext:c-define");
+ assert_string_equal(list.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(list.exts[0].insubstmt_index, 0);
assert_int_equal(list.exts[0].insubstmt, LYEXT_SUBSTMT_MAX);
FREE_ARRAY(st->ctx, list.exts, lysp_ext_instance_free);
@@ -2141,7 +2140,7 @@
assert_int_equal(test_element_helper(st, &data, &llist, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(llist.max, 85);
assert_true(llist.flags & LYS_SET_MAX);
- assert_string_equal(llist.exts[0].name, "myext:c-define");
+ assert_string_equal(llist.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(llist.exts[0].insubstmt_index, 0);
assert_int_equal(llist.exts[0].insubstmt, LYEXT_SUBSTMT_MAX);
FREE_ARRAY(st->ctx, llist.exts, lysp_ext_instance_free);
@@ -2183,7 +2182,7 @@
assert_int_equal(test_element_helper(st, &data, &refine, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(refine.min, 0);
assert_true(refine.flags & LYS_SET_MIN);
- assert_string_equal(refine.exts[0].name, "myext:c-define");
+ assert_string_equal(refine.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(refine.exts[0].insubstmt_index, 0);
assert_int_equal(refine.exts[0].insubstmt, LYEXT_SUBSTMT_MIN);
FREE_ARRAY(st->ctx, refine.exts, lysp_ext_instance_free);
@@ -2192,7 +2191,7 @@
assert_int_equal(test_element_helper(st, &data, &list, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(list.min, 41);
assert_true(list.flags & LYS_SET_MIN);
- assert_string_equal(list.exts[0].name, "myext:c-define");
+ assert_string_equal(list.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(list.exts[0].insubstmt_index, 0);
assert_int_equal(list.exts[0].insubstmt, LYEXT_SUBSTMT_MIN);
FREE_ARRAY(st->ctx, list.exts, lysp_ext_instance_free);
@@ -2201,7 +2200,7 @@
assert_int_equal(test_element_helper(st, &data, &llist, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(llist.min, 50);
assert_true(llist.flags & LYS_SET_MIN);
- assert_string_equal(llist.exts[0].name, "myext:c-define");
+ assert_string_equal(llist.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(llist.exts[0].insubstmt_index, 0);
assert_int_equal(llist.exts[0].insubstmt, LYEXT_SUBSTMT_MIN);
FREE_ARRAY(st->ctx, llist.exts, lysp_ext_instance_free);
@@ -2236,7 +2235,7 @@
data = ELEMENT_WRAPPER_START "<ordered-by value=\"system\">"EXT_SUBELEM"</ordered-by>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &flags, NULL, &exts, true), LY_SUCCESS);
assert_true(flags & LYS_ORDBY_SYSTEM);
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_ORDEREDBY);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -2288,7 +2287,7 @@
assert_string_equal(parsed->ref, "ref");
assert_string_equal(parsed->when->cond, "when-cond");
assert_string_equal(*parsed->iffeatures, "feature");
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -2321,7 +2320,7 @@
assert_string_equal(parsed->ref, "ref");
assert_string_equal(parsed->when->cond, "when-cond");
assert_string_equal(*parsed->iffeatures, "feature");
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -2380,7 +2379,7 @@
assert_string_equal(parsed->ref, "ref");
assert_string_equal(parsed->when->cond, "when-cond");
assert_string_equal(*parsed->iffeatures, "feature");
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
assert_string_equal(parsed->musts->arg, "must-cond");
@@ -2448,7 +2447,7 @@
assert_true(parsed->flags & LYS_CONFIG_W);
assert_true(parsed->flags & LYS_ORDBY_USER);
assert_true(parsed->flags & LYS_STATUS_CURR);
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -2487,7 +2486,7 @@
assert_true(parsed->flags & LYS_CONFIG_W);
assert_true(parsed->flags & LYS_ORDBY_USER);
assert_true(parsed->flags & LYS_STATUS_CURR);
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -2590,7 +2589,7 @@
data = ELEMENT_WRAPPER_START "<presence value=\"presence-val\">"EXT_SUBELEM"</presence>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &val, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(val, "presence-val");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_PRESENCE);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -2619,7 +2618,7 @@
data = ELEMENT_WRAPPER_START "<key value=\"key-value\">"EXT_SUBELEM"</key>" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &val, NULL, &exts, true), LY_SUCCESS);
assert_string_equal(val, "key-value");
- assert_string_equal(exts[0].name, "myext:c-define");
+ assert_string_equal(exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(exts[0].insubstmt_index, 0);
assert_int_equal(exts[0].insubstmt, LYEXT_SUBSTMT_KEY);
FREE_ARRAY(st->ctx, exts, lysp_ext_instance_free);
@@ -2664,7 +2663,7 @@
assert_string_equal(tpdfs[0].type.name, "type");
assert_string_equal(tpdfs[0].units, "uni");
assert_true(tpdfs[0].flags & LYS_STATUS_CURR);
- assert_string_equal(tpdfs[0].exts[0].name, "myext:c-define");
+ assert_string_equal(tpdfs[0].exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(tpdfs[0].exts[0].insubstmt_index, 0);
assert_int_equal(tpdfs[0].exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, tpdfs, lysp_tpdf_free);
@@ -2719,7 +2718,7 @@
assert_string_equal(refines->musts->arg, "cond");
assert_string_equal(refines->presence, "presence");
assert_string_equal(refines->ref, "ref");
- assert_string_equal(refines->exts[0].name, "myext:c-define");
+ assert_string_equal(refines->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(refines->exts[0].insubstmt_index, 0);
assert_int_equal(refines->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, refines, lysp_refine_free);
@@ -2770,7 +2769,7 @@
assert_string_equal(parsed->refines->nodeid, "target");
assert_string_equal(parsed->when->cond, "cond");
assert_string_equal(parsed->augments->nodeid, "target");
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -2805,7 +2804,7 @@
assert_string_equal(revs->date, "2018-12-25");
assert_string_equal(revs->dsc, "desc");
assert_string_equal(revs->ref, "ref");
- assert_string_equal(revs->exts[0].name, "myext:c-define");
+ assert_string_equal(revs->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(revs->exts[0].insubstmt_index, 0);
assert_int_equal(revs->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, revs, lysp_revision_free);
@@ -2851,7 +2850,7 @@
assert_string_equal(includes->dsc, "desc");
assert_string_equal(includes->ref, "ref");
assert_string_equal(includes->rev, "1999-09-09");
- assert_string_equal(includes->exts[0].name, "myext:c-define");
+ assert_string_equal(includes->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(includes->exts[0].insubstmt_index, 0);
assert_int_equal(includes->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, includes, lysp_include_free);
@@ -2915,7 +2914,7 @@
assert_true(features->flags & LYS_STATUS_DEPRC);
assert_string_equal(*features->iffeatures, "iff");
assert_string_equal(features->ref, "ref");
- assert_string_equal(features->exts[0].name, "myext:c-define");
+ assert_string_equal(features->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(features->exts[0].insubstmt_index, 0);
assert_int_equal(features->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, features, lysp_feature_free);
@@ -2957,7 +2956,7 @@
assert_string_equal(identities->dsc, "desc");
assert_string_equal(identities->ref, "ref");
assert_true(identities->flags & LYS_STATUS_DEPRC);
- assert_string_equal(identities->exts[0].name, "myext:c-define");
+ assert_string_equal(identities->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(identities->exts[0].insubstmt_index, 0);
assert_int_equal(identities->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, identities, lysp_ident_free);
@@ -3062,7 +3061,7 @@
assert_string_equal(parsed->typedefs->name, "tpdf");
assert_string_equal(*parsed->uniques, "utag");
assert_string_equal(parsed->when->cond, "when");
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -3138,7 +3137,7 @@
assert_null(notifs->parent);
assert_string_equal(notifs->ref, "ref");
assert_string_equal(notifs->typedefs->name, "tpdf");
- assert_string_equal(notifs->exts[0].name, "myext:c-define");
+ assert_string_equal(notifs->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(notifs->exts[0].insubstmt_index, 0);
assert_int_equal(notifs->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, notifs, lysp_notif_free);
@@ -3205,7 +3204,7 @@
assert_int_equal(grps->data->next->next->next->next->next->next->nodetype, LYS_CONTAINER);
assert_string_equal(grps->data->next->next->next->next->next->next->next->name, "choice");
assert_int_equal(grps->data->next->next->next->next->next->next->next->nodetype, LYS_CHOICE);
- assert_string_equal(grps->exts[0].name, "myext:c-define");
+ assert_string_equal(grps->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(grps->exts[0].insubstmt_index, 0);
assert_int_equal(grps->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, grps, lysp_grp_free);
@@ -3292,7 +3291,7 @@
assert_null(parsed->child->next->next->next->next->next->next->next->next);
assert_string_equal(parsed->notifs->name, "notf");
assert_string_equal(parsed->actions->name, "act");
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -3367,7 +3366,7 @@
assert_string_equal(parsed->child->next->next->next->next->next->next->next->name, "choice");
assert_int_equal(parsed->child->next->next->next->next->next->next->next->nodetype, LYS_CHOICE);
assert_null(parsed->child->next->next->next->next->next->next->next->next);
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -3444,7 +3443,7 @@
assert_string_equal(parsed->child->next->next->next->next->next->next->next->name, "list");
assert_int_equal(parsed->child->next->next->next->next->next->next->next->nodetype, LYS_LIST);
assert_null(parsed->child->next->next->next->next->next->next->next->next);
- assert_string_equal(parsed->exts[0].name, "myext:c-define");
+ assert_string_equal(parsed->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(parsed->exts[0].insubstmt_index, 0);
assert_int_equal(parsed->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_node_free(st->ctx, siblings);
@@ -3510,7 +3509,7 @@
assert_string_equal(inout.data->next->next->next->next->next->next->next->name, "uses-name");
assert_int_equal(inout.data->next->next->next->next->next->next->next->nodetype, LYS_USES);
assert_null(inout.data->next->next->next->next->next->next->next->next);
- assert_string_equal(inout.exts[0].name, "myext:c-define");
+ assert_string_equal(inout.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(inout.exts[0].insubstmt_index, 0);
assert_int_equal(inout.exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_action_inout_free(st->ctx, &inout);
@@ -3557,7 +3556,7 @@
assert_string_equal(inout.data->next->next->next->next->next->next->next->name, "uses-name");
assert_int_equal(inout.data->next->next->next->next->next->next->next->nodetype, LYS_USES);
assert_null(inout.data->next->next->next->next->next->next->next->next);
- assert_string_equal(inout.exts[0].name, "myext:c-define");
+ assert_string_equal(inout.exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(inout.exts[0].insubstmt_index, 0);
assert_int_equal(inout.exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_action_inout_free(st->ctx, &inout);
@@ -3616,7 +3615,7 @@
assert_string_equal(actions->groupings->name, "grouping");
assert_string_equal(actions->input.data->name, "uses-name");
assert_string_equal(actions->output.musts->arg, "cond");
- assert_string_equal(actions->exts[0].name, "myext:c-define");
+ assert_string_equal(actions->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(actions->exts[0].insubstmt_index, 0);
assert_int_equal(actions->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, actions, lysp_action_free)
@@ -3648,7 +3647,7 @@
assert_string_equal(actions->groupings->name, "grouping");
assert_string_equal(actions->input.data->name, "uses-name");
assert_string_equal(actions->output.musts->arg, "cond");
- assert_string_equal(actions->exts[0].name, "myext:c-define");
+ assert_string_equal(actions->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(actions->exts[0].insubstmt_index, 0);
assert_int_equal(actions->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, actions, lysp_action_free)
@@ -3724,7 +3723,7 @@
assert_null(augments->child->next->next->next->next->next->next->next->next->next);
assert_string_equal(augments->actions->name, "action");
assert_string_equal(augments->notifs->name, "notif");
- assert_string_equal(augments->exts[0].name, "myext:c-define");
+ assert_string_equal(augments->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(augments->exts[0].insubstmt_index, 0);
assert_int_equal(augments->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, augments, lysp_augment_free)
@@ -3786,7 +3785,7 @@
ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, &data, &deviates, NULL, NULL, true), LY_SUCCESS);
assert_int_equal(deviates->mod, LYS_DEV_NOT_SUPPORTED);
- assert_string_equal(deviates->exts[0].name, "myext:c-define");
+ assert_string_equal(deviates->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(deviates->exts[0].insubstmt_index, 0);
assert_int_equal(deviates->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_deviate_free(st->ctx, deviates);
@@ -3817,7 +3816,7 @@
assert_true(d_add->flags & LYS_MAND_TRUE && d_add->flags & LYS_CONFIG_W);
assert_int_equal(d_add->min, 5);
assert_int_equal(d_add->max, 15);
- assert_string_equal(deviates->exts[0].name, "myext:c-define");
+ assert_string_equal(deviates->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(deviates->exts[0].insubstmt_index, 0);
assert_int_equal(deviates->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_deviate_free(st->ctx, deviates);
@@ -3846,7 +3845,7 @@
assert_true(d_rpl->flags & LYS_MAND_TRUE && d_rpl->flags & LYS_CONFIG_W);
assert_int_equal(d_rpl->min, 5);
assert_int_equal(d_rpl->max, 15);
- assert_string_equal(deviates->exts[0].name, "myext:c-define");
+ assert_string_equal(deviates->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(deviates->exts[0].insubstmt_index, 0);
assert_int_equal(deviates->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_deviate_free(st->ctx, deviates);
@@ -3870,7 +3869,7 @@
assert_string_equal(d_del->musts->arg, "c");
assert_string_equal(*d_del->uniques, "tag");
assert_string_equal(*d_del->dflts, "default");
- assert_string_equal(deviates->exts[0].name, "myext:c-define");
+ assert_string_equal(deviates->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(deviates->exts[0].insubstmt_index, 0);
assert_int_equal(deviates->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_deviate_free(st->ctx, deviates);
@@ -3942,7 +3941,7 @@
assert_int_equal(deviations->deviates->mod, LYS_DEV_ADD);
assert_string_equal(deviations->ref, "ref");
assert_string_equal(deviations->dsc, "desc");
- assert_string_equal(deviations->exts[0].name, "myext:c-define");
+ assert_string_equal(deviations->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(deviations->exts[0].insubstmt_index, 0);
assert_int_equal(deviations->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
FREE_ARRAY(st->ctx, deviations, lysp_deviation_free);
@@ -4045,7 +4044,7 @@
assert_string_equal(lysp_mod->rpcs->name, "rpc-name");
assert_string_equal(lysp_mod->notifs->name, "notf");
assert_string_equal(lysp_mod->deviations->nodeid, "target");
- assert_string_equal(lysp_mod->exts[0].name, "myext:c-define");
+ assert_string_equal(lysp_mod->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(lysp_mod->exts[0].insubstmt_index, 0);
assert_int_equal(lysp_mod->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);
lysp_module_free(lysp_mod);
@@ -4179,7 +4178,7 @@
assert_string_equal(lysp_submod->rpcs->name, "rpc-name");
assert_string_equal(lysp_submod->notifs->name, "notf");
assert_string_equal(lysp_submod->deviations->nodeid, "target");
- assert_string_equal(lysp_submod->exts[0].name, "myext:c-define");
+ assert_string_equal(lysp_submod->exts[0].name, "urn:example:extensions:c-define");
assert_int_equal(lysp_submod->exts[0].insubstmt_index, 0);
assert_int_equal(lysp_submod->exts[0].insubstmt, LYEXT_SUBSTMT_SELF);