validation OPTIMIZE set log nodes only before an error
Some logging improvements included.
diff --git a/src/log.c b/src/log.c
index a6b1fe4..74407d8 100644
--- a/src/log.c
+++ b/src/log.c
@@ -618,8 +618,8 @@
if (log_location.paths.count && ((const char *)(log_location.paths.objs[log_location.paths.count - 1]))[0]) {
/* simply get what is in the provided path string */
- *path = strdup((const char *)log_location.paths.objs[log_location.paths.count - 1]);
- LY_CHECK_ERR_RET(!(*path), LOGMEM(ctx), LY_EMEM);
+ r = asprintf(path, "Path \"%s\".", (const char *)log_location.paths.objs[log_location.paths.count - 1]);
+ LY_CHECK_ERR_RET(r == -1, LOGMEM(ctx), LY_EMEM);
} else {
/* data/schema node */
if (log_location.dnodes.count) {
@@ -700,12 +700,12 @@
* @param[in] plugin_name Name of the plugin generating the message.
* @param[in] level Log message level (error, warning, etc.)
* @param[in] err_no Error type code.
- * @param[in] path Optional path of the error.
+ * @param[in] path Optional path of the error, used if set.
* @param[in] format Format string to print.
* @param[in] ap Var arg list for @p format.
*/
static void
-ly_ext_log(const struct ly_ctx *ctx, const char *plugin_name, LY_LOG_LEVEL level, LY_ERR err_no, const char *path,
+ly_ext_log(const struct ly_ctx *ctx, const char *plugin_name, LY_LOG_LEVEL level, LY_ERR err_no, char *path,
const char *format, va_list ap)
{
char *plugin_msg;
@@ -718,8 +718,7 @@
return;
}
- log_vprintf(ctx, level, (level == LY_LLERR ? LY_EPLUGIN : 0) | err_no, LYVE_OTHER, path ? strdup(path) : NULL, NULL,
- plugin_msg, ap);
+ log_vprintf(ctx, level, (level == LY_LLERR ? LY_EPLUGIN : 0) | err_no, LYVE_OTHER, path, NULL, plugin_msg, ap);
free(plugin_msg);
}
@@ -737,8 +736,6 @@
va_start(ap, format);
ly_ext_log(PARSER_CTX(pctx), ext->record->plugin.id, level, err_no, path, format, ap);
va_end(ap);
-
- free(path);
}
LIBYANG_API_DEF void
@@ -746,9 +743,15 @@
const char *format, ...)
{
va_list ap;
+ char *path = NULL;
+
+ if (cctx && (asprintf(&path, "Path \"%s\".", cctx->path) == -1)) {
+ LOGMEM(cctx->ctx);
+ return;
+ }
va_start(ap, format);
- ly_ext_log(ext->module->ctx, ext->def->plugin->id, level, err_no, cctx ? cctx->path : NULL, format, ap);
+ ly_ext_log(ext->module->ctx, ext->def->plugin->id, level, err_no, path, format, ap);
va_end(ap);
}
@@ -757,13 +760,38 @@
const char *format, ...)
{
va_list ap;
+ char *log_path = NULL;
+
+ if (path && (asprintf(&log_path, "Path \"%s\".", path) == -1)) {
+ LOGMEM(ext->module->ctx);
+ return;
+ }
va_start(ap, format);
- ly_ext_log(ext->module->ctx, ext->def->plugin->id, level, err_no, path, format, ap);
+ ly_ext_log(ext->module->ctx, ext->def->plugin->id, level, err_no, log_path, format, ap);
va_end(ap);
}
/**
+ * @brief Serves only for creating ap.
+ */
+static void
+_lyplg_ext_compile_log_err(const struct ly_err_item *err, const struct lysc_ext_instance *ext, ...)
+{
+ va_list ap;
+
+ va_start(ap, ext);
+ ly_ext_log(ext->module->ctx, ext->def->plugin->id, err->level, err->no, err->path ? strdup(err->path) : NULL, "%s", ap);
+ va_end(ap);
+}
+
+LIBYANG_API_DEF void
+lyplg_ext_compile_log_err(const struct ly_err_item *err, const struct lysc_ext_instance *ext)
+{
+ _lyplg_ext_compile_log_err(err, ext, err->msg);
+}
+
+/**
* @brief Exact same functionality as ::ly_err_print() but has variable arguments so log_vprintf() can be called.
*/
static void
diff --git a/src/plugins_exts.h b/src/plugins_exts.h
index e013478..4f98c41 100644
--- a/src/plugins_exts.h
+++ b/src/plugins_exts.h
@@ -594,6 +594,14 @@
LY_LOG_LEVEL level, LY_ERR err_no, const char *format, ...);
/**
+ * @brief Log a message from an extension plugin using the compiled extension instance and a generated error item.
+ *
+ * @param[in] err Error item to log.
+ * @param[in] ext Compiled extension instance.
+ */
+LIBYANG_API_DEF void lyplg_ext_compile_log_err(const struct ly_err_item *err, const struct lysc_ext_instance *ext);
+
+/**
* @brief YANG schema compilation context getter for libyang context.
*
* @param[in] ctx YANG schema compilation context.
diff --git a/src/plugins_exts/schema_mount.c b/src/plugins_exts/schema_mount.c
index 9800760..cc63431 100644
--- a/src/plugins_exts/schema_mount.c
+++ b/src/plugins_exts/schema_mount.c
@@ -982,7 +982,7 @@
if (!err) {
lyplg_ext_compile_log(NULL, ext, LY_LLERR, ret, "Unknown validation error (err code %d).", ret);
} else {
- lyplg_ext_compile_log_path(err->path, ext, LY_LLERR, err->no, "%s", err->msg);
+ lyplg_ext_compile_log_err(err, ext);
}
goto cleanup;
}
diff --git a/src/tree_data_common.c b/src/tree_data_common.c
index 16db9c3..b39b144 100644
--- a/src/tree_data_common.c
+++ b/src/tree_data_common.c
@@ -517,15 +517,10 @@
/* log only in case the ctx was provided as input parameter */
if (err->path) {
LOG_LOCSET(NULL, NULL, err->path, NULL);
- } else {
- /* use at least the schema path */
- LOG_LOCSET(node, NULL, NULL, NULL);
}
LOGVAL_ERRITEM(ctx, err);
if (err->path) {
LOG_LOCBACK(0, 0, 1, 0);
- } else {
- LOG_LOCBACK(1, 0, 0, 0);
}
}
ly_err_free(err);
@@ -794,11 +789,13 @@
LIBYANG_API_DEF LY_ERR
lyd_parse_opaq_error(const struct lyd_node *node)
{
+ LY_ERR rc = LY_SUCCESS;
const struct ly_ctx *ctx;
const struct lyd_node_opaq *opaq;
const struct lyd_node *parent;
const struct lys_module *mod;
const struct lysc_node *snode;
+ uint32_t loc_node = 0, loc_path = 0;
LY_CHECK_ARG_RET(LYD_CTX(node), node, !node->schema, !lyd_parent(node) || lyd_parent(node)->schema, LY_EINVAL);
@@ -806,9 +803,18 @@
opaq = (struct lyd_node_opaq *)node;
parent = lyd_parent(node);
+ if (lyd_parent(node)) {
+ LOG_LOCSET(NULL, lyd_parent(node), NULL, NULL);
+ ++loc_node;
+ } else {
+ LOG_LOCSET(NULL, NULL, "/", NULL);
+ ++loc_path;
+ }
+
if (!opaq->name.module_ns) {
LOGVAL(ctx, LYVE_REFERENCE, "Unknown module of node \"%s\".", opaq->name.name);
- return LY_EVALID;
+ rc = LY_EVALID;
+ goto cleanup;
}
/* module */
@@ -819,7 +825,8 @@
if (!mod) {
LOGVAL(ctx, LYVE_REFERENCE, "No (implemented) module with namespace \"%s\" of node \"%s\" in the context.",
opaq->name.module_ns, opaq->name.name);
- return LY_EVALID;
+ rc = LY_EVALID;
+ goto cleanup;
}
} else {
/* inherit */
@@ -833,7 +840,8 @@
if (!mod) {
LOGVAL(ctx, LYVE_REFERENCE, "No (implemented) module named \"%s\" of node \"%s\" in the context.",
opaq->name.module_name, opaq->name.name);
- return LY_EVALID;
+ rc = LY_EVALID;
+ goto cleanup;
}
} else {
/* inherit */
@@ -842,7 +850,8 @@
break;
default:
LOGERR(ctx, LY_EINVAL, "Unsupported value format.");
- return LY_EINVAL;
+ rc = LY_EINVAL;
+ goto cleanup;
}
/* schema */
@@ -858,29 +867,45 @@
} else {
LOGVAL(ctx, LYVE_REFERENCE, "Node \"%s\" not found in the \"%s\" module.", opaq->name.name, mod->name);
}
- return LY_EVALID;
+ rc = LY_EVALID;
+ goto cleanup;
}
+ /* schema node exists */
+ LOG_LOCBACK(0, loc_node, loc_path, 0);
+ loc_node = 0;
+ loc_path = 0;
+ LOG_LOCSET(NULL, node, NULL, NULL);
+ ++loc_node;
+
if (snode->nodetype & LYD_NODE_TERM) {
/* leaf / leaf-list */
- LY_CHECK_RET(lys_value_validate(ctx, snode, opaq->value, strlen(opaq->value), opaq->format, opaq->val_prefix_data));
+ rc = lys_value_validate(ctx, snode, opaq->value, strlen(opaq->value), opaq->format, opaq->val_prefix_data);
+ LY_CHECK_GOTO(rc, cleanup);
} else if (snode->nodetype == LYS_LIST) {
/* list */
- LY_CHECK_RET(lyd_parse_opaq_list_error(node, snode));
+ rc = lyd_parse_opaq_list_error(node, snode);
+ LY_CHECK_GOTO(rc, cleanup);
} else if (snode->nodetype & LYD_NODE_INNER) {
/* inner node */
if (opaq->value) {
LOGVAL(ctx, LYVE_DATA, "Invalid value \"%s\" for %s \"%s\".", opaq->value,
lys_nodetype2str(snode->nodetype), snode->name);
- return LY_EVALID;
+ rc = LY_EVALID;
+ goto cleanup;
}
} else {
LOGERR(ctx, LY_EINVAL, "Unexpected opaque schema node %s \"%s\".", lys_nodetype2str(snode->nodetype), snode->name);
- return LY_EINVAL;
+ rc = LY_EINVAL;
+ goto cleanup;
}
LOGERR(ctx, LY_EINVAL, "Unexpected valid opaque node %s \"%s\".", lys_nodetype2str(snode->nodetype), snode->name);
- return LY_EINVAL;
+ rc = LY_EINVAL;
+
+cleanup:
+ LOG_LOCBACK(0, loc_node, loc_path, 0);
+ return rc;
}
LIBYANG_API_DEF const char *
diff --git a/src/validation.c b/src/validation.c
index b629008..dc1d3e7 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -426,7 +426,9 @@
}
if (fail) {
+ LOG_LOCSET(NULL, node, NULL, NULL);
LOGVAL(node->schema->module->ctx, LY_VCODE_DUP, node->schema->name);
+ LOG_LOCBACK(0, 1, 0, 0);
return LY_EVALID;
}
return LY_SUCCESS;
@@ -824,9 +826,7 @@
if (node->flags & LYD_NEW) {
/* then check new node instance duplicities */
- LOG_LOCSET(NULL, node, NULL, NULL);
r = lyd_validate_duplicates(*first, node);
- LOG_LOCBACK(0, 1, 0, 0);
LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
/* this node is valid */
@@ -950,11 +950,13 @@
if (!disabled) {
/* node instance not found */
+ LOG_LOCSET(parent ? NULL : snode, parent, NULL, NULL);
if (snode->nodetype == LYS_CHOICE) {
LOGVAL_APPTAG(snode->module->ctx, "missing-choice", LY_VCODE_NOMAND_CHOIC, snode->name);
} else {
LOGVAL(snode->module->ctx, LY_VCODE_NOMAND, snode->name);
}
+ LOG_LOCBACK(parent ? 0 : 1, parent ? 1 : 0, 0, 0);
return LY_EVALID;
}
@@ -978,7 +980,6 @@
uint32_t count = 0;
struct lyd_node *iter;
const struct lysc_when *disabled;
- ly_bool invalid_instance = 0;
assert(min || max);
@@ -995,8 +996,6 @@
}
if (max && (count > max)) {
/* not satisifed */
- LOG_LOCSET(NULL, iter, NULL, NULL);
- invalid_instance = 1;
break;
}
}
@@ -1010,20 +1009,28 @@
LY_CHECK_RET(lyd_validate_dummy_when(first, parent, snode, &disabled));
}
- if (!disabled) {
- LOGVAL_APPTAG(snode->module->ctx, "too-few-elements", LY_VCODE_NOMIN, snode->name);
- goto failure;
+ if (disabled) {
+ /* satisfied */
+ min = 0;
}
- } else if (max && (count > max)) {
- LOGVAL_APPTAG(snode->module->ctx, "too-many-elements", LY_VCODE_NOMAX, snode->name);
- goto failure;
+ }
+ if (max && (count <= max)) {
+ /* satisfied */
+ max = 0;
}
+ if (min) {
+ LOG_LOCSET(snode, NULL, NULL, NULL);
+ LOGVAL_APPTAG(snode->module->ctx, "too-few-elements", LY_VCODE_NOMIN, snode->name);
+ LOG_LOCBACK(1, 0, 0, 0);
+ return LY_EVALID;
+ } else if (max) {
+ LOG_LOCSET(NULL, iter, NULL, NULL);
+ LOGVAL_APPTAG(snode->module->ctx, "too-many-elements", LY_VCODE_NOMAX, snode->name);
+ LOG_LOCBACK(0, 1, 0, 0);
+ return LY_EVALID;
+ }
return LY_SUCCESS;
-
-failure:
- LOG_LOCBACK(0, invalid_instance, 0, 0);
- return LY_EVALID;
}
/**
@@ -1310,26 +1317,24 @@
continue;
}
- LOG_LOCSET(snode, NULL, NULL, NULL);
-
/* check min-elements and max-elements */
if (snode->nodetype == LYS_LIST) {
slist = (struct lysc_node_list *)snode;
if (slist->min || slist->max) {
r = lyd_validate_minmax(first, parent, snode, slist->min, slist->max);
- LY_VAL_ERR_GOTO(r, rc = r, val_opts, error);
+ LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
}
} else if (snode->nodetype == LYS_LEAFLIST) {
sllist = (struct lysc_node_leaflist *)snode;
if (sllist->min || sllist->max) {
r = lyd_validate_minmax(first, parent, snode, sllist->min, sllist->max);
- LY_VAL_ERR_GOTO(r, rc = r, val_opts, error);
+ LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
}
} else if (snode->flags & LYS_MAND_TRUE) {
/* check generic mandatory existence */
r = lyd_validate_mandatory(first, parent, snode);
- LY_VAL_ERR_GOTO(r, rc = r, val_opts, error);
+ LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
}
/* check unique */
@@ -1337,7 +1342,7 @@
slist = (struct lysc_node_list *)snode;
if (slist->uniques) {
r = lyd_validate_unique(first, snode, (const struct lysc_node_leaf ***)slist->uniques);
- LY_VAL_ERR_GOTO(r, rc = r, val_opts, error);
+ LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
}
}
@@ -1347,19 +1352,14 @@
if (lys_getnext_data(NULL, first, NULL, scase, NULL)) {
/* validate only this case */
r = lyd_validate_siblings_schema_r(first, parent, scase, mod, val_opts, int_opts);
- LY_VAL_ERR_GOTO(r, rc = r, val_opts, error);
+ LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
break;
}
}
}
-
- LOG_LOCBACK(1, 0, 0, 0);
}
- return rc;
-
-error:
- LOG_LOCBACK(1, 0, 0, 0);
+cleanup:
return rc;
}
@@ -1376,7 +1376,9 @@
snode = node->schema;
do {
if (snode->flags & LYS_STATUS_OBSLT) {
+ LOG_LOCSET(NULL, node, NULL, NULL);
LOGWRN(snode->module->ctx, "Obsolete schema node \"%s\" instantiated in data.", snode->name);
+ LOG_LOCBACK(0, 1, 0, 0);
break;
}
@@ -1446,11 +1448,13 @@
/* use specific error information */
emsg = musts[u].emsg;
eapptag = musts[u].eapptag ? musts[u].eapptag : "must-violation";
+ LOG_LOCSET(NULL, node, NULL, NULL);
if (emsg) {
LOGVAL_APPTAG(LYD_CTX(node), eapptag, LYVE_DATA, "%s", emsg);
} else {
LOGVAL_APPTAG(LYD_CTX(node), eapptag, LY_VCODE_NOMUST, musts[u].cond->expr);
}
+ LOG_LOCBACK(0, 1, 0, 0);
r = LY_EVALID;
LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
}
@@ -1487,8 +1491,6 @@
continue;
}
- LOG_LOCSET(node->schema, node, NULL, NULL);
-
/* opaque data */
if (!node->schema) {
r = lyd_parse_opaq_error(node);
@@ -1497,7 +1499,6 @@
if (!node->parent && mod && (lyd_owner_module(node) != mod)) {
/* all top-level data from this module checked */
- LOG_LOCBACK(1, 1, 0, 0);
break;
}
@@ -1517,7 +1518,9 @@
innode = "notification";
}
if (innode) {
+ LOG_LOCSET(NULL, node, NULL, NULL);
LOGVAL(LYD_CTX(node), LY_VCODE_UNEXPNODE, innode, node->schema->name);
+ LOG_LOCBACK(0, 1, 0, 0);
r = LY_EVALID;
goto next_iter;
}
@@ -1533,7 +1536,6 @@
/* node value was checked by plugins */
next_iter:
- LOG_LOCBACK(node->schema ? 1 : 0, 1, 0, 0);
LY_VAL_ERR_GOTO(r, rc = r, val_opts, cleanup);
}
@@ -1943,8 +1945,6 @@
dep_tree = tree_sibling;
}
- LOG_LOCSET(NULL, op_node, NULL, NULL);
-
if (int_opts & LYD_INTOPT_REPLY) {
/* add output children defaults */
rc = lyd_new_implicit_r(op_node, lyd_node_child_p(op_node), NULL, NULL, node_when_p, node_types_p,
@@ -1980,8 +1980,6 @@
LY_CHECK_GOTO(rc, cleanup);
cleanup:
- LOG_LOCBACK(0, 1, 0, 0);
-
/* restore operation tree */
lyd_unlink_tree(op_subtree);
if (op_sibling_before) {
diff --git a/tests/utests/data/test_parser_json.c b/tests/utests/data/test_parser_json.c
index b01dc53..0433832 100644
--- a/tests/utests/data/test_parser_json.c
+++ b/tests/utests/data/test_parser_json.c
@@ -558,7 +558,7 @@
/* invalid metadata */
data = "{\"@a:foo\":\"str\",\"@a:foo3\":1,\"a:foo3\":2}";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Unknown module of node \"@a:foo\".", "Data location \"/@a:foo\".");
+ "Unknown module of node \"@a:foo\".", "Path \"/\".");
CHECK_LOG_CTX("Missing JSON data instance to be coupled with @a:foo metadata.", "Data location \"/@a:foo\", line number 1.");
/* empty name */
diff --git a/tests/utests/extensions/test_metadata.c b/tests/utests/extensions/test_metadata.c
index 39d29be..f1edd29 100644
--- a/tests/utests/extensions/test_metadata.c
+++ b/tests/utests/extensions/test_metadata.c
@@ -53,7 +53,7 @@
"md:annotation aa;}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 metadata v1\": Missing mandatory keyword \"type\" as a child of \"md:annotation aa\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* not allowed substatement */
data = "module aa {yang-version 1.1; namespace urn:tests:extensions:metadata:aa; prefix aa;"
@@ -61,7 +61,7 @@
"md:annotation aa {default x;}}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Invalid keyword \"default\" as a child of \"md:annotation aa\" extension instance.",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* invalid cardinality of units substatement */
data = "module aa {yang-version 1.1; namespace urn:tests:extensions:metadata:aa; prefix aa;"
@@ -69,7 +69,7 @@
"md:annotation aa {type string; units x; units y;}}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Duplicate keyword \"units\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* invalid cardinality of status substatement */
data = "module aa {yang-version 1.1; namespace urn:tests:extensions:metadata:aa; prefix aa;"
@@ -77,7 +77,7 @@
"md:annotation aa {type string; status current; status obsolete;}}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Duplicate keyword \"status\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* invalid cardinality of status substatement */
data = "module aa {yang-version 1.1; namespace urn:tests:extensions:metadata:aa; prefix aa;"
@@ -85,7 +85,7 @@
"md:annotation aa {type string; type uint8;}}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Duplicate keyword \"type\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* duplication of the same annotation */
data = "module aa {yang-version 1.1; namespace urn:tests:extensions:metadata:aa; prefix aa;"
@@ -93,7 +93,7 @@
"md:annotation aa {type string;} md:annotation aa {type uint8;}}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 metadata v1\": Extension md:annotation is instantiated multiple times.",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
}
static void
@@ -134,7 +134,7 @@
"</module>";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 metadata v1\": Missing mandatory keyword \"type\" as a child of \"md:annotation aa\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* not allowed substatement */
data = "<module xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\" xmlns:md=\"urn:ietf:params:xml:ns:yang:ietf-yang-metadata\" name=\"aa\">\n"
@@ -145,7 +145,7 @@
"</md:annotation></module>";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
CHECK_LOG_CTX("Invalid keyword \"default\" as a child of \"md:annotation aa\" extension instance.",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* invalid cardinality of units substatement */
data = "<module xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\" xmlns:md=\"urn:ietf:params:xml:ns:yang:ietf-yang-metadata\" name=\"aa\">\n"
@@ -158,7 +158,7 @@
"</md:annotation></module>";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
CHECK_LOG_CTX("Duplicate keyword \"units\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* invalid cardinality of status substatement */
data = "<module xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\" xmlns:md=\"urn:ietf:params:xml:ns:yang:ietf-yang-metadata\" name=\"aa\">\n"
@@ -171,7 +171,7 @@
"</md:annotation></module>";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
CHECK_LOG_CTX("Duplicate keyword \"status\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* invalid cardinality of status substatement */
data = "<module xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\" xmlns:md=\"urn:ietf:params:xml:ns:yang:ietf-yang-metadata\" name=\"aa\">\n"
@@ -183,7 +183,7 @@
"</md:annotation></module>";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
CHECK_LOG_CTX("Duplicate keyword \"type\".",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
/* duplication of the same annotation */
data = "<module xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\" xmlns:md=\"urn:ietf:params:xml:ns:yang:ietf-yang-metadata\" name=\"aa\">\n"
@@ -196,7 +196,7 @@
"</md:annotation></module>";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YIN, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 metadata v1\": Extension md:annotation is instantiated multiple times.",
- "/aa:{extension='md:annotation'}/aa");
+ "Path \"/aa:{extension='md:annotation'}/aa\".");
}
int
diff --git a/tests/utests/extensions/test_nacm.c b/tests/utests/extensions/test_nacm.c
index 1c999fb..5f7028e 100644
--- a/tests/utests/extensions/test_nacm.c
+++ b/tests/utests/extensions/test_nacm.c
@@ -58,7 +58,7 @@
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 NACM v1\": "
"Extension nacm:default-deny-all is allowed only in a data nodes, but it is placed in \"module\" statement.",
- "/b:{extension='nacm:default-deny-all'}");
+ "Path \"/b:{extension='nacm:default-deny-all'}\".");
/* invalid */
data = "module aa {yang-version 1.1; namespace urn:tests:extensions:nacm:aa; prefix en;"
@@ -67,7 +67,7 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 NACM v1\": "
"Extension nacm:default-deny-write is mixed with nacm:default-deny-all.",
- "/aa:l/{extension='nacm:default-deny-all'}");
+ "Path \"/aa:l/{extension='nacm:default-deny-all'}\".");
}
static void
@@ -100,7 +100,7 @@
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 NACM v1\": "
"Extension nacm:default-deny-write is not allowed in notification statement.",
- "/b:notif/{extension='nacm:default-deny-write'}");
+ "Path \"/b:notif/{extension='nacm:default-deny-write'}\".");
/* invalid */
data = "module aa {yang-version 1.1; namespace urn:tests:extensions:nacm:aa; prefix en;"
@@ -109,7 +109,7 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 NACM v1\": "
"Extension nacm:default-deny-write is instantiated multiple times.",
- "/aa:l/{extension='nacm:default-deny-write'}");
+ "Path \"/aa:l/{extension='nacm:default-deny-write'}\".");
}
int
diff --git a/tests/utests/extensions/test_schema_mount.c b/tests/utests/extensions/test_schema_mount.c
index d11eeaf..17a4c94 100644
--- a/tests/utests/extensions/test_schema_mount.c
+++ b/tests/utests/extensions/test_schema_mount.c
@@ -75,7 +75,7 @@
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Extension \"yangmnt:mount-point\" instance not allowed in YANG version 1 module.",
- "/sm:root/{extension='yangmnt:mount-point'}/root");
+ "Path \"/sm:root/{extension='yangmnt:mount-point'}/root\".");
schema =
"module sm {\n"
@@ -92,7 +92,7 @@
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Extension \"yangmnt:mount-point\" instance allowed only in container or list statement.",
- "/sm:{extension='yangmnt:mount-point'}/root");
+ "Path \"/sm:{extension='yangmnt:mount-point'}/root\".");
schema =
"module sm {\n"
@@ -114,7 +114,7 @@
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Extension \"yangmnt:mount-point\" instance allowed only in container or list statement.",
- "/sm:root/l/{extension='yangmnt:mount-point'}/root");
+ "Path \"/sm:root/l/{extension='yangmnt:mount-point'}/root\".");
schema =
"module sm {\n"
@@ -138,7 +138,7 @@
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, schema, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Multiple extension \"yangmnt:mount-point\" instances.",
- "/sm:l/{extension='yangmnt:mount-point'}/root");
+ "Path \"/sm:l/{extension='yangmnt:mount-point'}/root\".");
/* valid */
schema =
@@ -410,25 +410,25 @@
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
+ "Data location \"/ietf-interfaces:interfaces/interface[name='bu']\".");
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
+ "Data location \"/ietf-interfaces:interfaces/interface[name='bu']\".");
/* same validation fail in separate validation */
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT | LYD_PARSE_ONLY, 0, LY_SUCCESS, data);
assert_int_equal(LY_EVALID, lyd_validate_all(&data, NULL, LYD_VALIDATE_PRESENT, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
+ "Data location \"/ietf-interfaces:interfaces/interface[name='bu']\".");
lyd_free_siblings(data);
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT | LYD_PARSE_ONLY, 0, LY_SUCCESS, data);
assert_int_equal(LY_EVALID, lyd_validate_all(&data, NULL, LYD_VALIDATE_PRESENT, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
+ "Data location \"/ietf-interfaces:interfaces/interface[name='bu']\".");
lyd_free_siblings(data);
/* success */
@@ -878,7 +878,7 @@
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Ext plugin \"ly2 schema mount v1\": "
"Shared-schema yang-library content-id \"2\" differs from \"1\" used previously.",
- "/ietf-yang-library:yang-library/content-id");
+ "Path \"/ietf-yang-library:yang-library/content-id\".");
/* data for 2 mount points */
ly_ctx_set_ext_data_clb(UTEST_LYCTX, test_ext_data_clb,
diff --git a/tests/utests/extensions/test_structure.c b/tests/utests/extensions/test_structure.c
index 9b238a9..9bad7a7 100644
--- a/tests/utests/extensions/test_structure.c
+++ b/tests/utests/extensions/test_structure.c
@@ -148,7 +148,7 @@
"sx:structure struct {import yang;}}";
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid keyword \"import\" as a child of \"sx:structure struct\" extension instance.",
- "/a:{extension='sx:structure'}/struct");
+ "Path \"/a:{extension='sx:structure'}/struct\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:structure:a; prefix self;"
"import ietf-yang-structure-ext {prefix sx;}"
@@ -156,7 +156,7 @@
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Ext plugin \"ly2 structure v1\": "
"Extension sx:structure must not be used as a non top-level statement in \"container\" statement.",
- "/a:b/{extension='sx:structure'}/struct");
+ "Path \"/a:b/{extension='sx:structure'}/struct\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:structure:a; prefix self;"
"import ietf-yang-structure-ext {prefix sx;}"
@@ -171,7 +171,7 @@
"sx:structure struct { container y { leaf y {type string;}}}}";
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Ext plugin \"ly2 structure v1\": Extension sx:structure is instantiated multiple times.",
- "/a:{extension='sx:structure'}/struct");
+ "Path \"/a:{extension='sx:structure'}/struct\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:structure:a; prefix self;"
"import ietf-yang-structure-ext {prefix sx;}"
@@ -179,7 +179,7 @@
"choice struct { container y { leaf y {type string;}}}}";
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Ext plugin \"ly2 structure v1\": Extension sx:structure collides with a choice with the same identifier.",
- "/a:{extension='sx:structure'}/struct");
+ "Path \"/a:{extension='sx:structure'}/struct\".");
/* augment-structure */
data = "module a {yang-version 1.1; namespace urn:tests:extensions:structure:a; prefix a;"
@@ -199,7 +199,7 @@
"}}";
UTEST_INVALID_MODULE(data, LYS_IN_YANG, NULL, LY_ENOTFOUND);
CHECK_LOG_CTX("Augment extension target node \"/a:n1\" from module \"b\" was not found.",
- "/b:{extension='sx:augment-structure'}/{augment='/a:n1'}");
+ "Path \"/b:{extension='sx:augment-structure'}/{augment='/a:n1'}\".");
}
static void
diff --git a/tests/utests/extensions/test_yangdata.c b/tests/utests/extensions/test_yangdata.c
index 89d3231..57caaf2 100644
--- a/tests/utests/extensions/test_yangdata.c
+++ b/tests/utests/extensions/test_yangdata.c
@@ -119,7 +119,7 @@
assert_null(mod->compiled->exts);
CHECK_LOG_CTX("Ext plugin \"ly2 yang-data v1\": "
"Extension rc:yang-data is ignored since it appears as a non top-level statement in \"container\" statement.",
- "/b:b/{extension='rc:yang-data'}/template");
+ "Path \"/b:b/{extension='rc:yang-data'}/template\".");
assert_int_equal(LY_SUCCESS, lys_print_mem(&printed, mod, LYS_OUT_YANG_COMPILED, 0));
assert_string_equal(printed, info);
free(printed);
@@ -168,7 +168,7 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Invalid keyword \"leaf\" as a child of \"rc:yang-data template\" extension instance.",
- "/a:{extension='rc:yang-data'}/template");
+ "Path \"/a:{extension='rc:yang-data'}/template\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:yangdata:a; prefix self;"
"import ietf-restconf {revision-date 2017-01-26; prefix rc;}"
@@ -177,7 +177,7 @@
CHECK_LOG_CTX("Ext plugin \"ly2 yang-data v1\": "
"Extension rc:yang-data is instantiated with leaf top level data node (inside a choice), "
"but only a single container data node is allowed.",
- "/a:{extension='rc:yang-data'}/template");
+ "Path \"/a:{extension='rc:yang-data'}/template\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:yangdata:a; prefix self;"
"import ietf-restconf {revision-date 2017-01-26; prefix rc;}"
@@ -186,7 +186,7 @@
CHECK_LOG_CTX("Ext plugin \"ly2 yang-data v1\": "
"Extension rc:yang-data is instantiated with multiple top level data nodes (inside a single choice's case), "
"but only a single container data node is allowed.",
- "/a:{extension='rc:yang-data'}/template");
+ "Path \"/a:{extension='rc:yang-data'}/template\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:yangdata:a; prefix self;"
"import ietf-restconf {revision-date 2017-01-26; prefix rc;}"
@@ -195,7 +195,7 @@
CHECK_LOG_CTX("Ext plugin \"ly2 yang-data v1\": "
"Extension rc:yang-data is instantiated with multiple top level data nodes, "
"but only a single container data node is allowed.",
- "/a:{extension='rc:yang-data'}/template");
+ "Path \"/a:{extension='rc:yang-data'}/template\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:yangdata:a; prefix self;"
"import ietf-restconf {revision-date 2017-01-26; prefix rc;}"
@@ -204,7 +204,7 @@
CHECK_LOG_CTX("Ext plugin \"ly2 yang-data v1\": "
"Extension rc:yang-data is instantiated without any top level data node, "
"but exactly one container data node is expected.",
- "/a:{extension='rc:yang-data'}/template");
+ "Path \"/a:{extension='rc:yang-data'}/template\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:yangdata:a; prefix self;"
"import ietf-restconf {revision-date 2017-01-26; prefix rc;}"
@@ -220,7 +220,7 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Ext plugin \"ly2 yang-data v1\": "
"Extension rc:yang-data is instantiated multiple times.",
- "/a:{extension='rc:yang-data'}/template");
+ "Path \"/a:{extension='rc:yang-data'}/template\".");
data = "module a {yang-version 1.1; namespace urn:tests:extensions:yangdata:a; prefix self;"
"import ietf-restconf {revision-date 2017-01-26; prefix rc;}"
@@ -230,7 +230,7 @@
CHECK_LOG_CTX("Ext plugin \"ly2 yang-data v1\": "
"Extension rc:yang-data is instantiated with leaf-list top level data node, "
"but only a single container data node is allowed.",
- "/a:{extension='rc:yang-data'}/template");
+ "Path \"/a:{extension='rc:yang-data'}/template\".");
}
static void
diff --git a/tests/utests/node/list.c b/tests/utests/node/list.c
index bb56e8d..987b416 100644
--- a/tests/utests/node/list.c
+++ b/tests/utests/node/list.c
@@ -193,7 +193,7 @@
"leaf group{type string;}"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("List min-elements 20 is bigger than max-elements 10.", "/TERR_0:user");
+ CHECK_LOG_CTX("List min-elements 20 is bigger than max-elements 10.", "Path \"/TERR_0:user\".");
schema = MODULE_CREATE_YANG("TERR_0", "list user {"
"key uid;"
@@ -389,7 +389,7 @@
" <leaf name=\"group\"><type name=\"string\"/></leaf>"
"</list>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("The list's key \"u<id\" not found.", "/T00:user");
+ CHECK_LOG_CTX("The list's key \"u<id\" not found.", "Path \"/T00:user\".");
schema = MODULE_CREATE_YIN("T1", "<list name=\"user\"> "
" <key value=\"uid\"/>"
diff --git a/tests/utests/schema/test_schema.c b/tests/utests/schema/test_schema.c
index 010b4a4..fc1a1ed 100644
--- a/tests/utests/schema/test_schema.c
+++ b/tests/utests/schema/test_schema.c
@@ -1266,10 +1266,10 @@
assert_ptr_equal(mod->identities[1].derived[0], &mod->identities[0]);
ly_ctx_set_module_imp_clb(UTEST_LYCTX, test_imp_clb, "submodule inv_sub {belongs-to inv {prefix inv;} identity i1;}");
- TEST_SCHEMA_ERR(0, 0, "inv", "identity i1 {base i2;}", "Unable to find base (i2) of identity \"i1\".", "/inv:{identity='i1'}");
- TEST_SCHEMA_ERR(0, 0, "inv", "identity i1 {base i1;}", "Identity \"i1\" is derived from itself.", "/inv:{identity='i1'}");
+ TEST_SCHEMA_ERR(0, 0, "inv", "identity i1 {base i2;}", "Unable to find base (i2) of identity \"i1\".", "Path \"/inv:{identity='i1'}\".");
+ TEST_SCHEMA_ERR(0, 0, "inv", "identity i1 {base i1;}", "Identity \"i1\" is derived from itself.", "Path \"/inv:{identity='i1'}\".");
TEST_SCHEMA_ERR(0, 0, "inv", "identity i1 {base i2;}identity i2 {base i3;}identity i3 {base i1;}",
- "Identity \"i1\" is indirectly derived from itself.", "/inv:{identity='i3'}");
+ "Identity \"i1\" is indirectly derived from itself.", "Path \"/inv:{identity='i3'}\".");
/* base in non-implemented module */
ly_ctx_set_module_imp_clb(UTEST_LYCTX, test_imp_clb,
diff --git a/tests/utests/schema/test_tree_schema_compile.c b/tests/utests/schema/test_tree_schema_compile.c
index b61c765..f68344b 100644
--- a/tests/utests/schema/test_tree_schema_compile.c
+++ b/tests/utests/schema/test_tree_schema_compile.c
@@ -113,7 +113,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory(str, &in));
assert_int_equal(LY_EEXIST, lys_parse(UTEST_LYCTX, in, LYS_IN_YANG, NULL, &mod));
ly_in_free(in, 0);
- CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "/aa:a");
+ CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "Path \"/aa:a\".");
}
static void
@@ -128,7 +128,7 @@
" leaf c {type empty;}"
"}";
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, yang_data, LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "/a:c");
+ CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "Path \"/a:c\".");
UTEST_LOG_CLEAN;
yang_data = "module a {namespace urn:a;prefix a;"
@@ -137,7 +137,7 @@
" notification c;"
"}";
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, yang_data, LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "/a:c");
+ CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "Path \"/a:c\".");
UTEST_LOG_CLEAN;
yang_data = "module a {namespace urn:a;prefix a;"
@@ -146,7 +146,7 @@
" rpc c;"
"}";
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, yang_data, LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "/a:c");
+ CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "Path \"/a:c\".");
UTEST_LOG_CLEAN;
yang_data = "module a {namespace urn:a;prefix a;"
@@ -160,7 +160,7 @@
" }"
"}";
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, yang_data, LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "/a:ch/c/c");
+ CHECK_LOG_CTX("Duplicate identifier \"c\" of data definition/RPC/action/notification statement.", "Path \"/a:ch/c/c\".");
UTEST_LOG_CLEAN;
/* nested */
@@ -169,7 +169,7 @@
"container a;"
"}}}";
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, yang_data, LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "/a:c/l/a");
+ CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "Path \"/a:c/l/a\".");
UTEST_LOG_CLEAN;
yang_data = "module a {yang-version 1.1;namespace urn:a;prefix a;container c { list l {key \"k\"; leaf k {type string;}"
@@ -177,7 +177,7 @@
"notification a;"
"}}}";
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, yang_data, LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "/a:c/l/a");
+ CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "Path \"/a:c/l/a\".");
UTEST_LOG_CLEAN;
yang_data = "module a {yang-version 1.1;namespace urn:a;prefix a;container c { list l {key \"k\"; leaf k {type string;}"
@@ -185,7 +185,7 @@
"action a;"
"}}}";
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, yang_data, LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "/a:c/l/a");
+ CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "Path \"/a:c/l/a\".");
UTEST_LOG_CLEAN;
/* grouping */
@@ -296,7 +296,7 @@
/* invalid */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;leaf-list ll {type empty;}}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Leaf-list of type \"empty\" is allowed only in YANG 1.1 modules.", "/aa:ll");
+ CHECK_LOG_CTX("Leaf-list of type \"empty\" is allowed only in YANG 1.1 modules.", "Path \"/aa:ll\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {yang-version 1.1;namespace urn:bb;prefix bb;leaf-list ll {type empty; default x;}}", LYS_IN_YANG, NULL));
CHECK_LOG_CTX("Invalid default - value does not fit the type (Invalid empty value length 1.).", "Schema location \"/bb:ll\".");
@@ -309,7 +309,7 @@
assert_int_equal(3, LY_ARRAY_COUNT(ll->dflts));
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {yang-version 1.1;namespace urn:dd;prefix dd;"
"leaf-list ll {type string; default one;default two;default one;}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Configuration leaf-list has multiple defaults of the same value \"one\".", "/dd:ll");
+ CHECK_LOG_CTX("Configuration leaf-list has multiple defaults of the same value \"one\".", "Path \"/dd:ll\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {yang-version 1.1; namespace urn:ee;prefix ee;"
"leaf ref {type instance-identifier {require-instance true;} default \"/ee:g\";}}", LYS_IN_YANG, NULL));
@@ -405,11 +405,11 @@
/* invalid */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;list l;}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Missing key in list representing configuration data.", "/aa:l");
+ CHECK_LOG_CTX("Missing key in list representing configuration data.", "Path \"/aa:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {yang-version 1.1; namespace urn:bb;prefix bb;"
"list l {key x; leaf x {type string; when 1;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("List's key must not have any \"when\" statement.", "/bb:l/x");
+ CHECK_LOG_CTX("List's key must not have any \"when\" statement.", "Path \"/bb:l/x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {yang-version 1.1;namespace urn:cc;prefix cc;feature f;"
"list l {key x; leaf x {type string; if-feature f;}}}", LYS_IN_YANG, NULL));
@@ -417,43 +417,43 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd;"
"list l {key x; leaf x {type string; config false;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Key of a configuration list must not be a state leaf.", "/dd:l/x");
+ CHECK_LOG_CTX("Key of a configuration list must not be a state leaf.", "Path \"/dd:l/x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;"
"list l {config false;key x; leaf x {type string; config true;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "/ee:l/x");
+ CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "Path \"/ee:l/x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff;"
"list l {key x; leaf-list x {type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("The list's key \"x\" not found.", "/ff:l");
+ CHECK_LOG_CTX("The list's key \"x\" not found.", "Path \"/ff:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg;"
"list l {key x; unique y;leaf x {type string;} leaf-list y {type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Unique's descendant-schema-nodeid \"y\" refers to leaf-list node instead of a leaf.", "/gg:l");
+ CHECK_LOG_CTX("Unique's descendant-schema-nodeid \"y\" refers to leaf-list node instead of a leaf.", "Path \"/gg:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh {namespace urn:hh;prefix hh;"
"list l {key x; unique \"x y\";leaf x {type string;} leaf y {config false; type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Unique statement \"x y\" refers to leaves with different config type.", "/hh:l");
+ CHECK_LOG_CTX("Unique statement \"x y\" refers to leaves with different config type.", "Path \"/hh:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii {namespace urn:ii;prefix ii;"
"list l {key x; unique a:x;leaf x {type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"a:x\" - prefix \"a\" not defined in module \"ii\".", "/ii:l");
+ CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"a:x\" - prefix \"a\" not defined in module \"ii\".", "Path \"/ii:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj {namespace urn:jj;prefix jj;"
"list l {key x; unique c/x;leaf x {type string;}container c {leaf y {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"c/x\" - target node not found.", "/jj:l");
+ CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"c/x\" - target node not found.", "Path \"/jj:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk {namespace urn:kk;prefix kk;"
"list l {key x; unique c^y;leaf x {type string;}container c {leaf y {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"c^\" - missing \"/\" as node-identifier separator.", "/kk:l");
+ CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"c^\" - missing \"/\" as node-identifier separator.", "Path \"/kk:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ll {namespace urn:ll;prefix ll;"
"list l {key \"x y x\";leaf x {type string;}leaf y {type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicated key identifier \"x\".", "/ll:l");
+ CHECK_LOG_CTX("Duplicated key identifier \"x\".", "Path \"/ll:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm {namespace urn:mm;prefix mm;"
"list l {key x;leaf x {type empty;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("List's key cannot be of \"empty\" type until it is in YANG 1.1 module.", "/mm:l/x");
+ CHECK_LOG_CTX("List's key cannot be of \"empty\" type until it is in YANG 1.1 module.", "Path \"/mm:l/x\".");
}
static void
@@ -492,26 +492,26 @@
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;"
"choice ch {case a {leaf x {type string;}}leaf x {type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"x\" of data definition/RPC/action/notification statement.", "/aa:ch/x/x");
+ CHECK_LOG_CTX("Duplicate identifier \"x\" of data definition/RPC/action/notification statement.", "Path \"/aa:ch/x/x\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module aa2 {namespace urn:aa2;prefix aa;"
"choice ch {case a {leaf y {type string;}}case b {leaf y {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"y\" of data definition/RPC/action/notification statement.", "/aa2:ch/b/y");
+ CHECK_LOG_CTX("Duplicate identifier \"y\" of data definition/RPC/action/notification statement.", "Path \"/aa2:ch/b/y\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;"
"choice ch {case a {leaf x {type string;}}leaf a {type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"a\" of case statement.", "/bb:ch/a");
+ CHECK_LOG_CTX("Duplicate identifier \"a\" of case statement.", "Path \"/bb:ch/a\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module bb2 {namespace urn:bb2;prefix bb;"
"choice ch {case b {leaf x {type string;}}case b {leaf y {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"b\" of case statement.", "/bb2:ch/b");
+ CHECK_LOG_CTX("Duplicate identifier \"b\" of case statement.", "Path \"/bb2:ch/b\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ca {namespace urn:ca;prefix ca;"
"choice ch {default c;case a {leaf x {type string;}}case b {leaf y {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Default case \"c\" not found.", "/ca:ch");
+ CHECK_LOG_CTX("Default case \"c\" not found.", "Path \"/ca:ch\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cb {namespace urn:cb;prefix cb; import a {prefix a;}"
"choice ch {default a:a;case a {leaf x {type string;}}case b {leaf y {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Default case \"a:a\" not found.", "/cb:ch");
+ CHECK_LOG_CTX("Default case \"a:a\" not found.", "Path \"/cb:ch\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc;"
"choice ch {default a;case a {leaf x {mandatory true;type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Mandatory node \"x\" under the default case \"a\".", "/cc:ch");
+ CHECK_LOG_CTX("Mandatory node \"x\" under the default case \"a\".", "Path \"/cc:ch\".");
/* TODO check with mandatory nodes from augment placed into the case */
}
@@ -579,26 +579,26 @@
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;leaf x{type string;} rpc x;}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"x\" of data definition/RPC/action/notification statement.", "/bb:x");
+ CHECK_LOG_CTX("Duplicate identifier \"x\" of data definition/RPC/action/notification statement.", "Path \"/bb:x\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module cc {yang-version 1.1; namespace urn:cc;prefix cc;container c {leaf y {type string;} action y;}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"y\" of data definition/RPC/action/notification statement.", "/cc:c/y");
+ CHECK_LOG_CTX("Duplicate identifier \"y\" of data definition/RPC/action/notification statement.", "Path \"/cc:c/y\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module dd {yang-version 1.1; namespace urn:dd;prefix dd;container c {action z; action z;}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"z\" of data definition/RPC/action/notification statement.", "/dd:c/z");
+ CHECK_LOG_CTX("Duplicate identifier \"z\" of data definition/RPC/action/notification statement.", "Path \"/dd:c/z\".");
ly_ctx_set_module_imp_clb(UTEST_LYCTX, test_imp_clb, "submodule eesub {belongs-to ee {prefix ee;} notification w;}");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module ee {yang-version 1.1; namespace urn:ee;prefix ee;include eesub; rpc w;}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"w\" of data definition/RPC/action/notification statement.", "/ee:w");
+ CHECK_LOG_CTX("Duplicate identifier \"w\" of data definition/RPC/action/notification statement.", "Path \"/ee:w\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {yang-version 1.1; namespace urn:ff;prefix ff; rpc test {input {container a {leaf b {type string;}}}}"
"augment /test/input/a {action invalid {input {leaf x {type string;}}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Action \"invalid\" is placed inside another RPC/action.", "/ff:{augment='/test/input/a'}/invalid");
+ CHECK_LOG_CTX("Action \"invalid\" is placed inside another RPC/action.", "Path \"/ff:{augment='/test/input/a'}/invalid\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {yang-version 1.1; namespace urn:gg;prefix gg; notification test {container a {leaf b {type string;}}}"
"augment /test/a {action invalid {input {leaf x {type string;}}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Action \"invalid\" is placed inside notification.", "/gg:{augment='/test/a'}/invalid");
+ CHECK_LOG_CTX("Action \"invalid\" is placed inside notification.", "Path \"/gg:{augment='/test/a'}/invalid\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh {yang-version 1.1; namespace urn:hh;prefix hh; notification test {container a {uses grp;}}"
"grouping grp {action invalid {input {leaf x {type string;}}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Action \"invalid\" is placed inside notification.", "/hh:test/a/{uses='grp'}/invalid");
+ CHECK_LOG_CTX("Action \"invalid\" is placed inside notification.", "Path \"/hh:test/a/{uses='grp'}/invalid\".");
}
static void
@@ -650,26 +650,26 @@
"Line number 1.");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;leaf x{type string;} notification x;}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"x\" of data definition/RPC/action/notification statement.", "/bb:x");
+ CHECK_LOG_CTX("Duplicate identifier \"x\" of data definition/RPC/action/notification statement.", "Path \"/bb:x\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module cc {yang-version 1.1; namespace urn:cc;prefix cc;container c {leaf y {type string;} notification y;}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"y\" of data definition/RPC/action/notification statement.", "/cc:c/y");
+ CHECK_LOG_CTX("Duplicate identifier \"y\" of data definition/RPC/action/notification statement.", "Path \"/cc:c/y\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module dd {yang-version 1.1; namespace urn:dd;prefix dd;container c {notification z; notification z;}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"z\" of data definition/RPC/action/notification statement.", "/dd:c/z");
+ CHECK_LOG_CTX("Duplicate identifier \"z\" of data definition/RPC/action/notification statement.", "Path \"/dd:c/z\".");
ly_ctx_set_module_imp_clb(UTEST_LYCTX, test_imp_clb, "submodule eesub {belongs-to ee {prefix ee;} rpc w;}");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module ee {yang-version 1.1; namespace urn:ee;prefix ee;include eesub; notification w;}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Duplicate identifier \"w\" of data definition/RPC/action/notification statement.", "/ee:w");
+ CHECK_LOG_CTX("Duplicate identifier \"w\" of data definition/RPC/action/notification statement.", "Path \"/ee:w\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {yang-version 1.1; namespace urn:ff;prefix ff; rpc test {input {container a {leaf b {type string;}}}}"
"augment /test/input/a {notification invalid {leaf x {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Notification \"invalid\" is placed inside RPC/action.", "/ff:{augment='/test/input/a'}/invalid");
+ CHECK_LOG_CTX("Notification \"invalid\" is placed inside RPC/action.", "Path \"/ff:{augment='/test/input/a'}/invalid\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {yang-version 1.1; namespace urn:gg;prefix gg; notification test {container a {leaf b {type string;}}}"
"augment /test/a {notification invalid {leaf x {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Notification \"invalid\" is placed inside another notification.", "/gg:{augment='/test/a'}/invalid");
+ CHECK_LOG_CTX("Notification \"invalid\" is placed inside another notification.", "Path \"/gg:{augment='/test/a'}/invalid\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh {yang-version 1.1; namespace urn:hh;prefix hh; rpc test {input {container a {uses grp;}}}"
"grouping grp {notification invalid {leaf x {type string;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Notification \"invalid\" is placed inside RPC/action.", "/hh:test/input/a/{uses='grp'}/invalid");
+ CHECK_LOG_CTX("Notification \"invalid\" is placed inside RPC/action.", "Path \"/hh:test/input/a/{uses='grp'}/invalid\".");
}
/**
@@ -918,83 +918,56 @@
assert_int_equal(10, ((struct lysc_type_bin *)type)->length->parts[0].min_u64);
assert_int_equal(100, ((struct lysc_type_bin *)type)->length->parts[0].max_u64);
- /* new string is tested in file ./tests/utests/types/string.c */
-#if 0
- assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module l {namespace urn:l;prefix l;typedef mytype {type string {length 10..100;}}"
- "typedef mytype2 {type mytype {pattern '[0-9]*';}} leaf l {type mytype2 {pattern '[0-4]*';}}}", LYS_IN_YANG, &mod));
- type = ((struct lysc_node_leaf *)mod->compiled->data)->type;
- assert_non_null(type);
- assert_int_equal(LY_TYPE_STRING, type->basetype);
- assert_int_equal(1, type->refcount);
- assert_non_null(((struct lysc_type_str *)type)->length);
- assert_non_null(((struct lysc_type_str *)type)->length->parts);
- assert_int_equal(1, LY_ARRAY_COUNT(((struct lysc_type_str *)type)->length->parts));
- assert_int_equal(10, ((struct lysc_type_str *)type)->length->parts[0].min_u64);
- assert_int_equal(100, ((struct lysc_type_str *)type)->length->parts[0].max_u64);
-
- assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module m {namespace urn:m;prefix m;typedef mytype {type string {length 10;}}"
- "leaf l {type mytype {length min..max;}}}", LYS_IN_YANG, &mod));
- type = ((struct lysc_node_leaf *)mod->compiled->data)->type;
- assert_non_null(type);
- assert_int_equal(LY_TYPE_STRING, type->basetype);
- assert_int_equal(1, type->refcount);
- assert_non_null(((struct lysc_type_str *)type)->length);
- assert_non_null(((struct lysc_type_str *)type)->length->parts);
- assert_int_equal(1, LY_ARRAY_COUNT(((struct lysc_type_str *)type)->length->parts));
- assert_int_equal(10, ((struct lysc_type_str *)type)->length->parts[0].min_u64);
- assert_int_equal(10, ((struct lysc_type_str *)type)->length->parts[0].max_u64);
-#endif
-
/* invalid values */
assert_int_equal(LY_EDENIED, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;leaf l {type binary {length -10;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - value \"-10\" does not fit the type limitations.", "/aa:l");
+ CHECK_LOG_CTX("Invalid length restriction - value \"-10\" does not fit the type limitations.", "Path \"/aa:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;leaf l {type binary {length 18446744073709551616;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - invalid value \"18446744073709551616\".", "/bb:l");
+ CHECK_LOG_CTX("Invalid length restriction - invalid value \"18446744073709551616\".", "Path \"/bb:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc;leaf l {type binary {length \"max .. 10\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - unexpected data after max keyword (.. 10).", "/cc:l");
+ CHECK_LOG_CTX("Invalid length restriction - unexpected data after max keyword (.. 10).", "Path \"/cc:l\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd;leaf l {type binary {length 50..10;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (10).", "/dd:l");
+ CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (10).", "Path \"/dd:l\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;leaf l {type binary {length \"50 | 10\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (10).", "/ee:l");
+ CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (10).", "Path \"/ee:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff;leaf l {type binary {length \"x\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - unexpected data (x).", "/ff:l");
+ CHECK_LOG_CTX("Invalid length restriction - unexpected data (x).", "Path \"/ff:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg;leaf l {type binary {length \"50 | min\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - unexpected data before min keyword (50 | ).", "/gg:l");
+ CHECK_LOG_CTX("Invalid length restriction - unexpected data before min keyword (50 | ).", "Path \"/gg:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh {namespace urn:hh;prefix hh;leaf l {type binary {length \"| 50\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - unexpected beginning of the expression (| 50).", "/hh:l");
+ CHECK_LOG_CTX("Invalid length restriction - unexpected beginning of the expression (| 50).", "Path \"/hh:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii {namespace urn:ii;prefix ii;leaf l {type binary {length \"10 ..\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - unexpected end of the expression after \"..\" (10 ..).", "/ii:l");
+ CHECK_LOG_CTX("Invalid length restriction - unexpected end of the expression after \"..\" (10 ..).", "Path \"/ii:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj {namespace urn:jj;prefix jj;leaf l {type binary {length \".. 10\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - unexpected \"..\" without a lower bound.", "/jj:l");
+ CHECK_LOG_CTX("Invalid length restriction - unexpected \"..\" without a lower bound.", "Path \"/jj:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk {namespace urn:kk;prefix kk;leaf l {type binary {length \"10 |\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - unexpected end of the expression (10 |).", "/kk:l");
+ CHECK_LOG_CTX("Invalid length restriction - unexpected end of the expression (10 |).", "Path \"/kk:l\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module kl {namespace urn:kl;prefix kl;leaf l {type binary {length \"10..20 | 15..30\";}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (15).", "/kl:l");
+ CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (15).", "Path \"/kl:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ll {namespace urn:ll;prefix ll;typedef mytype {type binary {length 10;}}"
"leaf l {type mytype {length 11;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - the derived restriction (11) is not equally or more limiting.", "/ll:l");
+ CHECK_LOG_CTX("Invalid length restriction - the derived restriction (11) is not equally or more limiting.", "Path \"/ll:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm {namespace urn:mm;prefix mm;typedef mytype {type binary {length 10..100;}}"
"leaf l {type mytype {length 1..11;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - the derived restriction (1..11) is not equally or more limiting.", "/mm:l");
+ CHECK_LOG_CTX("Invalid length restriction - the derived restriction (1..11) is not equally or more limiting.", "Path \"/mm:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module nn {namespace urn:nn;prefix nn;typedef mytype {type binary {length 10..100;}}"
"leaf l {type mytype {length 20..110;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - the derived restriction (20..110) is not equally or more limiting.", "/nn:l");
+ CHECK_LOG_CTX("Invalid length restriction - the derived restriction (20..110) is not equally or more limiting.", "Path \"/nn:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module oo {namespace urn:oo;prefix oo;typedef mytype {type binary {length 10..100;}}"
"leaf l {type mytype {length 20..30|110..120;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - the derived restriction (20..30|110..120) is not equally or more limiting.", "/oo:l");
+ CHECK_LOG_CTX("Invalid length restriction - the derived restriction (20..30|110..120) is not equally or more limiting.", "Path \"/oo:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module pp {namespace urn:pp;prefix pp;typedef mytype {type binary {length 10..11;}}"
"leaf l {type mytype {length 15;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - the derived restriction (15) is not equally or more limiting.", "/pp:l");
+ CHECK_LOG_CTX("Invalid length restriction - the derived restriction (15) is not equally or more limiting.", "Path \"/pp:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module qq {namespace urn:qq;prefix qq;typedef mytype {type binary {length 10..20|30..40;}}"
"leaf l {type mytype {length 15..35;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - the derived restriction (15..35) is not equally or more limiting.", "/qq:l");
+ CHECK_LOG_CTX("Invalid length restriction - the derived restriction (15..35) is not equally or more limiting.", "Path \"/qq:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module rr {namespace urn:rr;prefix rr;typedef mytype {type binary {length 10;}}"
"leaf l {type mytype {length 10..35;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid length restriction - the derived restriction (10..35) is not equally or more limiting.", "/rr:l");
+ CHECK_LOG_CTX("Invalid length restriction - the derived restriction (10..35) is not equally or more limiting.", "Path \"/rr:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ss {namespace urn:ss;prefix ss;leaf l {type binary {pattern '[0-9]*';}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid type restrictions for binary type.", "/ss:l");
+ CHECK_LOG_CTX("Invalid type restrictions for binary type.", "Path \"/ss:l\".");
}
static void
@@ -1165,30 +1138,31 @@
CHECK_LOG_CTX("Control characters in enum name should be avoided (\"inva\nlid\", character number 5).", NULL);
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb; leaf l {type enumeration;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing enum substatement for enumeration type.", "/bb:l");
+ CHECK_LOG_CTX("Missing enum substatement for enumeration type.", "Path \"/bb:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {yang-version 1.1;namespace urn:cc;prefix cc;typedef mytype {type enumeration {enum one;}}"
"leaf l {type mytype {enum two;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid enumeration - derived type adds new item \"two\".", "/cc:l");
+ CHECK_LOG_CTX("Invalid enumeration - derived type adds new item \"two\".", "Path \"/cc:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {yang-version 1.1;namespace urn:dd;prefix dd;typedef mytype {type enumeration {enum one;}}"
"leaf l {type mytype {enum one {value 1;}}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid enumeration - value of the item \"one\" has changed from 0 to 1 in the derived type.", "/dd:l");
+ CHECK_LOG_CTX("Invalid enumeration - value of the item \"one\" has changed from 0 to 1 in the derived type.", "Path \"/dd:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;leaf l {type enumeration {enum x {value 2147483647;}enum y;}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid enumeration - it is not possible to auto-assign enum value for \"y\" since the highest value is already 2147483647.", "/ee:l");
+ CHECK_LOG_CTX("Invalid enumeration - it is not possible to auto-assign enum value for \"y\" since the highest value is already 2147483647.",
+ "Path \"/ee:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff;leaf l {type enumeration {enum x {value 1;}enum y {value 1;}}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid enumeration - value 1 collide in items \"y\" and \"x\".", "/ff:l");
+ CHECK_LOG_CTX("Invalid enumeration - value 1 collide in items \"y\" and \"x\".", "Path \"/ff:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg;typedef mytype {type enumeration;}"
"leaf l {type mytype {enum one;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing enum substatement for enumeration type mytype.", "/gg:l");
+ CHECK_LOG_CTX("Missing enum substatement for enumeration type mytype.", "Path \"/gg:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh {namespace urn:hh;prefix hh; typedef mytype {type enumeration {enum one;}}"
"leaf l {type mytype {enum one;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Enumeration type can be subtyped only in YANG 1.1 modules.", "/hh:l");
+ CHECK_LOG_CTX("Enumeration type can be subtyped only in YANG 1.1 modules.", "Path \"/hh:l\".");
}
static void
@@ -1248,33 +1222,33 @@
CHECK_LOG_CTX("Value \"19\" is out of \"fraction-digits\" bounds.", "Line number 1.");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; leaf l {type decimal64;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing fraction-digits substatement for decimal64 type.", "/aa:l");
+ CHECK_LOG_CTX("Missing fraction-digits substatement for decimal64 type.", "Path \"/aa:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ab {namespace urn:ab;prefix ab; typedef mytype {type decimal64;}leaf l {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing fraction-digits substatement for decimal64 type mytype.", "/ab:l");
+ CHECK_LOG_CTX("Missing fraction-digits substatement for decimal64 type mytype.", "Path \"/ab:l\".");
assert_int_equal(LY_EINVAL, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb; leaf l {type decimal64 {fraction-digits 2;"
"range '3.142';}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Range boundary \"3.142\" of decimal64 type exceeds defined number (2) of fraction digits.", "/bb:l");
+ CHECK_LOG_CTX("Range boundary \"3.142\" of decimal64 type exceeds defined number (2) of fraction digits.", "Path \"/bb:l\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc; leaf l {type decimal64 {fraction-digits 2;"
"range '4 | 3.14';}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid range restriction - values are not in ascending order (3.14).", "/cc:l");
+ CHECK_LOG_CTX("Invalid range restriction - values are not in ascending order (3.14).", "Path \"/cc:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd; typedef mytype {type decimal64 {fraction-digits 2;}}"
"leaf l {type mytype {fraction-digits 3;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid fraction-digits substatement for type not directly derived from decimal64 built-in type.", "/dd:l");
+ CHECK_LOG_CTX("Invalid fraction-digits substatement for type not directly derived from decimal64 built-in type.", "Path \"/dd:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module de {namespace urn:de;prefix de; typedef mytype {type decimal64 {fraction-digits 2;}}"
"typedef mytype2 {type mytype {fraction-digits 3;}}leaf l {type mytype2;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid fraction-digits substatement for type \"mytype2\" not directly derived from decimal64 built-in type.", "/de:l");
+ CHECK_LOG_CTX("Invalid fraction-digits substatement for type \"mytype2\" not directly derived from decimal64 built-in type.", "Path \"/de:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;typedef mytype {type decimal64 {"
"fraction-digits 18;range '-10 .. 0';}}leaf l {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid range restriction - invalid value \"-10000000000000000000\".", "/ee:l");
+ CHECK_LOG_CTX("Invalid range restriction - invalid value \"-10000000000000000000\".", "Path \"/ee:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;typedef mytype {type decimal64 {"
"fraction-digits 18;range '0 .. 10';}}leaf l {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid range restriction - invalid value \"10000000000000000000\".", "/ee:l");
+ CHECK_LOG_CTX("Invalid range restriction - invalid value \"10000000000000000000\".", "Path \"/ee:l\".");
}
static void
@@ -1307,7 +1281,7 @@
CHECK_LOG_CTX("Invalid value \"yes\" of \"require-instance\".", "Line number 1.");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; leaf l {type instance-identifier {fraction-digits 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid type restrictions for instance-identifier type.", "/aa:l");
+ CHECK_LOG_CTX("Invalid type restrictions for instance-identifier type.", "Path \"/aa:l\".");
}
static ly_bool
@@ -1703,29 +1677,29 @@
/* invalid cases */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; leaf l {type identityref;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing base substatement for identityref type.", "/aa:l");
+ CHECK_LOG_CTX("Missing base substatement for identityref type.", "Path \"/aa:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb; typedef mytype {type identityref;}"
"leaf l {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing base substatement for identityref type mytype.", "/bb:l");
+ CHECK_LOG_CTX("Missing base substatement for identityref type mytype.", "Path \"/bb:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc; identity i; typedef mytype {type identityref {base i;}}"
"leaf l {type mytype {base i;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid base substatement for the type not directly derived from identityref built-in type.", "/cc:l");
+ CHECK_LOG_CTX("Invalid base substatement for the type not directly derived from identityref built-in type.", "Path \"/cc:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd; identity i; typedef mytype {type identityref {base i;}}"
"typedef mytype2 {type mytype {base i;}}leaf l {type mytype2;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid base substatement for the type \"mytype2\" not directly derived from identityref built-in type.", "/dd:l");
+ CHECK_LOG_CTX("Invalid base substatement for the type \"mytype2\" not directly derived from identityref built-in type.", "Path \"/dd:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee; identity i; identity j;"
"leaf l {type identityref {base i;base j;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Multiple bases in identityref type are allowed only in YANG 1.1 modules.", "/ee:l");
+ CHECK_LOG_CTX("Multiple bases in identityref type are allowed only in YANG 1.1 modules.", "Path \"/ee:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff; identity i;leaf l {type identityref {base j;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Unable to find base (j) of identityref.", "/ff:l");
+ CHECK_LOG_CTX("Unable to find base (j) of identityref.", "Path \"/ff:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg;leaf l {type identityref {base x:j;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid prefix used for base (x:j) of identityref.", "/gg:l");
+ CHECK_LOG_CTX("Invalid prefix used for base (x:j) of identityref.", "Path \"/gg:l\".");
}
static void
@@ -1976,20 +1950,20 @@
"Schema location \"/gg:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh {namespace urn:hh;prefix hh;"
"leaf ref1 {type leafref;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing path substatement for leafref type.", "/hh:ref1");
+ CHECK_LOG_CTX("Missing path substatement for leafref type.", "Path \"/hh:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii {namespace urn:ii;prefix ii;typedef mytype {type leafref;}"
"leaf ref1 {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing path substatement for leafref type mytype.", "/ii:ref1");
+ CHECK_LOG_CTX("Missing path substatement for leafref type mytype.", "Path \"/ii:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk {namespace urn:kk;prefix kk;"
"leaf ref {type leafref {path /target;}}leaf target {type string;config false;}}", LYS_IN_YANG, &mod));
CHECK_LOG_CTX("Invalid leafref path \"/target\" - target is supposed to represent configuration data (as the leafref does), but it does not.", "Schema location \"/kk:ref\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ll {namespace urn:ll;prefix ll;"
"leaf ref {type leafref {path /target; require-instance true;}}leaf target {type string;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Leafref type can be restricted by require-instance statement only in YANG 1.1 modules.", "/ll:ref");
+ CHECK_LOG_CTX("Leafref type can be restricted by require-instance statement only in YANG 1.1 modules.", "Path \"/ll:ref\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm {namespace urn:mm;prefix mm;typedef mytype {type leafref {path /target;require-instance false;}}"
"leaf ref {type mytype;}leaf target {type string;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Leafref type \"mytype\" can be restricted by require-instance statement only in YANG 1.1 modules.", "/mm:ref");
+ CHECK_LOG_CTX("Leafref type \"mytype\" can be restricted by require-instance statement only in YANG 1.1 modules.", "Path \"/mm:ref\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module nn {namespace urn:nn;prefix nn;\n"
"list interface{key name;leaf name{type string;}leaf ip {type string;}}\n"
@@ -2136,7 +2110,7 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;typedef mytype {type empty; default x;}"
"leaf l {type mytype;}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Invalid type \"mytype\" - \"empty\" type must not have a default value (x).", "/bb:l");
+ CHECK_LOG_CTX("Invalid type \"mytype\" - \"empty\" type must not have a default value (x).", "Path \"/bb:l\".");
}
static void
@@ -2190,25 +2164,25 @@
/* invalid unions */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;typedef mytype {type union;}"
"leaf l {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing type substatement for union type mytype.", "/aa:l");
+ CHECK_LOG_CTX("Missing type substatement for union type mytype.", "Path \"/aa:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;leaf l {type union;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Missing type substatement for union type.", "/bb:l");
+ CHECK_LOG_CTX("Missing type substatement for union type.", "Path \"/bb:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc;typedef mytype {type union{type int8; type string;}}"
"leaf l {type mytype {type string;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid type substatement for the type not directly derived from union built-in type.", "/cc:l");
+ CHECK_LOG_CTX("Invalid type substatement for the type not directly derived from union built-in type.", "Path \"/cc:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd;typedef mytype {type union{type int8; type string;}}"
"typedef mytype2 {type mytype {type string;}}leaf l {type mytype2;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid type substatement for the type \"mytype2\" not directly derived from union built-in type.", "/dd:l");
+ CHECK_LOG_CTX("Invalid type substatement for the type \"mytype2\" not directly derived from union built-in type.", "Path \"/dd:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;typedef mytype {type union{type mytype; type string;}}"
"leaf l {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid \"mytype\" type reference - circular chain of types detected.", "/ee:l");
+ CHECK_LOG_CTX("Invalid \"mytype\" type reference - circular chain of types detected.", "Path \"/ee:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ef {namespace urn:ef;prefix ef;typedef mytype {type mytype2;}"
"typedef mytype2 {type mytype;} leaf l {type mytype;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid \"mytype\" type reference - circular chain of types detected.", "/ef:l");
+ CHECK_LOG_CTX("Invalid \"mytype\" type reference - circular chain of types detected.", "Path \"/ef:l\".");
}
static void
@@ -2302,15 +2276,15 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;"
"container c {status deprecated; leaf l {status current; type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Status \"current\" of \"l\" is in conflict with \"deprecated\" status of parent \"c\".", "/aa:c/l");
+ CHECK_LOG_CTX("Status \"current\" of \"l\" is in conflict with \"deprecated\" status of parent \"c\".", "Path \"/aa:c/l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;"
"container c {status obsolete; leaf l {status current; type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Status \"current\" of \"l\" is in conflict with \"obsolete\" status of parent \"c\".", "/bb:c/l");
+ CHECK_LOG_CTX("Status \"current\" of \"l\" is in conflict with \"obsolete\" status of parent \"c\".", "Path \"/bb:c/l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc;"
"container c {status obsolete; leaf l {status deprecated; type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Status \"deprecated\" of \"l\" is in conflict with \"obsolete\" status of parent \"c\".", "/cc:c/l");
+ CHECK_LOG_CTX("Status \"deprecated\" of \"l\" is in conflict with \"obsolete\" status of parent \"c\".", "Path \"/cc:c/l\".");
/* just a warning */
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:dd;prefix d;"
@@ -2337,11 +2311,11 @@
/* invalid - error in a non-instantiated grouping */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;"
"grouping grp {leaf x {type leafref;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Missing path substatement for leafref type.", "/aa:{grouping='grp'}/x");
+ CHECK_LOG_CTX("Missing path substatement for leafref type.", "Path \"/aa:{grouping='grp'}/x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;"
"container a {grouping grp {leaf x {type leafref;}}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Missing path substatement for leafref type.", "/aa:a/{grouping='grp'}/x");
+ CHECK_LOG_CTX("Missing path substatement for leafref type.", "Path \"/aa:a/{grouping='grp'}/x\".");
CHECK_LOG_CTX("Locally scoped grouping \"grp\" not used.", NULL);
/* config check */
@@ -2513,52 +2487,53 @@
/* invalid */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;uses missinggrp;}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Grouping \"missinggrp\" referenced by a uses statement not found.", "/aa:{uses='missinggrp'}");
+ CHECK_LOG_CTX("Grouping \"missinggrp\" referenced by a uses statement not found.", "Path \"/aa:{uses='missinggrp'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;uses grp;"
"grouping grp {leaf a{type string;}uses grp1;}"
"grouping grp1 {leaf b {type string;}uses grp2;}"
"grouping grp2 {leaf c {type string;}uses grp;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Grouping \"grp\" references itself through a uses statement.", "/bb:{uses='grp'}/{uses='grp1'}/{uses='grp2'}/{uses='grp'}");
+ CHECK_LOG_CTX("Grouping \"grp\" references itself through a uses statement.", "Path \"/bb:{uses='grp'}/{uses='grp1'}/{uses='grp2'}/{uses='grp'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc;uses a:missingprefix;}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid prefix used for grouping \"a:missingprefix\" reference.", "/cc:{uses='a:missingprefix'}");
+ CHECK_LOG_CTX("Invalid prefix used for grouping \"a:missingprefix\" reference.", "Path \"/cc:{uses='a:missingprefix'}\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd;grouping grp{leaf a{type string;}}"
"leaf a {type string;}uses grp;}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "/dd:{uses='grp'}/dd:a");
+ CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "Path \"/dd:{uses='grp'}/dd:a\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;grouping grp {leaf l {type string; status deprecated;}}"
"uses grp {status obsolete;}}", LYS_IN_YANG, &mod));
CHECK_LOG_CTX("Inherited schema-only status \"obsolete\" is in conflict with \"deprecated\" status of \"l\".",
- "/ee:{uses='grp'}/ee:l");
+ "Path \"/ee:{uses='grp'}/ee:l\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff;grouping grp {leaf l {type string;}}"
"leaf l {type int8;}uses grp;}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Duplicate identifier \"l\" of data definition/RPC/action/notification statement.", "/ff:{uses='grp'}/ff:l");
+ CHECK_LOG_CTX("Duplicate identifier \"l\" of data definition/RPC/action/notification statement.", "Path \"/ff:{uses='grp'}/ff:l\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module fg {namespace urn:fg;prefix fg;grouping grp {leaf m {type string;}}"
"uses grp;leaf m {type int8;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Duplicate identifier \"m\" of data definition/RPC/action/notification statement.", "/fg:m");
+ CHECK_LOG_CTX("Duplicate identifier \"m\" of data definition/RPC/action/notification statement.", "Path \"/fg:m\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg; grouping grp {container g;}"
"leaf g {type string;}"
"container top {uses grp {augment /g {leaf x {type int8;}}}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"/g\" - name test expected instead of \"/\".", "/gg:top/{uses='grp'}/{augment='/g'}");
+ CHECK_LOG_CTX("Invalid descendant-schema-nodeid value \"/g\" - name test expected instead of \"/\".",
+ "Path \"/gg:top/{uses='grp'}/{augment='/g'}\".");
assert_int_equal(LY_ENOTFOUND, lys_parse_mem(UTEST_LYCTX, "module hh {yang-version 1.1;namespace urn:hh;prefix hh;"
"grouping grp {notification g { description \"super g\";}}"
"container top {notification h; uses grp {refine h {description \"ultra h\";}}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Refine(s) target node \"h\" in grouping \"grp\" was not found.", "/hh:top/{uses='grp'}");
+ CHECK_LOG_CTX("Refine(s) target node \"h\" in grouping \"grp\" was not found.", "Path \"/hh:top/{uses='grp'}\".");
assert_int_equal(LY_ENOTFOUND, lys_parse_mem(UTEST_LYCTX, "module ii {yang-version 1.1;namespace urn:ii;prefix ii;"
"grouping grp {action g { description \"super g\";}}"
"container top {action i; uses grp {refine i {description \"ultra i\";}}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Refine(s) target node \"i\" in grouping \"grp\" was not found.", "/ii:top/{uses='grp'}");
+ CHECK_LOG_CTX("Refine(s) target node \"i\" in grouping \"grp\" was not found.", "Path \"/ii:top/{uses='grp'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj {yang-version 1.1;namespace urn:jj;prefix jj;"
"grouping grp {leaf j { when \"1\"; type invalid;}}"
"container top {uses grp;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Referenced type \"invalid\" not found.", "/jj:top/{uses='grp'}/j");
+ CHECK_LOG_CTX("Referenced type \"invalid\" not found.", "Path \"/jj:top/{uses='grp'}/j\".");
}
static void
@@ -2660,65 +2635,71 @@
/* invalid */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;import grp {prefix g;}"
"uses g:grp {refine c {default hello;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid refine of container node - it is not possible to replace \"default\" property.", "/aa:{uses='g:grp'}/aa:c/{refine='c'}");
+ CHECK_LOG_CTX("Invalid refine of container node - it is not possible to replace \"default\" property.",
+ "Path \"/aa:{uses='g:grp'}/aa:c/{refine='c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;import grp {prefix g;}"
"uses g:grp {refine c/l {default hello; default world;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid refine of leaf with too many (2) default properties.", "/bb:{uses='g:grp'}/bb:c/l/{refine='c/l'}");
+ CHECK_LOG_CTX("Invalid refine of leaf with too many (2) default properties.", "Path \"/bb:{uses='g:grp'}/bb:c/l/{refine='c/l'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc;import grp {prefix g;}"
"uses g:grp {refine c/ll {default hello; default world;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid refine of default in leaf-list - the default statement is allowed only in YANG 1.1 modules.", "/cc:{uses='g:grp'}/cc:c/ll/{refine='c/ll'}");
+ CHECK_LOG_CTX("Invalid refine of default in leaf-list - the default statement is allowed only in YANG 1.1 modules.",
+ "Path \"/cc:{uses='g:grp'}/cc:c/ll/{refine='c/ll'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd;import grp {prefix g;}"
"uses g:grp {refine c/ll {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid refine of leaf-list node - it is not possible to replace \"mandatory\" property.", "/dd:{uses='g:grp'}/dd:c/ll/{refine='c/ll'}");
+ CHECK_LOG_CTX("Invalid refine of leaf-list node - it is not possible to replace \"mandatory\" property.",
+ "Path \"/dd:{uses='g:grp'}/dd:c/ll/{refine='c/ll'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;import grp {prefix g;}"
"uses g:grp {refine c/l {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/ee:{uses='g:grp'}/ee:c/l");
- CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "/ee:{uses='g:grp'}/ee:c/l");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/ee:{uses='g:grp'}/ee:c/l\".");
+ CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "Path \"/ee:{uses='g:grp'}/ee:c/l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ef {namespace urn:ef;prefix ef;import grp {prefix g;}"
"uses g:grp {refine c/ch {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/ef:{uses='g:grp'}/ef:c/ch");
- CHECK_LOG_CTX("Invalid mandatory choice with a default case.", "/ef:{uses='g:grp'}/ef:c/ch");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/ef:{uses='g:grp'}/ef:c/ch\".");
+ CHECK_LOG_CTX("Invalid mandatory choice with a default case.", "Path \"/ef:{uses='g:grp'}/ef:c/ch\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff;import grp {prefix g;}"
"uses g:grp {refine c/ch/ca/ca {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Mandatory node \"ca\" under the default case \"ca\".", "/ff:{uses='g:grp'}/ff:c/ch");
+ CHECK_LOG_CTX("Mandatory node \"ca\" under the default case \"ca\".", "Path \"/ff:{uses='g:grp'}/ff:c/ch\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg;import grp {prefix g;}"
"uses g:grp {refine c/x {default hello;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/gg:{uses='g:grp'}/gg:c/x");
- CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "/gg:{uses='g:grp'}/gg:c/x");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/gg:{uses='g:grp'}/gg:c/x\".");
+ CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "Path \"/gg:{uses='g:grp'}/gg:c/x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh {namespace urn:hh;prefix hh;import grp {prefix g;}"
"uses g:grp {refine c/c/l {config true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/hh:{uses='g:grp'}/hh:c/c/l");
- CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "/hh:{uses='g:grp'}/hh:c/c/l");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/hh:{uses='g:grp'}/hh:c/c/l\".");
+ CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "Path \"/hh:{uses='g:grp'}/hh:c/c/l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii {namespace urn:ii;prefix ii;grouping grp {leaf l {type string; status deprecated;}}"
"uses grp {status obsolete;}}", LYS_IN_YANG, &mod));
CHECK_LOG_CTX("Inherited schema-only status \"obsolete\" is in conflict with \"deprecated\" status of \"l\".",
- "/ii:{uses='grp'}/ii:l");
+ "Path \"/ii:{uses='grp'}/ii:l\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj {namespace urn:jj;prefix jj;import grp {prefix g;}"
"uses g:grp {refine c/x {presence nonsence;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid refine of leaf node - it is not possible to replace \"presence\" property.", "/jj:{uses='g:grp'}/jj:c/x/{refine='c/x'}");
+ CHECK_LOG_CTX("Invalid refine of leaf node - it is not possible to replace \"presence\" property.",
+ "Path \"/jj:{uses='g:grp'}/jj:c/x/{refine='c/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk {namespace urn:kk;prefix kk;import grp {prefix g;}"
"uses g:grp {refine c/ch {must 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid refine of choice node - it is not possible to add \"must\" property.", "/kk:{uses='g:grp'}/kk:c/ch/{refine='c/ch'}");
+ CHECK_LOG_CTX("Invalid refine of choice node - it is not possible to add \"must\" property.",
+ "Path \"/kk:{uses='g:grp'}/kk:c/ch/{refine='c/ch'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ll {namespace urn:ll;prefix ll;import grp {prefix g;}"
"uses g:grp {refine c/x {min-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid refine of leaf node - it is not possible to replace \"min-elements\" property.", "/ll:{uses='g:grp'}/ll:c/x/{refine='c/x'}");
+ CHECK_LOG_CTX("Invalid refine of leaf node - it is not possible to replace \"min-elements\" property.",
+ "Path \"/ll:{uses='g:grp'}/ll:c/x/{refine='c/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm {namespace urn:mm;prefix mm;import grp {prefix g;}"
"uses g:grp {refine c/ll {min-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/mm:{uses='g:grp'}/mm:c/ll");
- CHECK_LOG_CTX("The default statement is present on leaf-list with a nonzero min-elements.", "/mm:{uses='g:grp'}/mm:c/ll");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/mm:{uses='g:grp'}/mm:c/ll\".");
+ CHECK_LOG_CTX("The default statement is present on leaf-list with a nonzero min-elements.", "Path \"/mm:{uses='g:grp'}/mm:c/ll\".");
}
static void
@@ -2861,41 +2842,41 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; container c {leaf a {type string;}}"
"augment /x/ {leaf a {type int8;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid absolute-schema-nodeid value \"/x/\" - unexpected end of expression.", "/aa:{augment='/x/'}");
+ CHECK_LOG_CTX("Invalid absolute-schema-nodeid value \"/x/\" - unexpected end of expression.", "Path \"/aa:{augment='/x/'}\".");
assert_int_equal(LY_ENOTFOUND, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa; container c {leaf a {type string;}}"
"augment /x {leaf a {type int8;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Augment target node \"/x\" from module \"aa\" was not found.", "/aa:{augment='/x'}");
+ CHECK_LOG_CTX("Augment target node \"/x\" from module \"aa\" was not found.", "Path \"/aa:{augment='/x'}\".");
assert_int_equal(LY_EEXIST, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb; container c {leaf a {type string;}}"
"augment /c {leaf a {type int8;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "/bb:{augment='/c'}/a");
+ CHECK_LOG_CTX("Duplicate identifier \"a\" of data definition/RPC/action/notification statement.", "Path \"/bb:{augment='/c'}/a\".");
assert_int_equal(LY_ENOTFOUND, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc; container c {leaf a {type string;}}"
"augment /c/a {leaf a {type int8;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Augment target node \"/c/a\" from module \"cc\" was not found.", "/cc:{augment='/c/a'}");
+ CHECK_LOG_CTX("Augment target node \"/c/a\" from module \"cc\" was not found.", "Path \"/cc:{augment='/c/a'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd; container c {leaf a {type string;}}"
"augment /c {case b {leaf d {type int8;}}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid augment of container node which is not allowed to contain case node \"b\".", "/dd:{augment='/c'}");
+ CHECK_LOG_CTX("Invalid augment of container node which is not allowed to contain case node \"b\".", "Path \"/dd:{augment='/c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee; import himp {prefix hi;}"
"augment /hi:top {container c {leaf d {mandatory true; type int8;}}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid augment adding mandatory node \"c\" without making it conditional via when statement.", "/ee:{augment='/hi:top'}");
+ CHECK_LOG_CTX("Invalid augment adding mandatory node \"c\" without making it conditional via when statement.", "Path \"/ee:{augment='/hi:top'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff; container top;"
"augment ../top {leaf x {type int8;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid absolute-schema-nodeid value \"../top\" - \"/\" expected instead of \"..\".", "/ff:{augment='../top'}");
+ CHECK_LOG_CTX("Invalid absolute-schema-nodeid value \"../top\" - \"/\" expected instead of \"..\".", "Path \"/ff:{augment='../top'}\".");
assert_int_equal(LY_ENOTFOUND, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg; rpc func;"
"augment /func {leaf x {type int8;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Augment target node \"/func\" from module \"gg\" was not found.", "/gg:{augment='/func'}");
+ CHECK_LOG_CTX("Augment target node \"/func\" from module \"gg\" was not found.", "Path \"/gg:{augment='/func'}\".");
assert_int_equal(LY_ENOTFOUND, lys_parse_mem(UTEST_LYCTX, "module hh {namespace urn:hh;prefix hh;import himp {prefix hi;}"
"augment /hi:func/input {leaf x {type string;}}"
"augment /hi:func/output {leaf y {type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Augment target node \"/hi:func/input\" from module \"hh\" was not found.", "/hh:{augment='/hi:func/input'}");
- CHECK_LOG_CTX("Augment target node \"/hi:func/output\" from module \"hh\" was not found.", "/hh:{augment='/hi:func/output'}");
+ CHECK_LOG_CTX("Augment target node \"/hi:func/input\" from module \"hh\" was not found.", "Path \"/hh:{augment='/hi:func/input'}\".");
+ CHECK_LOG_CTX("Augment target node \"/hi:func/output\" from module \"hh\" was not found.", "Path \"/hh:{augment='/hi:func/output'}\".");
}
static void
@@ -3351,194 +3332,202 @@
assert_int_equal(LY_ENOTFOUND, lys_parse_mem(UTEST_LYCTX, "module aa1 {namespace urn:aa1;prefix aa1;import a {prefix a;}"
"deviation /a:top/a:z {deviate not-supported;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Deviation(s) target node \"/a:top/a:z\" from module \"aa1\" was not found.", "/a:{deviation='/a:top/a:z'}");
+ CHECK_LOG_CTX("Deviation(s) target node \"/a:top/a:z\" from module \"aa1\" was not found.", "Path \"/a:{deviation='/a:top/a:z'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa2 {namespace urn:aa2;prefix aa2;import a {prefix a;}"
"deviation /a:top/a:a {deviate not-supported;}"
"deviation /a:top/a:a {deviate add {default error;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("Multiple deviations of \"/a:top/a:a\" with one of them being \"not-supported\".", "/aa2:{deviation='/a:top/a:a'}");
+ CHECK_LOG_CTX("Multiple deviations of \"/a:top/a:a\" with one of them being \"not-supported\".", "Path \"/aa2:{deviation='/a:top/a:a'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;import a {prefix a;}"
"deviation a:top/a:a {deviate not-supported;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid absolute-schema-nodeid value \"a:top/a:a\" - \"/\" expected instead of \"a:top\".", "/bb:{deviation='a:top/a:a'}");
+ CHECK_LOG_CTX("Invalid absolute-schema-nodeid value \"a:top/a:a\" - \"/\" expected instead of \"a:top\".", "Path \"/bb:{deviation='a:top/a:a'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc; container c;"
"deviation /c {deviate add {units meters;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to add \"units\" property.", "/cc:{deviation='/c'}");
+ CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to add \"units\" property.", "Path \"/cc:{deviation='/c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cd {namespace urn:cd;prefix cd; leaf c {type string; units centimeters;}"
"deviation /c {deviate add {units meters;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"units\" property which already exists (with value \"centimeters\").", "/cd:{deviation='/c'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"units\" property which already exists (with value \"centimeters\").", "Path \"/cd:{deviation='/c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd1 {namespace urn:dd1;prefix dd1; container c;"
"deviation /c {deviate delete {units meters;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to delete \"units\" property.", "/dd1:{deviation='/c'}");
+ CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to delete \"units\" property.", "Path \"/dd1:{deviation='/c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd2 {namespace urn:dd2;prefix dd2; leaf c {type string;}"
"deviation /c {deviate delete {units meters;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation deleting \"units\" property \"meters\" which is not present.", "/dd2:{deviation='/c'}");
+ CHECK_LOG_CTX("Invalid deviation deleting \"units\" property \"meters\" which is not present.", "Path \"/dd2:{deviation='/c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd3 {namespace urn:dd3;prefix dd3; leaf c {type string; units centimeters;}"
"deviation /c {deviate delete {units meters;}}}", LYS_IN_YANG, &mod));
CHECK_LOG_CTX("Invalid deviation deleting \"units\" property \"meters\" which does not match the target's property value \"centimeters\".",
- "/dd3:{deviation='/c'}");
+ "Path \"/dd3:{deviation='/c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee1 {namespace urn:ee1;prefix ee1; container c;"
"deviation /c {deviate replace {units meters;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to replace \"units\" property.", "/ee1:{deviation='/c'}");
+ CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to replace \"units\" property.", "Path \"/ee1:{deviation='/c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee2 {namespace urn:ee2;prefix ee2; leaf c {type string;}"
"deviation /c {deviate replace {units meters;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation replacing \"units\" property \"meters\" which is not present.", "/ee2:{deviation='/c'}");
+ CHECK_LOG_CTX("Invalid deviation replacing \"units\" property \"meters\" which is not present.", "Path \"/ee2:{deviation='/c'}\".");
/* the default is already deleted in /e:a byt module f */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff1 {namespace urn:ff1;prefix ff1; import e {prefix e;}"
"deviation /e:a {deviate delete {default x:aa;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"x:aa\" which is not present.", "/ff1:{deviation='/e:a'}");
+ CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"x:aa\" which is not present.", "Path \"/ff1:{deviation='/e:a'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff3 {namespace urn:ff3;prefix ff3; import e {prefix e;}"
"deviation /e:b {deviate delete {default e:b;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"e:b\" which does not match the target's property value \"x:ba\".", "/ff3:{deviation='/e:b'}");
+ CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"e:b\" which does not match the target's property value \"x:ba\".",
+ "Path \"/ff3:{deviation='/e:b'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff5 {namespace urn:ff5;prefix ff5; anyxml a;"
"deviation /a {deviate delete {default x;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of anyxml node - it is not possible to delete \"default\" property.", "/ff5:{deviation='/a'}");
+ CHECK_LOG_CTX("Invalid deviation of anyxml node - it is not possible to delete \"default\" property.", "Path \"/ff5:{deviation='/a'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff6 {namespace urn:ff6;prefix ff6; import e {prefix e;}"
"deviation /e:c {deviate delete {default hi;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"hi\" which does not match the target's property value \"hello\".", "/ff6:{deviation='/e:c'}");
+ CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"hi\" which does not match the target's property value \"hello\".",
+ "Path \"/ff6:{deviation='/e:c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff7 {namespace urn:ff7;prefix ff7; import e {prefix e;}"
"deviation /e:d {deviate delete {default hi;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"hi\" which does not match any of the target's property values.", "/ff7:{deviation='/e:d'}");
+ CHECK_LOG_CTX("Invalid deviation deleting \"default\" property \"hi\" which does not match any of the target's property values.",
+ "Path \"/ff7:{deviation='/e:d'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg1 {namespace urn:gg1;prefix gg1; import e {prefix e;}"
"deviation /e:b {deviate add {default e:a;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"default\" property which already exists (with value \"x:ba\").", "/gg1:{deviation='/e:b'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"default\" property which already exists (with value \"x:ba\").", "Path \"/gg1:{deviation='/e:b'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg2 {namespace urn:gg2;prefix gg2; import e {prefix e;}"
"deviation /e:a {deviate add {default x:a;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/e:a");
- CHECK_LOG_CTX("Default case prefix \"x\" not found in imports of \"gg2\".", "/e:a");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/e:a\".");
+ CHECK_LOG_CTX("Default case prefix \"x\" not found in imports of \"gg2\".", "Path \"/e:a\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg3 {namespace urn:gg3;prefix gg3; import e {prefix e;}"
"deviation /e:a {deviate add {default a;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/e:a");
- CHECK_LOG_CTX("Default case \"a\" not found.", "/e:a");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/e:a\".");
+ CHECK_LOG_CTX("Default case \"a\" not found.", "Path \"/e:a\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg4 {namespace urn:gg4;prefix gg4; import e {prefix e;}"
"deviation /e:c {deviate add {default hi;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"default\" property which already exists (with value \"hello\").", "/gg4:{deviation='/e:c'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"default\" property which already exists (with value \"hello\").", "Path \"/gg4:{deviation='/e:c'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg4 {namespace urn:gg4;prefix gg4; import e {prefix e;}"
"deviation /e:a {deviate add {default e:ac;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/e:a");
- CHECK_LOG_CTX("Mandatory node \"ac\" under the default case \"e:ac\".", "/e:a");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/e:a\".");
+ CHECK_LOG_CTX("Mandatory node \"ac\" under the default case \"e:ac\".", "Path \"/e:a\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg5 {namespace urn:gg5;prefix gg5; leaf x {type string; mandatory true;}"
"deviation /x {deviate add {default error;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/gg5:{deviation='/x'}");
- CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "/gg5:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/gg5:{deviation='/x'}\".");
+ CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "Path \"/gg5:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module hh1 {yang-version 1.1; namespace urn:hh1;prefix hh1; import e {prefix e;}"
"deviation /e:d {deviate replace {default hi;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of leaf-list node - it is not possible to replace \"default\" property.", "/hh1:{deviation='/e:d'}");
+ CHECK_LOG_CTX("Invalid deviation of leaf-list node - it is not possible to replace \"default\" property.",
+ "Path \"/hh1:{deviation='/e:d'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii1 {namespace urn:ii1;prefix ii1; import i {prefix i;}"
"deviation /i:l1 {deviate delete {unique x;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation deleting \"unique\" property \"x\" which does not match any of the target's property values.", "/ii1:{deviation='/i:l1'}");
+ CHECK_LOG_CTX("Invalid deviation deleting \"unique\" property \"x\" which does not match any of the target's property values.",
+ "Path \"/ii1:{deviation='/i:l1'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii2 {namespace urn:ii2;prefix ii2; import i {prefix i;} leaf x { type string;}"
"deviation /i:l2 {deviate delete {unique d;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation deleting \"unique\" property \"d\" which does not match any of the target's property values.", "/ii2:{deviation='/i:l2'}");
+ CHECK_LOG_CTX("Invalid deviation deleting \"unique\" property \"d\" which does not match any of the target's property values.",
+ "Path \"/ii2:{deviation='/i:l2'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii3 {namespace urn:ii3;prefix ii3; leaf x { type string;}"
"deviation /x {deviate delete {unique d;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of leaf node - it is not possible to delete \"unique\" property.", "/ii3:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation of leaf node - it is not possible to delete \"unique\" property.", "Path \"/ii3:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ii4 {namespace urn:ii4;prefix ii4; leaf x { type string;}"
"deviation /x {deviate add {unique d;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of leaf node - it is not possible to add \"unique\" property.", "/ii4:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation of leaf node - it is not possible to add \"unique\" property.", "Path \"/ii4:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj1 {namespace urn:jj1;prefix jj1; choice ch {case a {leaf a{type string;}}}"
"deviation /ch/a {deviate add {config false;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of case node - it is not possible to add \"config\" property.", "/jj1:{deviation='/ch/a'}");
+ CHECK_LOG_CTX("Invalid deviation of case node - it is not possible to add \"config\" property.", "Path \"/jj1:{deviation='/ch/a'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj2 {namespace urn:jj2;prefix jj2; container top {config false; leaf x {type string;}}"
"deviation /top/x {deviate add {config true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/jj2:{deviation='/top/x'}");
- CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "/jj2:{deviation='/top/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/jj2:{deviation='/top/x'}\".");
+ CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "Path \"/jj2:{deviation='/top/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj3 {namespace urn:jj3;prefix jj3; container top {leaf x {type string;}}"
"deviation /top/x {deviate replace {config false;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation replacing \"config\" property \"config false\" which is not present.", "/jj3:{deviation='/top/x'}");
+ CHECK_LOG_CTX("Invalid deviation replacing \"config\" property \"config false\" which is not present.", "Path \"/jj3:{deviation='/top/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj4 {namespace urn:jj4;prefix jj4; choice ch {case a {leaf a{type string;}}}"
"deviation /ch/a {deviate replace {config false;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of case node - it is not possible to replace \"config\" property.", "/jj4:{deviation='/ch/a'}");
+ CHECK_LOG_CTX("Invalid deviation of case node - it is not possible to replace \"config\" property.", "Path \"/jj4:{deviation='/ch/a'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj5 {namespace urn:jj5;prefix jj5; container top {leaf x {type string; config true;}}"
"deviation /top {deviate add {config false;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/jj5:top");
- CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "/jj5:top/x");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/jj5:top\".");
+ CHECK_LOG_CTX("Configuration node cannot be child of any state data node.", "Path \"/jj5:top/x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module jj6 {namespace urn:jj6;prefix jj6; leaf x {config false; type string;}"
"deviation /x {deviate add {config true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"config\" property which already exists (with value \"config false\").", "/jj6:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"config\" property which already exists (with value \"config false\").",
+ "Path \"/jj6:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk1 {namespace urn:kk1;prefix kk1; container top {leaf a{type string;}}"
"deviation /top {deviate add {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to add \"mandatory\" property.", "/kk1:{deviation='/top'}");
+ CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to add \"mandatory\" property.", "Path \"/kk1:{deviation='/top'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk2 {namespace urn:kk2;prefix kk2; container top {leaf a{type string;}}"
"deviation /top {deviate replace {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to replace \"mandatory\" property.", "/kk2:{deviation='/top'}");
+ CHECK_LOG_CTX("Invalid deviation of container node - it is not possible to replace \"mandatory\" property.", "Path \"/kk2:{deviation='/top'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk3 {namespace urn:kk3;prefix kk3; container top {leaf x {type string;}}"
"deviation /top/x {deviate replace {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation replacing \"mandatory\" property \"mandatory true\" which is not present.", "/kk3:{deviation='/top/x'}");
+ CHECK_LOG_CTX("Invalid deviation replacing \"mandatory\" property \"mandatory true\" which is not present.", "Path \"/kk3:{deviation='/top/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module kk4 {namespace urn:kk4;prefix kk4; leaf x {mandatory true; type string;}"
"deviation /x {deviate add {mandatory false;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"mandatory\" property which already exists (with value \"mandatory true\").", "/kk4:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"mandatory\" property which already exists (with value \"mandatory true\").",
+ "Path \"/kk4:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ll1 {namespace urn:ll1;prefix ll1; leaf x {default test; type string;}"
"deviation /x {deviate add {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/ll1:{deviation='/x'}");
- CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "/ll1:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/ll1:{deviation='/x'}\".");
+ CHECK_LOG_CTX("Invalid mandatory leaf with a default value.", "Path \"/ll1:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ll2 {yang-version 1.1; namespace urn:ll2;prefix ll2; leaf-list x {default test; type string;}"
"deviation /x {deviate add {min-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/ll2:{deviation='/x'}");
- CHECK_LOG_CTX("The default statement is present on leaf-list with a nonzero min-elements.", "/ll2:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/ll2:{deviation='/x'}\".");
+ CHECK_LOG_CTX("The default statement is present on leaf-list with a nonzero min-elements.", "Path \"/ll2:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ll2 {namespace urn:ll2;prefix ll2; choice ch {default a; leaf a {type string;} leaf b {type string;}}"
"deviation /ch {deviate add {mandatory true;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/ll2:ch");
- CHECK_LOG_CTX("Invalid mandatory choice with a default case.", "/ll2:ch");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/ll2:ch\".");
+ CHECK_LOG_CTX("Invalid mandatory choice with a default case.", "Path \"/ll2:ch\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm1 {namespace urn:mm1;prefix mm1; leaf-list x {min-elements 10; type string;}"
"deviation /x {deviate add {max-elements 5;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/mm1:{deviation='/x'}");
- CHECK_LOG_CTX("Leaf-list min-elements 10 is bigger than max-elements 5.", "/mm1:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/mm1:{deviation='/x'}\".");
+ CHECK_LOG_CTX("Leaf-list min-elements 10 is bigger than max-elements 5.", "Path \"/mm1:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm2 {namespace urn:mm2;prefix mm2; leaf-list x {max-elements 10; type string;}"
"deviation /x {deviate add {min-elements 20;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/mm2:{deviation='/x'}");
- CHECK_LOG_CTX("Leaf-list min-elements 20 is bigger than max-elements 10.", "/mm2:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/mm2:{deviation='/x'}\".");
+ CHECK_LOG_CTX("Leaf-list min-elements 20 is bigger than max-elements 10.", "Path \"/mm2:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm3 {namespace urn:mm3;prefix mm3; list x {min-elements 5; max-elements 10; config false;}"
"deviation /x {deviate replace {max-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/mm3:{deviation='/x'}");
- CHECK_LOG_CTX("List min-elements 5 is bigger than max-elements 1.", "/mm3:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/mm3:{deviation='/x'}\".");
+ CHECK_LOG_CTX("List min-elements 5 is bigger than max-elements 1.", "Path \"/mm3:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm4 {namespace urn:mm4;prefix mm4; list x {min-elements 5; max-elements 10; config false;}"
"deviation /x {deviate replace {min-elements 20;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/mm4:{deviation='/x'}");
- CHECK_LOG_CTX("List min-elements 20 is bigger than max-elements 10.", "/mm4:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/mm4:{deviation='/x'}\".");
+ CHECK_LOG_CTX("List min-elements 20 is bigger than max-elements 10.", "Path \"/mm4:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm5 {namespace urn:mm5;prefix mm5; leaf-list x {type string; min-elements 5;}"
"deviation /x {deviate add {min-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"min-elements\" property which already exists (with value \"5\").", "/mm5:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"min-elements\" property which already exists (with value \"5\").", "Path \"/mm5:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm6 {namespace urn:mm6;prefix mm6; list x {config false; min-elements 5;}"
"deviation /x {deviate add {min-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"min-elements\" property which already exists (with value \"5\").", "/mm6:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"min-elements\" property which already exists (with value \"5\").", "Path \"/mm6:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm7 {namespace urn:mm7;prefix mm7; leaf-list x {type string; max-elements 5;}"
"deviation /x {deviate add {max-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"max-elements\" property which already exists (with value \"5\").", "/mm7:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"max-elements\" property which already exists (with value \"5\").", "Path \"/mm7:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm8 {namespace urn:mm8;prefix mm8; list x {config false; max-elements 5;}"
"deviation /x {deviate add {max-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation adding \"max-elements\" property which already exists (with value \"5\").", "/mm8:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation adding \"max-elements\" property which already exists (with value \"5\").", "Path \"/mm8:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm9 {namespace urn:mm9;prefix mm9; leaf-list x {type string;}"
"deviation /x {deviate replace {min-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation replacing \"min-elements\" property which is not present.", "/mm9:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation replacing \"min-elements\" property which is not present.", "Path \"/mm9:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm10 {namespace urn:mm10;prefix mm10; list x {config false;}"
"deviation /x {deviate replace {min-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation replacing \"min-elements\" property which is not present.", "/mm10:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation replacing \"min-elements\" property which is not present.", "Path \"/mm10:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm11 {namespace urn:mm11;prefix mm11; leaf-list x {type string;}"
"deviation /x {deviate replace {max-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation replacing \"max-elements\" property which is not present.", "/mm11:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation replacing \"max-elements\" property which is not present.", "Path \"/mm11:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module mm12 {namespace urn:mm12;prefix mm12; list x {config false; }"
"deviation /x {deviate replace {max-elements 1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation replacing \"max-elements\" property which is not present.", "/mm12:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation replacing \"max-elements\" property which is not present.", "Path \"/mm12:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module nn1 {namespace urn:nn1;prefix nn1; anyxml x;"
"deviation /x {deviate replace {type string;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid deviation of anyxml node - it is not possible to replace \"type\" property.", "/nn1:{deviation='/x'}");
+ CHECK_LOG_CTX("Invalid deviation of anyxml node - it is not possible to replace \"type\" property.", "Path \"/nn1:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module nn2 {namespace urn:nn2;prefix nn2; leaf-list x {type string;}"
"deviation /x {deviate replace {type empty;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "/nn2:{deviation='/x'}");
- CHECK_LOG_CTX("Leaf-list of type \"empty\" is allowed only in YANG 1.1 modules.", "/nn2:{deviation='/x'}");
+ CHECK_LOG_CTX("Compilation of a deviated and/or refined node failed.", "Path \"/nn2:{deviation='/x'}\".");
+ CHECK_LOG_CTX("Leaf-list of type \"empty\" is allowed only in YANG 1.1 modules.", "Path \"/nn2:{deviation='/x'}\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module oo1 {namespace urn:oo1;prefix oo1; leaf x {type uint16; default 300;}"
"deviation /x {deviate replace {type uint8;}}}", LYS_IN_YANG, &mod));
diff --git a/tests/utests/types/bits.c b/tests/utests/types/bits.c
index 3dcdf98..4b39a1e 100644
--- a/tests/utests/types/bits.c
+++ b/tests/utests/types/bits.c
@@ -179,7 +179,7 @@
"leaf port {type my_type {"
" bit ten {position 11;} bit two;}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid bits - position of the item \"ten\" has changed from 10 to 11 in the derived type.", "/TERR_0:port");
+ CHECK_LOG_CTX("Invalid bits - position of the item \"ten\" has changed from 10 to 11 in the derived type.", "Path \"/TERR_0:port\".");
/* add new bit */
schema = MODULE_CREATE_YANG("TERR_1", "typedef my_type{type bits {"
@@ -187,7 +187,7 @@
"leaf port {type my_type {"
" bit ten {position 10;} bit two; bit test;}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid bits - derived type adds new item \"test\".", "/TERR_1:port");
+ CHECK_LOG_CTX("Invalid bits - derived type adds new item \"test\".", "Path \"/TERR_1:port\".");
/* different max value => autoadd index */
schema = MODULE_CREATE_YANG("TERR_2", "leaf port {type bits {"
@@ -203,7 +203,7 @@
"}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid bits - it is not possible to auto-assign bit position for \"second\" since the highest value is already 4294967295.",
- "/TERR_3:port");
+ "Path \"/TERR_3:port\".");
schema = MODULE_CREATE_YANG("TERR_4", "leaf port {type bits {"
" bit first {position 10;} bit \"\";"
@@ -244,7 +244,7 @@
schema = MODULE_CREATE_YANG("TERR_9", "leaf port {type bits;}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Missing bit substatement for bits type.", "/TERR_9:port");
+ CHECK_LOG_CTX("Missing bit substatement for bits type.", "Path \"/TERR_9:port\".");
/* new features of YANG 1.1 in YANG 1.0 */
schema = "module TERR_10 {"
@@ -267,7 +267,7 @@
" leaf l {type mytype {bit one;}}"
"}";
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Bits type can be subtyped only in YANG 1.1 modules.", "/TERR_11:l");
+ CHECK_LOG_CTX("Bits type can be subtyped only in YANG 1.1 modules.", "Path \"/TERR_11:l\".");
/* feature is not present */
schema = MODULE_CREATE_YANG("IF_0", "feature f;"
@@ -415,7 +415,7 @@
" <bit name=\"ten\"> <position value=\"11\"/> </bit> <bit name=\"two\"/>"
"</type></leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid bits - position of the item \"ten\" has changed from 10 to 11 in the derived type.", "/TERR_0:port");
+ CHECK_LOG_CTX("Invalid bits - position of the item \"ten\" has changed from 10 to 11 in the derived type.", "Path \"/TERR_0:port\".");
/* add new bit */
schema = MODULE_CREATE_YIN("TERR_1",
@@ -431,7 +431,7 @@
" <bit name=\"test\"/>"
"</type></leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid bits - derived type adds new item \"test\".", "/TERR_1:port");
+ CHECK_LOG_CTX("Invalid bits - derived type adds new item \"test\".", "Path \"/TERR_1:port\".");
/* different max value => autoadd index */
schema = MODULE_CREATE_YIN("TERR_2",
@@ -451,7 +451,7 @@
"</type></leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid bits - it is not possible to auto-assign bit position for \"second\" since the highest value is already 4294967295.",
- "/TERR_3:port");
+ "Path \"/TERR_3:port\".");
schema = MODULE_CREATE_YIN("TERR_4",
"<leaf name=\"port\"> <type name=\"bits\">"
diff --git a/tests/utests/types/int8.c b/tests/utests/types/int8.c
index 5259eca..14b1852 100644
--- a/tests/utests/types/int8.c
+++ b/tests/utests/types/int8.c
@@ -240,22 +240,22 @@
/* TEST ERROR -60 .. 0 | 0 .. 127 */
schema = MODULE_CREATE_YANG("ERR0", "leaf port {type int8 {range \"-60 .. 0 | 0 .. 127\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EEXIST);
- CHECK_LOG_CTX("Invalid range restriction - values are not in ascending order (0).", "/ERR0:port");
+ CHECK_LOG_CTX("Invalid range restriction - values are not in ascending order (0).", "Path \"/ERR0:port\".");
/* TEST ERROR 0 .. 128 */
schema = MODULE_CREATE_YANG("ERR1", "leaf port {type int8 {range \"0 .. 128\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid range restriction - value \"128\" does not fit the type limitations.", "/ERR1:port");
+ CHECK_LOG_CTX("Invalid range restriction - value \"128\" does not fit the type limitations.", "Path \"/ERR1:port\".");
/* TEST ERROR -129 .. 126 */
schema = MODULE_CREATE_YANG("ERR2", "leaf port {type int8 {range \"-129 .. 0\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid range restriction - value \"-129\" does not fit the type limitations.", "/ERR2:port");
+ CHECK_LOG_CTX("Invalid range restriction - value \"-129\" does not fit the type limitations.", "Path \"/ERR2:port\".");
/* TEST ERROR 0 */
schema = MODULE_CREATE_YANG("ERR3", "leaf port {type int8 {range \"-129\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid range restriction - value \"-129\" does not fit the type limitations.", "/ERR3:port");
+ CHECK_LOG_CTX("Invalid range restriction - value \"-129\" does not fit the type limitations.", "Path \"/ERR3:port\".");
/*
* TEST MODULE SUBTYPE
@@ -374,7 +374,7 @@
"leaf my_leaf {type my_int_type {range \"min .. max\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid range restriction - the derived restriction (min .. max) is not equally or more limiting.",
- "/TS_ERR0:my_leaf");
+ "Path \"/TS_ERR0:my_leaf\".");
/* TEST SUBTYPE ERROR -80 .. 80 */
schema = MODULE_CREATE_YANG("TS_ERR1",
@@ -382,7 +382,7 @@
" leaf my_leaf {type my_int_type {range \"-80 .. 80\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid range restriction - the derived restriction (-80 .. 80) is not equally or more limiting.",
- "/TS_ERR1:my_leaf");
+ "Path \"/TS_ERR1:my_leaf\".");
/* TEST SUBTYPE ERROR 0 .. max */
schema = MODULE_CREATE_YANG("TS_ERR2",
@@ -390,7 +390,7 @@
"leaf my_leaf {type my_int_type {range \"0 .. max\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid range restriction - the derived restriction (0 .. max) is not equally or more limiting.",
- "/TS_ERR2:my_leaf");
+ "Path \"/TS_ERR2:my_leaf\".");
/* TEST SUBTYPE ERROR -2 .. 2 */
schema = MODULE_CREATE_YANG("TS_ERR3",
@@ -398,7 +398,7 @@
"leaf my_leaf {type my_int_type {range \"-2 .. 2\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid range restriction - the derived restriction (-2 .. 2) is not equally or more limiting.",
- "/TS_ERR3:my_leaf");
+ "Path \"/TS_ERR3:my_leaf\".");
/* TEST SUBTYPE ERROR -2 .. 2 */
schema = MODULE_CREATE_YANG("TS_ERR4",
@@ -406,7 +406,7 @@
"leaf my_leaf {type my_int_type {range \"-100 .. -90 | 100 .. 128\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EDENIED);
CHECK_LOG_CTX("Invalid range restriction - value \"128\" does not fit the type limitations.",
- "/TS_ERR4:my_leaf");
+ "Path \"/TS_ERR4:my_leaf\".");
/*
* TEST DEFAULT VALUE
@@ -745,7 +745,7 @@
" <type name=\"int8\"> <range value = \"min .. 0 | 0 .. 12\"/> </type>"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EEXIST);
- CHECK_LOG_CTX("Invalid range restriction - values are not in ascending order (0).", "/TE0:port");
+ CHECK_LOG_CTX("Invalid range restriction - values are not in ascending order (0).", "Path \"/TE0:port\".");
/* TEST ERROR 0 .. 128 */
schema = MODULE_CREATE_YIN("TE1",
@@ -753,7 +753,7 @@
" <type name=\"int8\"> <range value = \"0 .. 128\"/> </type>"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid range restriction - value \"128\" does not fit the type limitations.", "/TE1:port");
+ CHECK_LOG_CTX("Invalid range restriction - value \"128\" does not fit the type limitations.", "Path \"/TE1:port\".");
/* TEST ERROR -129 .. 126 */
schema = MODULE_CREATE_YIN("TE2",
@@ -761,7 +761,7 @@
" <type name=\"int8\"> <range value =\"-129 .. 126\"/> </type>"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid range restriction - value \"-129\" does not fit the type limitations.", "/TE2:port");
+ CHECK_LOG_CTX("Invalid range restriction - value \"-129\" does not fit the type limitations.", "Path \"/TE2:port\".");
/* TEST YIN */
schema = MODULE_CREATE_YIN("TS0",
@@ -817,7 +817,7 @@
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid range restriction - the derived restriction (min .. max) is not equally or more limiting.",
- "/TS_ERR1:port");
+ "Path \"/TS_ERR1:port\".");
/* TEST ERROR */
schema = MODULE_CREATE_YIN("TS_ERR2",
@@ -829,7 +829,7 @@
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid range restriction - the derived restriction (5 .. 11) is not equally or more limiting.",
- "/TS_ERR2:port");
+ "Path \"/TS_ERR2:port\".");
/* TEST DEFAULT VALUE */
schema = MODULE_CREATE_YIN("DF0",
diff --git a/tests/utests/types/string.c b/tests/utests/types/string.c
index c110321..a64a552 100644
--- a/tests/utests/types/string.c
+++ b/tests/utests/types/string.c
@@ -200,15 +200,15 @@
/* ERROR TESTS NEGATIVE VALUE */
schema = MODULE_CREATE_YANG("ERR0", "leaf port {type string {length \"-1 .. 20\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "/ERR0:port");
+ CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "Path \"/ERR0:port\".");
schema = MODULE_CREATE_YANG("ERR1", "leaf port {type string {length \"100 .. 18446744073709551616\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid length restriction - invalid value \"18446744073709551616\".", "/ERR1:port");
+ CHECK_LOG_CTX("Invalid length restriction - invalid value \"18446744073709551616\".", "Path \"/ERR1:port\".");
schema = MODULE_CREATE_YANG("ERR2", "leaf port {type string {length \"10 .. 20 | 20 .. 30\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EEXIST);
- CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (20).", "/ERR2:port");
+ CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (20).", "Path \"/ERR2:port\".");
schema = MODULE_CREATE_YANG("ERR3",
"typedef my_type {"
@@ -216,7 +216,7 @@
"}"
"leaf port {type my_type {length \"-1 .. 15\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "/ERR3:port");
+ CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "Path \"/ERR3:port\".");
/*
* PATTERN
@@ -286,7 +286,7 @@
"}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Regular expression \"[a-zA-Z_[a-zA-Z0-9\\-_.*\" is not valid (\"\": missing terminating ] for character class).",
- "/TPATTERN_ERR_0:port");
+ "Path \"/TPATTERN_ERR_0:port\".");
schema = MODULE_CREATE_YANG("TDEFAULT_0",
"typedef my_type {"
@@ -323,14 +323,14 @@
"}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Regular expression \"\\[a]b\" is not valid (\"]b\": character group doesn't begin with '[').",
- "/TPATTERN_BC_ERR_1:port");
+ "Path \"/TPATTERN_BC_ERR_1:port\".");
schema = MODULE_CREATE_YANG("TPATTERN_BC_ERR_2", "leaf port {type string {"
"pattern \"\\\\[a]b\";" /* pattern "\\[a]b"; */
"}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Regular expression \"\\[a]b\" is not valid (\"]b\": character group doesn't begin with '[').",
- "/TPATTERN_BC_ERR_2:port");
+ "Path \"/TPATTERN_BC_ERR_2:port\".");
/* PATTERN AND LENGTH */
schema = MODULE_CREATE_YANG("TPL_0",
@@ -467,26 +467,26 @@
schema = MODULE_CREATE_YIN("ERR0", "<leaf name=\"port\"> <type name=\"string\">"
"<length value =\"-1 .. 20\"/> </type></leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "/ERR0:port");
+ CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "Path \"/ERR0:port\".");
schema = MODULE_CREATE_YIN("ERR1", "<leaf name=\"port\"> <type name=\"string\">"
"<length value=\"100 .. 18446744073709551616\"/>"
"</type> </leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid length restriction - invalid value \"18446744073709551616\".", "/ERR1:port");
+ CHECK_LOG_CTX("Invalid length restriction - invalid value \"18446744073709551616\".", "Path \"/ERR1:port\".");
schema = MODULE_CREATE_YIN("ERR2", "<leaf name=\"port\">"
"<type name=\"string\"> <length value=\"10 .. 20 | 20 .. 30\"/>"
"</type> </leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EEXIST);
- CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (20).", "/ERR2:port");
+ CHECK_LOG_CTX("Invalid length restriction - values are not in ascending order (20).", "Path \"/ERR2:port\".");
schema = MODULE_CREATE_YIN("ERR3",
"<typedef name=\"my_type\"> <type name=\"string\"/> </typedef>"
"<leaf name=\"port\"> <type name=\"my_type\"> <length value=\"-1 .. 15\"/>"
"</type> </leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EDENIED);
- CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "/ERR3:port");
+ CHECK_LOG_CTX("Invalid length restriction - value \"-1\" does not fit the type limitations.", "Path \"/ERR3:port\".");
/*
* PATTERN
@@ -557,7 +557,7 @@
"</type> </leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
CHECK_LOG_CTX("Regular expression \"[a-zA-Z_][a-zA-Z0-9\\-_.*\" is not valid (\"\": missing terminating ] for character class).",
- "/TPATTERN_ERR_0:port");
+ "Path \"/TPATTERN_ERR_0:port\".");
/*
* DEFAUT VALUE