log CHANGE message improvements
diff --git a/src/log.c b/src/log.c
index b8f9f18..68de781 100644
--- a/src/log.c
+++ b/src/log.c
@@ -547,7 +547,7 @@
str = lysc_path(log_location.scnodes.objs[log_location.scnodes.count - 1], LYSC_PATH_LOG, NULL, 0);
LY_CHECK_ERR_RET(!str, LOGMEM(ctx), LY_EMEM);
- rc = asprintf(path, "Schema location %s", str);
+ rc = asprintf(path, "Schema location \"%s\"", str);
free(str);
LY_CHECK_ERR_RET(rc == -1, LOGMEM(ctx), LY_EMEM);
}
@@ -556,7 +556,7 @@
str = lyd_path(log_location.dnodes.objs[log_location.dnodes.count - 1], LYD_PATH_STD, NULL, 0);
LY_CHECK_ERR_RET(!str, LOGMEM(ctx), LY_EMEM);
- rc = asprintf(path, "%s%sata location %s", prev ? prev : "", prev ? ", d" : "D", str);
+ rc = asprintf(path, "%s%sata location \"%s\"", prev ? prev : "", prev ? ", d" : "D", str);
free(str);
free(prev);
LY_CHECK_ERR_RET(rc == -1, LOGMEM(ctx), LY_EMEM);
diff --git a/src/plugins_types.c b/src/plugins_types.c
index 9dbecab..d31f459 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -330,16 +330,18 @@
for ( ; value_len && isspace(*value); ++value, --value_len) {}
if (!value || !value_len || !value[0]) {
- return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid empty %s value.", datatype);
+ return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid type %s empty value.", datatype);
}
switch (ly_parse_int(value, value_len, min, max, base, ret)) {
case LY_EDENIED:
- return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Value is out of %s's min/max bounds.", datatype);
+ return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL,
+ "Value \"%.*s\" is out of type %s min/max bounds.", (int)value_len, value, datatype);
case LY_SUCCESS:
return LY_SUCCESS;
default:
- return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid %s value \"%.*s\".", datatype, (int)value_len, value);
+ return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL,
+ "Invalid type %s value \"%.*s\".", datatype, (int)value_len, value);
}
}
@@ -355,19 +357,19 @@
for ( ; value_len && isspace(*value); ++value, --value_len) {}
if (!value || !value_len || !value[0]) {
- return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid empty %s value.", datatype);
+ return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid type %s empty value.", datatype);
}
*err = NULL;
switch (ly_parse_uint(value, value_len, max, base, ret)) {
case LY_EDENIED:
return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL,
- "Value \"%.*s\" is out of %s's min/max bounds.", (int)value_len, value, datatype);
+ "Value \"%.*s\" is out of type %s min/max bounds.", (int)value_len, value, datatype);
case LY_SUCCESS:
return LY_SUCCESS;
default:
return ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL,
- "Invalid %s value \"%.*s\".", datatype, (int)value_len, value);
+ "Invalid type %s value \"%.*s\".", datatype, (int)value_len, value);
}
}
diff --git a/src/tree_data_common.c b/src/tree_data_common.c
index e023c54..f732cd2 100644
--- a/src/tree_data_common.c
+++ b/src/tree_data_common.c
@@ -765,8 +765,8 @@
if (!parent || strcmp(opaq->name.module_ns, parent->schema->module->ns)) {
mod = ly_ctx_get_module_implemented_ns(ctx, opaq->name.module_ns);
if (!mod) {
- LOGVAL(ctx, LYVE_REFERENCE, "No (implemented) module with namespace \"%s\" in the context.",
- opaq->name.module_ns);
+ 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;
}
} else {
@@ -779,7 +779,8 @@
if (!parent || strcmp(opaq->name.module_name, parent->schema->module->name)) {
mod = ly_ctx_get_module_implemented(ctx, opaq->name.module_name);
if (!mod) {
- LOGVAL(ctx, LYVE_REFERENCE, "No (implemented) module named \"%s\" in the context.", opaq->name.module_name);
+ 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;
}
} else {
diff --git a/tests/utests/data/test_new.c b/tests/utests/data/test_new.c
index 4ebc92f..b55172f 100644
--- a/tests/utests/data/test_new.c
+++ b/tests/utests/data/test_new.c
@@ -105,13 +105,13 @@
lyd_free_tree(node);
assert_int_equal(lyd_new_list2(NULL, mod, "l1", "[]", 0, &node), LY_EVALID);
- CHECK_LOG_CTX("Unexpected XPath token \"]\" (\"]\").", "Schema location /a:l1.");
+ CHECK_LOG_CTX("Unexpected XPath token \"]\" (\"]\").", "Schema location \"/a:l1\".");
assert_int_equal(lyd_new_list2(NULL, mod, "l1", "[key1='a'][key2='b']", 0, &node), LY_ENOTFOUND);
- CHECK_LOG_CTX("Not found node \"key1\" in path.", "Schema location /a:l1.");
+ CHECK_LOG_CTX("Not found node \"key1\" in path.", "Schema location \"/a:l1\".");
assert_int_equal(lyd_new_list2(NULL, mod, "l1", "[a='a'][b='b'][c='c']", 0, &node), LY_EVALID);
- CHECK_LOG_CTX("Key expected instead of leaf \"c\" in path.", "Schema location /a:l1.");
+ CHECK_LOG_CTX("Key expected instead of leaf \"c\" in path.", "Schema location \"/a:l1\".");
assert_int_equal(lyd_new_list2(NULL, mod, "c", "[a='a'][b='b']", 0, &node), LY_ENOTFOUND);
CHECK_LOG_CTX("List node \"c\" not found.", NULL);
@@ -130,7 +130,7 @@
/* leaf */
assert_int_equal(lyd_new_term(NULL, mod, "foo", "[a='a'][b='b'][c='c']", 0, &node), LY_EVALID);
- CHECK_LOG_CTX("Invalid uint16 value \"[a='a'][b='b'][c='c']\".", "Schema location /a:foo.");
+ CHECK_LOG_CTX("Invalid type uint16 value \"[a='a'][b='b'][c='c']\".", "Schema location \"/a:foo\".");
assert_int_equal(lyd_new_term(NULL, mod, "c", "value", 0, &node), LY_ENOTFOUND);
CHECK_LOG_CTX("Term node \"c\" not found.", NULL);
@@ -158,7 +158,7 @@
/* key-less list */
assert_int_equal(lyd_new_list2(NULL, mod, "l2", "[a='a'][b='b']", 0, &node), LY_EVALID);
- CHECK_LOG_CTX("List predicate defined for keyless list \"l2\" in path.", "Schema location /a:l2.");
+ CHECK_LOG_CTX("List predicate defined for keyless list \"l2\" in path.", "Schema location \"/a:l2\".");
assert_int_equal(lyd_new_list2(NULL, mod, "l2", "", 0, &node), LY_SUCCESS);
lyd_free_tree(node);
@@ -242,7 +242,7 @@
/* try LYD_NEWOPT_OPAQ */
ret = lyd_new_path2(NULL, UTEST_LYCTX, "/a:l1", NULL, 0, 0, 0, NULL, NULL);
assert_int_equal(ret, LY_EINVAL);
- CHECK_LOG_CTX("Predicate missing for list \"l1\" in path \"/a:l1\".", "Schema location /a:l1.");
+ CHECK_LOG_CTX("Predicate missing for list \"l1\" in path \"/a:l1\".", "Schema location \"/a:l1\".");
ret = lyd_new_path2(NULL, UTEST_LYCTX, "/a:l1", NULL, 0, 0, LYD_NEW_PATH_OPAQ, NULL, &root);
assert_int_equal(ret, LY_SUCCESS);
@@ -253,7 +253,7 @@
ret = lyd_new_path2(NULL, UTEST_LYCTX, "/a:foo", NULL, 0, 0, 0, NULL, NULL);
assert_int_equal(ret, LY_EVALID);
- CHECK_LOG_CTX("Invalid empty uint16 value.", "Schema location /a:foo.");
+ CHECK_LOG_CTX("Invalid type uint16 empty value.", "Schema location \"/a:foo\".");
ret = lyd_new_path2(NULL, UTEST_LYCTX, "/a:foo", NULL, 0, 0, LYD_NEW_PATH_OPAQ, NULL, &root);
assert_int_equal(ret, LY_SUCCESS);
diff --git a/tests/utests/data/test_parser_json.c b/tests/utests/data/test_parser_json.c
index 2d53ce6..4fdc1bf 100644
--- a/tests/utests/data/test_parser_json.c
+++ b/tests/utests/data/test_parser_json.c
@@ -137,15 +137,16 @@
lyd_free_all(tree);
PARSER_CHECK_ERROR(data, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Unknown (or not implemented) YANG module \"x\" of metadata \"x:xxx\".", "Data location /@a:foo, line number 1.");
+ "Unknown (or not implemented) YANG module \"x\" of metadata \"x:xxx\".", "Data location \"/@a:foo\", line number 1.");
/* missing referenced metadata node */
PARSER_CHECK_ERROR("{\"@a:foo\" : { \"a:hint\" : 1 }}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Missing JSON data instance to be coupled with @a:foo metadata.", "Data location /@a:foo, line number 1.");
+ "Missing JSON data instance to be coupled with @a:foo metadata.", "Data location \"/@a:foo\", line number 1.");
/* missing namespace for meatadata*/
PARSER_CHECK_ERROR("{\"a:foo\" : \"value\", \"@a:foo\" : { \"hint\" : 1 }}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Metadata in JSON must be namespace-qualified, missing prefix for \"hint\".", "Schema location /a:foo, line number 1.");
+ "Metadata in JSON must be namespace-qualified, missing prefix for \"hint\".",
+ "Schema location \"/a:foo\", line number 1.");
/* reverse solidus in JSON object member name */
data = "{\"@a:foo\":{\"a:hi\\nt\":1},\"a:foo\":\"xxx\"}";
@@ -238,13 +239,14 @@
/* missing referenced metadata node */
PARSER_CHECK_ERROR("{\"@a:ll1\":[{\"a:hint\":1}]}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Missing JSON data instance to be coupled with @a:ll1 metadata.", "Data location /@a:ll1, line number 1.");
+ "Missing JSON data instance to be coupled with @a:ll1 metadata.", "Data location \"/@a:ll1\", line number 1.");
PARSER_CHECK_ERROR("{\"a:ll1\":[1],\"@a:ll1\":[{\"a:hint\":1},{\"a:hint\":2}]}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Missing JSON data instance #2 of a:ll1 to be coupled with metadata.", "Schema location /a:ll1, line number 1.");
+ "Missing JSON data instance #2 of a:ll1 to be coupled with metadata.", "Schema location \"/a:ll1\", line number 1.");
PARSER_CHECK_ERROR("{\"@a:ll1\":[{\"a:hint\":1},{\"a:hint\":2},{\"a:hint\":3}],\"a:ll1\" : [1, 2]}", 0, LYD_VALIDATE_PRESENT,
- tree, LY_EVALID, "Missing JSON data instance #3 to be coupled with @a:ll1 metadata.", "Data location /@a:ll1, line number 1.");
+ tree, LY_EVALID, "Missing JSON data instance #3 to be coupled with @a:ll1 metadata.",
+ "Data location \"/@a:ll1\", line number 1.");
}
static void
@@ -388,17 +390,19 @@
/* missing keys */
PARSER_CHECK_ERROR("{ \"a:l1\": [ {\"c\" : 1, \"b\" : \"b\"}]}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"a\".", "Schema location /a:l1, data location /a:l1[b='b'][c='1'], line number 1.");
+ "List instance is missing its key \"a\".",
+ "Schema location \"/a:l1\", data location \"/a:l1[b='b'][c='1']\", line number 1.");
PARSER_CHECK_ERROR("{ \"a:l1\": [ {\"a\" : \"a\"}]}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"b\".", "Schema location /a:l1, data location /a:l1[a='a'], line number 1.");
+ "List instance is missing its key \"b\".", "Schema location \"/a:l1\", data location \"/a:l1[a='a']\", line number 1.");
PARSER_CHECK_ERROR("{ \"a:l1\": [ {\"b\" : \"b\", \"a\" : \"a\"}]}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"c\".", "Schema location /a:l1, data location /a:l1[a='a'][b='b'], line number 1.");
+ "List instance is missing its key \"c\".", "Schema location \"/a:l1\", data location \"/a:l1[a='a'][b='b']\", line number 1.");
/* key duplicate */
PARSER_CHECK_ERROR("{ \"a:l1\": [ {\"c\" : 1, \"b\" : \"b\", \"a\" : \"a\", \"c\" : 1}]}", 0, LYD_VALIDATE_PRESENT,
- tree, LY_EVALID, "Duplicate instance of \"c\".", "Schema location /a:l1/c, data location /a:l1[a='a'][b='b'][c='1'][c='1']/c, line number 1.");
+ tree, LY_EVALID, "Duplicate instance of \"c\".",
+ "Schema location \"/a:l1/c\", data location \"/a:l1[a='a'][b='b'][c='1'][c='1']/c\", line number 1.");
/* keys order, in contrast to XML, JSON accepts keys in any order even in strict mode */
CHECK_PARSE_LYD("{ \"a:l1\": [ {\"d\" : \"d\", \"a\" : \"a\", \"c\" : 1, \"b\" : \"b\"}]}", 0, LYD_VALIDATE_PRESENT, tree);
@@ -495,7 +499,7 @@
/* invalid value, no flags */
data = "{\"a:foo3\":[null]}";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Invalid non-number-encoded uint32 value \"\".", "Schema location /a:foo3, line number 1.");
+ "Invalid non-number-encoded uint32 value \"\".", "Schema location \"/a:foo3\", line number 1.");
/* opaq flag */
CHECK_PARSE_LYD(data, LYD_PARSE_OPAQ | LYD_PARSE_ONLY, 0, tree);
@@ -506,7 +510,8 @@
/* missing key, no flags */
data = "{\"a:l1\":[{\"a\":\"val_a\",\"b\":\"val_b\",\"d\":\"val_d\"}]}";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"c\".", "Schema location /a:l1, data location /a:l1[a='val_a'][b='val_b'], line number 1.");
+ "List instance is missing its key \"c\".",
+ "Schema location \"/a:l1\", data location \"/a:l1[a='val_a'][b='val_b']\", line number 1.");
/* opaq flag */
CHECK_PARSE_LYD(data, LYD_PARSE_OPAQ | LYD_PARSE_ONLY, 0, tree);
@@ -517,7 +522,8 @@
/* invalid key, no flags */
data = "{\"a:l1\":[{\"a\":\"val_a\",\"b\":\"val_b\",\"c\":\"val_c\"}]}";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Invalid non-number-encoded int16 value \"val_c\".", "Schema location /a:l1/c, data location /a:l1[a='val_a'][b='val_b'], line number 1.");
+ "Invalid non-number-encoded int16 value \"val_c\".",
+ "Schema location \"/a:l1/c\", data location \"/a:l1[a='val_a'][b='val_b']\", line number 1.");
/* opaq flag */
CHECK_PARSE_LYD(data, LYD_PARSE_OPAQ | LYD_PARSE_ONLY, 0, tree);
@@ -540,7 +546,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, line number 1.");
+ "Unknown module of node \"@a:foo\".", "Data location \"/@a:foo\", line number 1.");
/* empty name */
PARSER_CHECK_ERROR("{\"@a:foo\":{\"\":0}}", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
diff --git a/tests/utests/data/test_parser_xml.c b/tests/utests/data/test_parser_xml.c
index 8fa4e4d..4e5cc2e 100644
--- a/tests/utests/data/test_parser_xml.c
+++ b/tests/utests/data/test_parser_xml.c
@@ -167,17 +167,18 @@
/* missing keys */
PARSER_CHECK_ERROR("<l1 xmlns=\"urn:tests:a\"><c>1</c><b>b</b></l1>", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"a\".", "Schema location /a:l1, data location /a:l1[b='b'][c='1'], line number 1.");
+ "List instance is missing its key \"a\".", "Schema location \"/a:l1\", data location \"/a:l1[b='b'][c='1']\", line number 1.");
PARSER_CHECK_ERROR("<l1 xmlns=\"urn:tests:a\"><a>a</a></l1>", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"b\".", "Schema location /a:l1, data location /a:l1[a='a'], line number 1.");
+ "List instance is missing its key \"b\".", "Schema location \"/a:l1\", data location \"/a:l1[a='a']\", line number 1.");
PARSER_CHECK_ERROR("<l1 xmlns=\"urn:tests:a\"><b>b</b><a>a</a></l1>", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"c\".", "Schema location /a:l1, data location /a:l1[a='a'][b='b'], line number 1.");
+ "List instance is missing its key \"c\".", "Schema location \"/a:l1\", data location \"/a:l1[a='a'][b='b']\", line number 1.");
/* key duplicate */
PARSER_CHECK_ERROR("<l1 xmlns=\"urn:tests:a\"><c>1</c><b>b</b><a>a</a><c>1</c></l1>", 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Duplicate instance of \"c\".", "Schema location /a:l1/c, data location /a:l1[a='a'][b='b'][c='1'][c='1']/c, line number 1.");
+ "Duplicate instance of \"c\".",
+ "Schema location \"/a:l1/c\", data location \"/a:l1[a='a'][b='b'][c='1'][c='1']/c\", line number 1.");
/* keys order */
CHECK_PARSE_LYD("<l1 xmlns=\"urn:tests:a\"><d>d</d><a>a</a><c>1</c><b>b</b></l1>", 0, LYD_VALIDATE_PRESENT, tree);
@@ -209,7 +210,7 @@
lyd_free_all(tree);
PARSER_CHECK_ERROR(data, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Invalid position of the key \"b\" in a list.", "Schema location /a:l1/b, data location /a:b, line number 1.");
+ "Invalid position of the key \"b\" in a list.", "Schema location \"/a:l1/b\", data location \"/a:b\", line number 1.");
}
static void
@@ -243,7 +244,7 @@
/* invalid value, no flags */
data = "<foo3 xmlns=\"urn:tests:a\"/>";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Invalid empty uint32 value.", "Schema location /a:foo3, line number 1.");
+ "Invalid type uint32 empty value.", "Schema location \"/a:foo3\", line number 1.");
/* opaq flag */
CHECK_PARSE_LYD(data, LYD_PARSE_OPAQ | LYD_PARSE_ONLY, 0, tree);
@@ -265,7 +266,8 @@
" <d>val_d</d>\n"
"</l1>\n";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "List instance is missing its key \"c\".", "Schema location /a:l1, data location /a:l1[a='val_a'][b='val_b'], line number 5.");
+ "List instance is missing its key \"c\".",
+ "Schema location \"/a:l1\", data location \"/a:l1[a='val_a'][b='val_b']\", line number 5.");
/* opaq flag */
CHECK_PARSE_LYD(data, LYD_PARSE_OPAQ | LYD_PARSE_ONLY, 0, tree);
@@ -280,7 +282,8 @@
" <c>val_c</c>\n"
"</l1>\n";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
- "Invalid int16 value \"val_c\".", "Schema location /a:l1/c, data location /a:l1[a='val_a'][b='val_b'], line number 4.");
+ "Invalid type int16 value \"val_c\".",
+ "Schema location \"/a:l1/c\", data location \"/a:l1[a='val_a'][b='val_b']\", line number 4.");
/* opaq flag */
CHECK_PARSE_LYD(data, LYD_PARSE_OPAQ | LYD_PARSE_ONLY, 0, tree);
diff --git a/tests/utests/data/test_validation.c b/tests/utests/data/test_validation.c
index af2459d..c582399 100644
--- a/tests/utests/data/test_validation.c
+++ b/tests/utests/data/test_validation.c
@@ -57,7 +57,7 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
CHECK_PARSE_LYD_PARAM("<c xmlns=\"urn:tests:a\">hey</c>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("When condition \"/cont/b = 'val_b'\" not satisfied.", "Schema location /a:c, data location /a:c.");
+ CHECK_LOG_CTX("When condition \"/cont/b = 'val_b'\" not satisfied.", "Schema location \"/a:c\", data location \"/a:c\".");
LYD_TREE_CREATE("<cont xmlns=\"urn:tests:a\"><b>val_b</b></cont><c xmlns=\"urn:tests:a\">hey</c>", tree);
CHECK_LYSC_NODE(tree->next->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR, 1, "c", 0, LYS_LEAF, 0, 0, NULL, 1);
@@ -105,10 +105,10 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
CHECK_PARSE_LYD_PARAM("<d xmlns=\"urn:tests:a\">hey</d>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("When condition \"../c = 'val_c'\" not satisfied.", "Schema location /a:d, data location /a:d.");
+ CHECK_LOG_CTX("When condition \"../c = 'val_c'\" not satisfied.", "Schema location \"/a:d\", data location \"/a:d\".");
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:a\"><b>hey</b></cont>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("When condition \"../a = 'val_a'\" not satisfied.", "Schema location /a:cont/b, data location /a:cont/b.");
+ CHECK_LOG_CTX("When condition \"../a = 'val_a'\" not satisfied.", "Schema location \"/a:cont/b\", data location \"/a:cont/b\".");
LYD_TREE_CREATE("<c xmlns=\"urn:tests:a\">val_c</c><d xmlns=\"urn:tests:a\">hey</d>", tree);
CHECK_LYSC_NODE(tree->next->next->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR | LYS_MAND_TRUE, 1, "d", 0, LYS_LEAF, 0, 0, NULL, 1);
@@ -154,13 +154,13 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
CHECK_PARSE_LYD_PARAM("<d xmlns=\"urn:tests:b\"/>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX_APPTAG("Mandatory choice \"choic\" data do not exist.", "Schema location /b:choic.", "missing-choice");
+ CHECK_LOG_CTX_APPTAG("Mandatory choice \"choic\" data do not exist.", "Schema location \"/b:choic\".", "missing-choice");
CHECK_PARSE_LYD_PARAM("<l xmlns=\"urn:tests:b\">string</l><d xmlns=\"urn:tests:b\"/>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Mandatory node \"c\" instance does not exist.", "Schema location /b:c.");
+ CHECK_LOG_CTX("Mandatory node \"c\" instance does not exist.", "Schema location \"/b:c\".");
CHECK_PARSE_LYD_PARAM("<a xmlns=\"urn:tests:b\">string</a>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Mandatory node \"c\" instance does not exist.", "Schema location /b:c.");
+ CHECK_LOG_CTX("Mandatory node \"c\" instance does not exist.", "Schema location \"/b:c\".");
LYD_TREE_CREATE("<a xmlns=\"urn:tests:b\">string</a><c xmlns=\"urn:tests:b\">string2</c>", tree);
lyd_free_siblings(tree);
@@ -204,12 +204,12 @@
CHECK_PARSE_LYD_PARAM("<l xmlns=\"urn:tests:c\">mate</l>"
"<d xmlns=\"urn:tests:c\"/>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX_APPTAG("Too few \"l\" instances.", "Schema location /c:choic/b/l.", "too-few-elements");
+ CHECK_LOG_CTX_APPTAG("Too few \"l\" instances.", "Schema location \"/c:choic/b/l\".", "too-few-elements");
CHECK_PARSE_LYD_PARAM("<l xmlns=\"urn:tests:c\">val1</l>"
"<l xmlns=\"urn:tests:c\">val2</l>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX_APPTAG("Too few \"l\" instances.", "Schema location /c:choic/b/l.", "too-few-elements");
+ CHECK_LOG_CTX_APPTAG("Too few \"l\" instances.", "Schema location \"/c:choic/b/l\".", "too-few-elements");
LYD_TREE_CREATE("<l xmlns=\"urn:tests:c\">val1</l>"
"<l xmlns=\"urn:tests:c\">val2</l>"
@@ -225,7 +225,7 @@
"<lt xmlns=\"urn:tests:c\"><k>val4</k></lt>"
"<lt xmlns=\"urn:tests:c\"><k>val5</k></lt>"
"<lt xmlns=\"urn:tests:c\"><k>val6</k></lt>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX_APPTAG("Too many \"lt\" instances.", "Schema location /c:lt, data location /c:lt[k='val5'].",
+ CHECK_LOG_CTX_APPTAG("Too many \"lt\" instances.", "Schema location \"/c:lt\", data location \"/c:lt[k='val5']\".",
"too-many-elements");
}
@@ -314,7 +314,7 @@
" <l1>same</l1>\n"
"</lt>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX_APPTAG("Unique data leaf(s) \"l1\" not satisfied in \"/d:lt[k='val1']\" and \"/d:lt[k='val2']\".",
- "Schema location /d:lt, data location /d:lt[k='val2'].", "data-not-unique");
+ "Schema location \"/d:lt\", data location \"/d:lt[k='val2']\".", "data-not-unique");
/* now try with more instances */
LYD_TREE_CREATE("<lt xmlns=\"urn:tests:d\">\n"
@@ -412,7 +412,7 @@
" <l1>8</l1>\n"
"</lt>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX_APPTAG("Unique data leaf(s) \"l1\" not satisfied in \"/d:lt[k='val7']\" and \"/d:lt[k='val2']\".",
- "Schema location /d:lt, data location /d:lt[k='val2'].", "data-not-unique");
+ "Schema location \"/d:lt\", data location \"/d:lt[k='val2']\".", "data-not-unique");
}
static void
@@ -538,7 +538,7 @@
"</lt2>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX_APPTAG("Unique data leaf(s) \"l3\" not satisfied in \"/d:lt2[k='val2']/lt3[kk='val3']\" and "
"\"/d:lt2[k='val2']/lt3[kk='val1']\".",
- "Schema location /d:lt2/lt3, data location /d:lt2[k='val2']/lt3[kk='val1'].", "data-not-unique");
+ "Schema location \"/d:lt2/lt3\", data location \"/d:lt2[k='val2']/lt3[kk='val1']\".", "data-not-unique");
CHECK_PARSE_LYD_PARAM("<lt2 xmlns=\"urn:tests:d\">\n"
" <k>val1</k>\n"
@@ -576,7 +576,7 @@
" <l4>5</l4>\n"
"</lt2>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX_APPTAG("Unique data leaf(s) \"cont/l2 l4\" not satisfied in \"/d:lt2[k='val4']\" and \"/d:lt2[k='val2']\".",
- "Schema location /d:lt2, data location /d:lt2[k='val2'].", "data-not-unique");
+ "Schema location \"/d:lt2\", data location \"/d:lt2[k='val2']\".", "data-not-unique");
CHECK_PARSE_LYD_PARAM("<lt2 xmlns=\"urn:tests:d\">\n"
" <k>val1</k>\n"
@@ -622,7 +622,7 @@
" <l6>3</l6>\n"
"</lt2>", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX_APPTAG("Unique data leaf(s) \"l5 l6\" not satisfied in \"/d:lt2[k='val5']\" and \"/d:lt2[k='val3']\".",
- "Schema location /d:lt2, data location /d:lt2[k='val3'].", "data-not-unique");
+ "Schema location \"/d:lt2\", data location \"/d:lt2[k='val3']\".", "data-not-unique");
}
static void
@@ -683,28 +683,28 @@
CHECK_PARSE_LYD_PARAM("<d xmlns=\"urn:tests:e\">25</d><d xmlns=\"urn:tests:e\">50</d>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"d\".", "Schema location /e:d, data location /e:d.");
+ CHECK_LOG_CTX("Duplicate instance of \"d\".", "Schema location \"/e:d\", data location \"/e:d\".");
CHECK_PARSE_LYD_PARAM("<lt xmlns=\"urn:tests:e\"><k>A</k></lt>"
"<lt xmlns=\"urn:tests:e\"><k>B</k></lt>"
"<lt xmlns=\"urn:tests:e\"><k>A</k></lt>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"lt\".", "Schema location /e:lt, data location /e:lt[k='A'].");
+ CHECK_LOG_CTX("Duplicate instance of \"lt\".", "Schema location \"/e:lt\", data location \"/e:lt[k='A']\".");
CHECK_PARSE_LYD_PARAM("<ll xmlns=\"urn:tests:e\">A</ll>"
"<ll xmlns=\"urn:tests:e\">B</ll>"
"<ll xmlns=\"urn:tests:e\">B</ll>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"ll\".", "Schema location /e:ll, data location /e:ll[.='B'].");
+ CHECK_LOG_CTX("Duplicate instance of \"ll\".", "Schema location \"/e:ll\", data location \"/e:ll[.='B']\".");
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:e\"></cont><cont xmlns=\"urn:tests:e\"/>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"cont\".", "Schema location /e:cont, data location /e:cont.");
+ CHECK_LOG_CTX("Duplicate instance of \"cont\".", "Schema location \"/e:cont\", data location \"/e:cont\".");
/* same tests again but using hashes */
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:e\"><d>25</d><d>50</d><ll>1</ll><ll>2</ll><ll>3</ll><ll>4</ll></cont>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"d\".", "Schema location /e:cont/d, data location /e:cont/d, line number 1.");
+ CHECK_LOG_CTX("Duplicate instance of \"d\".", "Schema location \"/e:cont/d\", data location \"/e:cont/d\", line number 1.");
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:e\"><ll>1</ll><ll>2</ll><ll>3</ll><ll>4</ll>"
"<lt><k>a</k></lt>"
@@ -713,12 +713,12 @@
"<lt><k>d</k></lt>"
"<lt><k>c</k></lt></cont>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"lt\".", "Schema location /e:cont/lt, data location /e:cont/lt[k='c'], line number 1.");
+ CHECK_LOG_CTX("Duplicate instance of \"lt\".", "Schema location \"/e:cont/lt\", data location \"/e:cont/lt[k='c']\", line number 1.");
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:e\"><ll>1</ll><ll>2</ll><ll>3</ll><ll>4</ll>"
"<ll>a</ll><ll>b</ll><ll>c</ll><ll>d</ll><ll>d</ll></cont>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"ll\".", "Schema location /e:cont/ll, data location /e:cont/ll[.='d'], line number 1.");
+ CHECK_LOG_CTX("Duplicate instance of \"ll\".", "Schema location \"/e:cont/ll\", data location \"/e:cont/ll[.='d']\", line number 1.");
/* cases */
CHECK_PARSE_LYD_PARAM("<l xmlns=\"urn:tests:e\">a</l>"
@@ -726,13 +726,13 @@
"<l xmlns=\"urn:tests:e\">c</l>"
"<l xmlns=\"urn:tests:e\">b</l>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Duplicate instance of \"l\".", "Schema location /e:choic/b/l, data location /e:l[.='b'].");
+ CHECK_LOG_CTX("Duplicate instance of \"l\".", "Schema location \"/e:choic/b/l\", data location \"/e:l[.='b']\".");
CHECK_PARSE_LYD_PARAM("<l xmlns=\"urn:tests:e\">a</l><l xmlns=\"urn:tests:e\">b</l>"
"<l xmlns=\"urn:tests:e\">c</l>"
"<a xmlns=\"urn:tests:e\">aa</a>",
LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Data for both cases \"a\" and \"b\" exist.", "Schema location /e:choic.");
+ CHECK_LOG_CTX("Data for both cases \"a\" and \"b\" exist.", "Schema location \"/e:choic\".");
}
static void
@@ -1053,12 +1053,12 @@
"</cont>\n";
CHECK_PARSE_LYD_PARAM(data, LYD_XML, LYD_PARSE_ONLY | LYD_PARSE_NO_STATE, 0, LY_EVALID, tree);
CHECK_LOG_CTX("Unexpected data state node \"cont2\" found.",
- "Schema location /h:cont/cont2, data location /h:cont, line number 3.");
+ "Schema location \"/h:cont/cont2\", data location \"/h:cont\", line number 3.");
CHECK_PARSE_LYD_PARAM(data, LYD_XML, LYD_PARSE_ONLY, 0, LY_SUCCESS, tree);
assert_int_equal(LY_EVALID, lyd_validate_all(&tree, NULL, LYD_VALIDATE_PRESENT | LYD_VALIDATE_NO_STATE, NULL));
CHECK_LOG_CTX("Unexpected data state node \"cont2\" found.",
- "Schema location /h:cont/cont2, data location /h:cont/cont2.");
+ "Schema location \"/h:cont/cont2\", data location \"/h:cont/cont2\".");
lyd_free_all(tree);
}
@@ -1097,7 +1097,7 @@
" <l2>val</l2>\n"
"</cont>\n", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX_APPTAG("Must condition \"../l = 'right'\" not satisfied.",
- "Schema location /i:cont/l2, data location /i:cont/l2.", "must-violation");
+ "Schema location \"/i:cont/l2\", data location \"/i:cont/l2\".", "must-violation");
LYD_TREE_CREATE("<cont xmlns=\"urn:tests:i\">\n"
" <l>right</l>\n"
@@ -1109,7 +1109,7 @@
" <l>wrong</l>\n"
" <l3>val</l3>\n"
"</cont>\n", LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX_APPTAG("l leaf is not left", "Schema location /i:cont/l3, data location /i:cont/l3.", "not-left");
+ CHECK_LOG_CTX_APPTAG("l leaf is not left", "Schema location \"/i:cont/l3\", data location \"/i:cont/l3\".", "not-left");
}
const char *schema_j =
@@ -1186,7 +1186,7 @@
/* missing leafref */
assert_int_equal(LY_EVALID, lyd_validate_op(op_tree, NULL, LYD_TYPE_RPC_YANG, NULL));
CHECK_LOG_CTX("Invalid leafref value \"target\" - no existing target instance \"/lf3\".",
- "Schema location /j:cont/l1/act/input/lf2, data location /j:cont/l1[k='val1']/act/lf2.");
+ "Schema location \"/j:cont/l1/act/input/lf2\", data location \"/j:cont/l1[k='val1']/act/lf2\".");
ly_in_free(in, 0);
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:j\">\n"
@@ -1198,7 +1198,7 @@
/* input must false */
assert_int_equal(LY_EVALID, lyd_validate_op(op_tree, tree, LYD_TYPE_RPC_YANG, NULL));
CHECK_LOG_CTX("Must condition \"../../lf1 = 'true'\" not satisfied.",
- "Data location /j:cont/l1[k='val1']/act.");
+ "Data location \"/j:cont/l1[k='val1']/act\".");
lyd_free_all(tree);
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:j\">\n"
@@ -1251,7 +1251,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory(data, &in));
assert_int_equal(LY_EVALID, lyd_parse_op(UTEST_LYCTX, NULL, in, LYD_XML, LYD_TYPE_RPC_YANG, &tree, NULL));
CHECK_LOG_CTX("Unsatisfied length - string \"123\" length is not allowed.", "Schema location "
- "/val-str:modify-user-password/input/new-password, data location /val-str:modify-user-password, line number 3.");
+ "\"/val-str:modify-user-password/input/new-password\", data location \"/val-str:modify-user-password\", line number 3.");
ly_in_free(in, 0);
}
@@ -1279,7 +1279,7 @@
/* missing leafref */
assert_int_equal(LY_EVALID, lyd_validate_op(op_tree, NULL, LYD_TYPE_REPLY_YANG, NULL));
CHECK_LOG_CTX("Invalid leafref value \"target\" - no existing target instance \"/lf4\".",
- "Schema location /j:cont/l1/act/output/lf2, data location /j:cont/l1[k='val1']/act/lf2.");
+ "Schema location \"/j:cont/l1/act/output/lf2\", data location \"/j:cont/l1[k='val1']/act/lf2\".");
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:j\">\n"
" <lf1>not true</lf1>\n"
@@ -1289,7 +1289,7 @@
/* input must false */
assert_int_equal(LY_EVALID, lyd_validate_op(op_tree, tree, LYD_TYPE_REPLY_YANG, NULL));
- CHECK_LOG_CTX("Must condition \"../../lf1 = 'true2'\" not satisfied.", "Data location /j:cont/l1[k='val1']/act.");
+ CHECK_LOG_CTX("Must condition \"../../lf1 = 'true2'\" not satisfied.", "Data location \"/j:cont/l1[k='val1']/act\".");
lyd_free_all(tree);
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:j\">\n"
@@ -1380,7 +1380,7 @@
" }\n"
"}\n", LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX("Data for both cases \"v0\" and \"v2\" exist.",
- "Schema location /k:ch/a0, data location /k:ch, line number 5.");
+ "Schema location \"/k:ch/a0\", data location \"/k:ch\", line number 5.");
CHECK_PARSE_LYD_PARAM(
"{\n"
@@ -1390,7 +1390,7 @@
" }\n"
"}\n", LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
CHECK_LOG_CTX("Data for both cases \"v0\" and \"v2\" exist.",
- "Schema location /k:ch/a0, data location /k:ch, line number 5.");
+ "Schema location \"/k:ch/a0\", data location \"/k:ch\", line number 5.");
}
int
diff --git a/tests/utests/extensions/test_schema_mount.c b/tests/utests/extensions/test_schema_mount.c
index 29117d5..3d7c464 100644
--- a/tests/utests/extensions/test_schema_mount.c
+++ b/tests/utests/extensions/test_schema_mount.c
@@ -225,7 +225,7 @@
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("No module with namespace \"unknown\" in the context.",
- "Schema location /sm:root, data location /sm:root, line number 1.");
+ "Schema location \"/sm:root\", data location \"/sm:root\", line number 1.");
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_SUCCESS, data);
assert_string_equal(LYD_NAME(data), "root");
@@ -236,7 +236,7 @@
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("No module named \"unknown\" in the context.",
- "Schema location /sm:root, data location /sm:root, line number 1.");
+ "Schema location \"/sm:root\", data location \"/sm:root\", line number 1.");
/* missing required callback data */
xml =
@@ -249,7 +249,7 @@
"</root>";
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.",
- "Schema location /sm:root, data location /sm:root, line number 1.");
+ "Schema location \"/sm:root\", data location \"/sm:root\", line number 1.");
json =
"{"
@@ -265,7 +265,7 @@
"}";
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.",
- "Schema location /sm:root, data location /sm:root, line number 1.");
+ "Schema location \"/sm:root\", data location \"/sm:root\", line number 1.");
ly_ctx_set_ext_data_clb(UTEST_LYCTX, test_ext_data_clb,
"<yang-library xmlns=\"urn:ietf:params:xml:ns:yang:ietf-yang-library\" "
@@ -405,25 +405,25 @@
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location /ietf-interfaces:interfaces/interface/type.");
+ "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location /ietf-interfaces:interfaces/interface/type.");
+ "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
/* 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("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location /ietf-interfaces:interfaces/interface/type.");
+ "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
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("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location /ietf-interfaces:interfaces/interface/type.");
+ "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
lyd_free_siblings(data);
/* success */
@@ -1122,8 +1122,8 @@
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Invalid leafref value \"target-value\" - no existing target instance \"/sm:target\".",
- "Schema location /ietf-interfaces:interfaces/interface/sm:sm-name, "
- "data location /ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name.");
+ "Schema location \"/ietf-interfaces:interfaces/interface/sm:sm-name\", "
+ "data location \"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name\".");
json =
"{\n"
@@ -1148,8 +1148,8 @@
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Invalid leafref value \"target-value\" - no existing target instance \"/sm:target\".",
- "Schema location /ietf-interfaces:interfaces/interface/sm:sm-name, "
- "data location /ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name.");
+ "Schema location \"/ietf-interfaces:interfaces/interface/sm:sm-name\", "
+ "data location \"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name\".");
/* success */
xml =
diff --git a/tests/utests/node/list.c b/tests/utests/node/list.c
index 70530e5..712e2e1 100644
--- a/tests/utests/node/list.c
+++ b/tests/utests/node/list.c
@@ -852,7 +852,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Duplicate instance of \"user\".",
- "Schema location /T0:user, data location /T0:user[uid='0'].");
+ "Schema location \"/T0:user\", data location \"/T0:user[uid='0']\".");
data =
"<user xmlns=\"urn:tests:T0\">"
@@ -869,7 +869,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Unique data leaf(s) \"name group\" not satisfied in \"/T0:user[uid='0']\" and \"/T0:user[uid='1']\".",
- "Schema location /T0:user, data location /T0:user[uid='1'].");
+ "Schema location \"/T0:user\", data location \"/T0:user[uid='1']\".");
/* double key */
schema = MODULE_CREATE_YANG("T1", "list user {"
@@ -932,7 +932,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Duplicate instance of \"user\".",
- "Schema location /T1:user, data location /T1:user[uid='0'][group='User'].");
+ "Schema location \"/T1:user\", data location \"/T1:user[uid='0'][group='User']\".");
/* min elements max elements */
schema = MODULE_CREATE_YANG("T2",
@@ -1053,7 +1053,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Too few \"user\" instances.",
- "Schema location /T2:user.");
+ "Schema location \"/T2:user\".");
data =
"<user xmlns=\"urn:tests:T2\">"
@@ -1089,7 +1089,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Too many \"user\" instances.",
- "Schema location /T2:user, data location /T2:user[uid='5'].");
+ "Schema location \"/T2:user\", data location \"/T2:user[uid='5']\".");
/* empty list */
schema = MODULE_CREATE_YANG("T_EMPTY_LIST",
@@ -1205,7 +1205,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Duplicate instance of \"user\".",
- "Schema location /T0:user, data location /T0:user[uid='0'], line number 1.");
+ "Schema location \"/T0:user\", data location \"/T0:user[uid='0']\", line number 1.");
data =
"{\"T0:user\": ["
@@ -1215,7 +1215,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Unique data leaf(s) \"name group\" not satisfied in \"/T0:user[uid='0']\" and \"/T0:user[uid='1']\".",
- "Schema location /T0:user, data location /T0:user[uid='1'], line number 1.");
+ "Schema location \"/T0:user\", data location \"/T0:user[uid='1']\", line number 1.");
/* double key */
schema = MODULE_CREATE_YANG("T1", "list user {"
@@ -1265,7 +1265,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Duplicate instance of \"user\".",
- "Schema location /T1:user, data location /T1:user[uid='0'][group='User'], line number 1.");
+ "Schema location \"/T1:user\", data location \"/T1:user[uid='0'][group='User']\", line number 1.");
/* min elements max elements */
schema = MODULE_CREATE_YANG("T2",
@@ -1353,7 +1353,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Too few \"user\" instances.",
- "Schema location /T2:user, line number 1.");
+ "Schema location \"/T2:user\", line number 1.");
data =
"{\"T2:user\": ["
@@ -1367,7 +1367,7 @@
CHECK_PARSE_LYD_PARAM(data, LYD_JSON, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
assert_null(tree);
CHECK_LOG_CTX("Too many \"user\" instances.",
- "Schema location /T2:user, data location /T2:user[uid='5'], line number 1.");
+ "Schema location \"/T2:user\", data location \"/T2:user[uid='5']\", line number 1.");
schema = MODULE_CREATE_YANG("T_EMPTY_LIST",
"container user_list {"
diff --git a/tests/utests/restriction/test_pattern.c b/tests/utests/restriction/test_pattern.c
index 857a7c4..94539d6 100644
--- a/tests/utests/restriction/test_pattern.c
+++ b/tests/utests/restriction/test_pattern.c
@@ -376,10 +376,10 @@
/* test print error */
TEST_ERROR_XML("TPATTERN_0", "T128");
CHECK_LOG_CTX("pattern 0 error message",
- "Schema location /TPATTERN_0:port, line number 1.");
+ "Schema location \"/TPATTERN_0:port\", line number 1.");
TEST_ERROR_XML("TPATTERN_0", "ahoj");
CHECK_LOG_CTX("pattern 1 error message",
- "Schema location /TPATTERN_0:port, line number 1.");
+ "Schema location \"/TPATTERN_0:port\", line number 1.");
}
diff --git a/tests/utests/restriction/test_range.c b/tests/utests/restriction/test_range.c
index 8c43ebe..f202b6c 100644
--- a/tests/utests/restriction/test_range.c
+++ b/tests/utests/restriction/test_range.c
@@ -386,13 +386,13 @@
/* test print error */
TEST_ERROR_XML("TRANGE_0", "-1");
CHECK_LOG_CTX("error message",
- "Schema location /TRANGE_0:port, line number 1.");
+ "Schema location \"/TRANGE_0:port\", line number 1.");
TEST_ERROR_XML("TRANGE_0", "51");
CHECK_LOG_CTX("error message",
- "Schema location /TRANGE_0:port, line number 1.");
+ "Schema location \"/TRANGE_0:port\", line number 1.");
TEST_ERROR_XML("TRANGE_0", "127");
CHECK_LOG_CTX("error message",
- "Schema location /TRANGE_0:port, line number 1.");
+ "Schema location \"/TRANGE_0:port\", line number 1.");
/* xml test */
schema = MODULE_CREATE_YANG("TRANGE_1", "leaf port {type uint8 {"
@@ -407,13 +407,13 @@
/* test print error */
TEST_ERROR_XML("TRANGE_1", "0");
CHECK_LOG_CTX("error message",
- "Schema location /TRANGE_1:port, line number 1.");
+ "Schema location \"/TRANGE_1:port\", line number 1.");
TEST_ERROR_XML("TRANGE_1", "51");
CHECK_LOG_CTX("error message",
- "Schema location /TRANGE_1:port, line number 1.");
+ "Schema location \"/TRANGE_1:port\", line number 1.");
TEST_ERROR_XML("TRANGE_1", "127");
CHECK_LOG_CTX("error message",
- "Schema location /TRANGE_1:port, line number 1.");
+ "Schema location \"/TRANGE_1:port\", line number 1.");
}
diff --git a/tests/utests/schema/test_schema_common.c b/tests/utests/schema/test_schema_common.c
index ab0d81b..97af0fb 100644
--- a/tests/utests/schema/test_schema_common.c
+++ b/tests/utests/schema/test_schema_common.c
@@ -617,7 +617,7 @@
"}";
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, NULL), LY_EVALID);
CHECK_LOG_CTX("Invalid leafref path \"/cont/l\" - target is supposed to represent configuration data"
- " (as the leafref does), but it does not.", "Schema location /b:cont2/l2.");
+ " (as the leafref does), but it does not.", "Schema location \"/b:cont2/l2\".");
/* config -> state must */
str = "module b {\n"
@@ -768,7 +768,7 @@
" }\n"
"}";
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, NULL), LY_EVALID);
- CHECK_LOG_CTX("Not found node \"l\" in path.", "Schema location /h:rp/input/l2.");
+ CHECK_LOG_CTX("Not found node \"l\" in path.", "Schema location \"/h:rp/input/l2\".");
/* rpc input -> rpc output must */
str = "module h {\n"
@@ -811,7 +811,7 @@
" }\n"
"}";
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, NULL), LY_EVALID);
- CHECK_LOG_CTX("Not found node \"notif\" in path.", "Schema location /i:rp/input/l2.");
+ CHECK_LOG_CTX("Not found node \"notif\" in path.", "Schema location \"/i:rp/input/l2\".");
/* rpc input -> notif must */
str = "module i {\n"
@@ -895,7 +895,7 @@
" }\n"
"}";
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, NULL), LY_EVALID);
- CHECK_LOG_CTX("Not found node \"l\" in path.", "Schema location /k:cont/ll/act/output/l2.");
+ CHECK_LOG_CTX("Not found node \"l\" in path.", "Schema location \"/k:cont/ll/act/output/l2\".");
/* action output -> action input must */
str = "module k {\n"
@@ -1069,7 +1069,7 @@
"}}"
"}";
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, NULL), LY_EVALID);
- CHECK_LOG_CTX("Enumeration type of node \"l\" without any (or all disabled) valid values.", "Schema location /a:l.");
+ CHECK_LOG_CTX("Enumeration type of node \"l\" without any (or all disabled) valid values.", "Schema location \"/a:l\".");
/* disabled default value */
str = "module a {"
@@ -1087,5 +1087,5 @@
"}";
assert_int_equal(lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, NULL), LY_EVALID);
CHECK_LOG_CTX("Invalid default - value does not fit the type (Invalid enumeration value \"e1\".).",
- "Schema location /a:l.");
+ "Schema location \"/a:l\".");
}
diff --git a/tests/utests/schema/test_schema_stmts.c b/tests/utests/schema/test_schema_stmts.c
index d6070aa..81a9832 100644
--- a/tests/utests/schema/test_schema_stmts.c
+++ b/tests/utests/schema/test_schema_stmts.c
@@ -118,12 +118,12 @@
/* default value from non-implemented module */
TEST_SCHEMA_ERR(0, 0, "ident2", "import base {prefix b;} leaf l {type identityref {base b:i1;} default b:i2;}",
"Invalid default - value does not fit the type (Invalid identityref \"b:i2\" value"
- " - identity found in non-implemented module \"base\".).", "Schema location /ident2:l.");
+ " - identity found in non-implemented module \"base\".).", "Schema location \"/ident2:l\".");
/* default value in typedef from non-implemented module */
TEST_SCHEMA_ERR(0, 0, "ident2", "import base {prefix b;} typedef t1 {type identityref {base b:i1;} default b:i2;}"
"leaf l {type t1;}", "Invalid default - value does not fit the type (Invalid"
- " identityref \"b:i2\" value - identity found in non-implemented module \"base\".).", "Schema location /ident2:l.");
+ " identityref \"b:i2\" value - identity found in non-implemented module \"base\".).", "Schema location \"/ident2:l\".");
/*
* printing
diff --git a/tests/utests/schema/test_tree_schema_compile.c b/tests/utests/schema/test_tree_schema_compile.c
index abc03e7..f57f4ab 100644
--- a/tests/utests/schema/test_tree_schema_compile.c
+++ b/tests/utests/schema/test_tree_schema_compile.c
@@ -307,7 +307,7 @@
CHECK_LOG_CTX("Leaf-list of type \"empty\" is allowed only in YANG 1.1 modules.", "/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.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Invalid empty value length 1.).", "Schema location \"/bb:ll\".");
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module cc {yang-version 1.1;namespace urn:cc;prefix cc;"
"leaf-list ll {config false;type string; default one;default two;default one;}}", LYS_IN_YANG, &mod));
@@ -322,7 +322,7 @@
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));
CHECK_LOG_CTX("Invalid default - value does not fit the type "
- "(Invalid instance-identifier \"/ee:g\" value - semantic error.).", "Schema location /ee:ref.");
+ "(Invalid instance-identifier \"/ee:g\" value - semantic error.).", "Schema location \"/ee:ref\".");
}
static void
@@ -420,7 +420,7 @@
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));
- CHECK_LOG_CTX("Key \"x\" is disabled.", "Schema location /cc:l/x.");
+ CHECK_LOG_CTX("Key \"x\" is disabled.", "Schema location \"/cc:l/x\".");
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));
@@ -1403,7 +1403,8 @@
assert_true(contains_derived_identity(UTEST_LYCTX, "a", NULL, "baseid", "id1"));
data = "<lf xmlns=\"urn:b\" xmlns:ids=\"urn:a\">ids:id1</lf>";
CHECK_PARSE_LYD_PARAM(data, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG("Invalid identityref \"ids:id1\" value - identity found in non-implemented module \"a\".", "Schema location /b:lf, line number 1.");
+ CHECK_LOG("Invalid identityref \"ids:id1\" value - identity found in non-implemented module \"a\".",
+ "Schema location \"/b:lf\", line number 1.");
assert_non_null(ly_ctx_get_module(UTEST_LYCTX, "a", NULL));
assert_false(contains_derived_identity(UTEST_LYCTX, "a", NULL, "baseid", "id3"));
data = "<lf xmlns=\"urn:b\" xmlns:ids=\"urn:a\">ids:id3</lf>";
@@ -1431,11 +1432,13 @@
assert_true(contains_derived_identity(UTEST_LYCTX, "a", NULL, "baseid", "id1"));
data = "<lf xmlns=\"urn:b\" xmlns:ids=\"urn:a\">ids:id1</lf>";
CHECK_PARSE_LYD_PARAM(data, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG("Invalid identityref \"ids:id1\" value - identity found in non-implemented module \"a\".", "Schema location /b:lf, line number 1.");
+ CHECK_LOG("Invalid identityref \"ids:id1\" value - identity found in non-implemented module \"a\".",
+ "Schema location \"/b:lf\", line number 1.");
assert_true(contains_derived_identity(UTEST_LYCTX, "a", NULL, "baseid", "id3"));
data = "<lf xmlns=\"urn:b\" xmlns:ids=\"urn:c\">ids:id3</lf>";
CHECK_PARSE_LYD_PARAM(data, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG("Invalid identityref \"ids:id3\" value - identity found in non-implemented module \"c\".", "Schema location /b:lf, line number 1.");
+ CHECK_LOG("Invalid identityref \"ids:id3\" value - identity found in non-implemented module \"c\".",
+ "Schema location \"/b:lf\", line number 1.");
RESET_CTX(UTEST_LYCTX);
/* Unimplemented module expand base identity located in implemented module. */
@@ -1459,7 +1462,8 @@
assert_true(contains_derived_identity(UTEST_LYCTX, "b", NULL, "baseid", "id1"));
data = "<lf xmlns=\"urn:b\" xmlns:ids=\"urn:a\">ids:id1</lf>";
CHECK_PARSE_LYD_PARAM(data, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG("Invalid identityref \"ids:id1\" value - identity found in non-implemented module \"a\".", "Schema location /b:lf, line number 1.");
+ CHECK_LOG("Invalid identityref \"ids:id1\" value - identity found in non-implemented module \"a\".",
+ "Schema location \"/b:lf\", line number 1.");
RESET_CTX(UTEST_LYCTX);
/* Transitivity of derived identity through unimplemented module. */
@@ -1641,7 +1645,8 @@
assert_true(contains_derived_identity(UTEST_LYCTX, "a", NULL, "baseid", "id3"));
data = "<lf xmlns=\"urn:b\">id3</lf>";
CHECK_PARSE_LYD_PARAM(data, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Invalid identityref \"id3\" value - identity is disabled by if-feature.", "Schema location /b:lf, line number 1.");
+ CHECK_LOG_CTX("Invalid identityref \"id3\" value - identity is disabled by if-feature.",
+ "Schema location \"/b:lf\", line number 1.");
RESET_CTX(UTEST_LYCTX);
/* The derived identities are enabled and disabled in submodule. */
@@ -1673,7 +1678,8 @@
assert_true(contains_derived_identity(UTEST_LYCTX, "a", NULL, "baseid", "id3"));
data = "<lf xmlns=\"urn:b\" xmlns:ids=\"urn:a\">ids:id3</lf>";
CHECK_PARSE_LYD_PARAM(data, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, tree);
- CHECK_LOG_CTX("Invalid identityref \"ids:id3\" value - identity is disabled by if-feature.", "Schema location /b:lf, line number 1.");
+ CHECK_LOG_CTX("Invalid identityref \"ids:id3\" value - identity is disabled by if-feature.",
+ "Schema location \"/b:lf\", line number 1.");
RESET_CTX(UTEST_LYCTX);
#undef RESET_CTX
@@ -1854,7 +1860,7 @@
"leaf ref1 {type leafref {path /target;}}"
"leaf target {if-feature 'f1'; type boolean;}}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Target of leafref \"ref1\" cannot be referenced because it is disabled.", "Schema location /e:ref1.");
+ CHECK_LOG_CTX("Target of leafref \"ref1\" cannot be referenced because it is disabled.", "Schema location \"/e:ref1\".");
str = "module en {yang-version 1.1;namespace urn:en;prefix en;feature f1;"
"leaf ref1 {if-feature 'f1'; type leafref {path /target;}}"
@@ -1864,7 +1870,7 @@
str = "module e {yang-version 1.1;namespace urn:e;prefix e;feature f1;"
"leaf ref1 {if-feature 'f1'; type leafref {path /target;}}}";
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, str, LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Not found node \"target\" in path.", "Schema location /e:ref1.");
+ CHECK_LOG_CTX("Not found node \"target\" in path.", "Schema location \"/e:ref1\".");
ly_ctx_set_options(UTEST_LYCTX, LY_CTX_REF_IMPLEMENTED);
ly_ctx_set_module_imp_clb(UTEST_LYCTX, test_imp_clb, "module cl {namespace urn:cl;prefix cl;feature f1;"
@@ -1874,7 +1880,7 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module im {namespace urn:im;prefix im;import cl {prefix cl;}"
"leaf ref {must \"/cl:h > 0\"; type uint16;}}", LYS_IN_YANG, &mod));
ly_ctx_unset_options(UTEST_LYCTX, LY_CTX_REF_IMPLEMENTED);
- CHECK_LOG_CTX("Target of leafref \"g\" cannot be referenced because it is disabled.", "Schema location /cl:g.");
+ CHECK_LOG_CTX("Target of leafref \"g\" cannot be referenced because it is disabled.", "Schema location \"/cl:g\".");
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module f {namespace urn:f;prefix f;"
"list interface{key name;leaf name{type string;}list address {key ip;leaf ip {type string;}}}"
@@ -1953,27 +1959,28 @@
/* invalid paths */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;container a {leaf target2 {type uint8;}}"
"leaf ref1 {type leafref {path ../a/invalid;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Not found node \"invalid\" in path.", "Schema location /aa:ref1.");
+ CHECK_LOG_CTX("Not found node \"invalid\" in path.", "Schema location \"/aa:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module bb {namespace urn:bb;prefix bb;container a {leaf target2 {type uint8;}}"
"leaf ref1 {type leafref {path ../../toohigh;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Too many parent references in path.", "Schema location /bb:ref1.");
+ CHECK_LOG_CTX("Too many parent references in path.", "Schema location \"/bb:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:cc;prefix cc;container a {leaf target2 {type uint8;}}"
"leaf ref1 {type leafref {path /a:invalid;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("No module connected with the prefix \"a\" found (prefix format schema stored mapping).", "Schema location /cc:ref1.");
+ CHECK_LOG_CTX("No module connected with the prefix \"a\" found (prefix format schema stored mapping).", "Schema location \"/cc:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module dd {namespace urn:dd;prefix dd;leaf target1 {type string;}"
"container a {leaf target2 {type uint8;}} leaf ref1 {type leafref {"
"path '/a[target2 = current()/../target1]/target2';}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("List predicate defined for container \"a\" in path.", "Schema location /dd:ref1.");
+ CHECK_LOG_CTX("List predicate defined for container \"a\" in path.", "Schema location \"/dd:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ee {namespace urn:ee;prefix ee;\n container a {leaf target2 {type uint8;}}\n"
"leaf ref1 {type leafref {path /a!invalid;}}}", LYS_IN_YANG, &mod));
CHECK_LOG_CTX("Parsing module \"ee\" failed.", NULL,
"Invalid character 0x21 ('!'), perhaps \"a\" is supposed to be a function call.", "Line number 3.");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module ff {namespace urn:ff;prefix ff;container a {leaf target2 {type uint8;}}"
"leaf ref1 {type leafref {path /a;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid leafref path \"/a\" - target node is container instead of leaf or leaf-list.", "Schema location /ff:ref1.");
+ CHECK_LOG_CTX("Invalid leafref path \"/a\" - target node is container instead of leaf or leaf-list.", "Schema location \"/ff:ref1\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module gg {namespace urn:gg;prefix gg;container a {leaf target2 {type uint8;"
"status deprecated;}} leaf ref1 {type leafref {path /a/target2;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("A current definition \"ref1\" is not allowed to reference deprecated definition \"target2\".", "Schema location /gg:ref1.");
+ CHECK_LOG_CTX("A current definition \"ref1\" is not allowed to reference deprecated definition \"target2\".",
+ "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");
@@ -1982,7 +1989,7 @@
CHECK_LOG_CTX("Missing path substatement for leafref type mytype.", "/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.");
+ 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));
@@ -2012,14 +2019,15 @@
"leaf ifname{type leafref{ path \"../interface/name\";}}"
"leaf address {type leafref{ path \"/interface[x:name=current()/../ifname]/ip\";}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("No module connected with the prefix \"x\" found (prefix format schema stored mapping).", "Schema location /pp:address.");
+ CHECK_LOG_CTX("No module connected with the prefix \"x\" found (prefix format schema stored mapping).",
+ "Schema location \"/pp:address\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module qq {namespace urn:qq;prefix qq;"
"list interface{key name;leaf name{type string;}leaf ip {type string;}}"
"leaf ifname{type leafref{ path \"../interface/name\";}}"
"leaf address {type leafref{ path \"/interface[id=current()/../ifname]/ip\";}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Not found node \"id\" in path.", "Schema location /qq:address.");
+ CHECK_LOG_CTX("Not found node \"id\" in path.", "Schema location \"/qq:address\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module rr {namespace urn:rr;prefix rr;\n"
"list interface{key name;leaf name{type string;}leaf ip {type string;}}\n"
@@ -2082,37 +2090,39 @@
"leaf ifname{type leafref{ path \"../interface/name\";}}\n"
"leaf address {type leafref{ path \"/interface[name=current()/../x:ifname]/ip\";}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("No module connected with the prefix \"x\" found (prefix format schema stored mapping).", "Schema location /yy:address.");
+ CHECK_LOG_CTX("No module connected with the prefix \"x\" found (prefix format schema stored mapping).",
+ "Schema location \"/yy:address\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module zz {namespace urn:zz;prefix zz;\n"
"list interface{key name;leaf name{type string;}leaf ip {type string;}}\n"
"leaf ifname{type leafref{ path \"../interface/name\";}}\n"
"leaf address {type leafref{ path \"/interface[name=current()/../xxx]/ip\";}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Not found node \"xxx\" in path.", "Schema location /zz:address.");
+ CHECK_LOG_CTX("Not found node \"xxx\" in path.", "Schema location \"/zz:address\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module zza {namespace urn:zza;prefix zza;\n"
"list interface{key name;leaf name{type string;}leaf ip {type string;}}\n"
"leaf ifname{type leafref{ path \"../interface/name\";}}container c;\n"
"leaf address {type leafref{ path \"/interface[name=current()/../c]/ip\";}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Leaf expected instead of container \"c\" in leafref predicate in path.", "Schema location /zza:address.");
+ CHECK_LOG_CTX("Leaf expected instead of container \"c\" in leafref predicate in path.", "Schema location \"/zza:address\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module zzb {namespace urn:zzb;prefix zzb;\n"
"list interface{key name;leaf name{type string;}leaf ip {type string;}container c;}\n"
"leaf ifname{type leafref{ path \"../interface/name\";}}\n"
"leaf address {type leafref{ path \"/interface[c=current()/../ifname]/ip\";}}}",
LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Key expected instead of container \"c\" in path.", "Schema location /zzb:address.");
+ CHECK_LOG_CTX("Key expected instead of container \"c\" in path.", "Schema location \"/zzb:address\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module zzc {namespace urn:zzc;prefix zzc;\n"
"leaf source {type leafref {path \"../target\";}default true;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Not found node \"target\" in path.", "Schema location /zzc:source.");
+ CHECK_LOG_CTX("Not found node \"target\" in path.", "Schema location \"/zzc:source\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module zzd {namespace urn:zzd;prefix zzd;\n"
"leaf source {type leafref {path \"../target\";}default true;}\n"
"leaf target {type uint8;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Invalid uint8 value \"true\".).", "Schema location /zzd:source.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Invalid type uint8 value \"true\".).",
+ "Schema location \"/zzd:source\".");
/* circular chain */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aaa {namespace urn:aaa;prefix aaa;\n"
@@ -2120,7 +2130,7 @@
"leaf ref2 {type leafref {path /ref3;}}\n"
"leaf ref3 {type leafref {path /ref4;}}\n"
"leaf ref4 {type leafref {path /ref1;}}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Invalid leafref path \"/ref1\" - circular chain of leafrefs detected.", "Schema location /aaa:ref4.");
+ CHECK_LOG_CTX("Invalid leafref path \"/ref1\" - circular chain of leafrefs detected.", "Schema location \"/aaa:ref4\".");
}
static void
@@ -2129,7 +2139,7 @@
/* invalid */
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module aa {namespace urn:aa;prefix aa;"
"leaf l {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 /aa:l.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Invalid empty value length 1.).", "Schema location \"/aa:l\".");
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));
@@ -2312,7 +2322,8 @@
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module cc {namespace urn:dd;prefix d;"
"container c {leaf l {status obsolete; type string;}}"
"container d {leaf m {when \"../../c/l\"; type string;}}}", LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("A current definition \"m\" is not allowed to reference obsolete definition \"l\".", "Schema location /cc:d/m.");
+ CHECK_LOG_CTX("A current definition \"m\" is not allowed to reference obsolete definition \"l\".",
+ "Schema location \"/cc:d/m\".");
}
static void
@@ -3537,21 +3548,21 @@
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));
CHECK_LOG_CTX("Invalid default - value does not fit the type "
- "(Value \"300\" is out of uint8's min/max bounds.).", "Schema location /oo1:x.");
+ "(Value \"300\" is out of type uint8 min/max bounds.).", "Schema location \"/oo1:x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module oo2 {yang-version 1.1;namespace urn:oo2;prefix oo2; leaf-list x {type uint16; default 10; default 300;}"
"deviation /x {deviate replace {type uint8;}}}", LYS_IN_YANG, &mod));
CHECK_LOG_CTX("Invalid default - value does not fit the type "
- "(Value \"300\" is out of uint8's min/max bounds.).", "Schema location /oo2:x.");
+ "(Value \"300\" is out of type uint8 min/max bounds.).", "Schema location \"/oo2:x\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module oo3 {namespace urn:oo3;prefix oo3; leaf x {type uint8;}"
"deviation /x {deviate add {default 300;}}}", LYS_IN_YANG, &mod));
CHECK_LOG_CTX("Invalid default - value does not fit the type "
- "(Value \"300\" is out of uint8's min/max bounds.).", "Schema location /oo3:x.");
+ "(Value \"300\" is out of type uint8 min/max bounds.).", "Schema location \"/oo3:x\".");
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, "module pp {namespace urn:pp;prefix pp; leaf l { type leafref {path /c/x;}}"
"container c {leaf x {type string;} leaf y {type string;}}}", LYS_IN_YANG, &mod));
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX, "module pp1 {namespace urn:pp1;prefix pp1; import pp {prefix pp;}"
"deviation /pp:c/pp:x {deviate not-supported;}}", LYS_IN_YANG, &mod));
- CHECK_LOG_CTX("Target of leafref \"l\" cannot be referenced because it is disabled.", "Schema location /pp:l.");
+ CHECK_LOG_CTX("Target of leafref \"l\" cannot be referenced because it is disabled.", "Schema location \"/pp:l\".");
}
static void
@@ -3583,7 +3594,7 @@
" }\n"
"}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("When condition cyclic dependency on the node \"cont2\".", "Schema location /a:cont/lst/val.");
+ CHECK_LOG_CTX("When condition cyclic dependency on the node \"cont2\".", "Schema location \"/a:cont/lst/val\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX,
"module a {\n"
@@ -3611,7 +3622,7 @@
" }\n"
"}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("When condition cyclic dependency on the node \"cont2\".", "Schema location /a:cont/lst/val.");
+ CHECK_LOG_CTX("When condition cyclic dependency on the node \"cont2\".", "Schema location \"/a:cont/lst/val\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX,
"module a {\n"
@@ -3623,7 +3634,7 @@
" }\n"
"}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("When condition is accessing its own conditional node value.", "Schema location /a:val.");
+ CHECK_LOG_CTX("When condition is accessing its own conditional node value.", "Schema location \"/a:val\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX,
"module a {\n"
@@ -3639,7 +3650,7 @@
" }\n"
"}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("When condition is accessing its own conditional node value.", "Schema location /a:val.");
+ CHECK_LOG_CTX("When condition is accessing its own conditional node value.", "Schema location \"/a:val\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX,
"module a {\n"
@@ -3654,7 +3665,7 @@
" container cont;\n"
"}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("When condition is accessing its own conditional node value.", "Schema location /a:cont/val.");
+ CHECK_LOG_CTX("When condition is accessing its own conditional node value.", "Schema location \"/a:cont/val\".");
assert_int_equal(LY_EVALID, lys_parse_mem(UTEST_LYCTX,
"module a {\n"
@@ -3671,7 +3682,7 @@
" container cont;\n"
"}",
LYS_IN_YANG, NULL));
- CHECK_LOG_CTX("When condition is accessing its own conditional node children.", "Schema location /a:cont/aug-cont.");
+ CHECK_LOG_CTX("When condition is accessing its own conditional node children.", "Schema location \"/a:cont/aug-cont\".");
assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX,
"module b {\n"
diff --git a/tests/utests/types/bits.c b/tests/utests/types/bits.c
index a2631a0..f5e3e2d 100644
--- a/tests/utests/types/bits.c
+++ b/tests/utests/types/bits.c
@@ -626,13 +626,13 @@
TEST_ERROR_XML("T0", "twelvea");
CHECK_LOG_CTX("Invalid bit \"twelvea\".",
- "Schema location /T0:port, line number 1.");
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_XML("T0", "twelve t");
CHECK_LOG_CTX("Invalid bit \"t\".",
- "Schema location /T0:port, line number 1.");
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_XML("T0", "ELEVEN");
CHECK_LOG_CTX("Invalid bit \"ELEVEN\".",
- "Schema location /T0:port, line number 1.");
+ "Schema location \"/T0:port\", line number 1.");
/* empty value */
data = "<port xmlns=\"urn:tests:T0\"/>"; \
diff --git a/tests/utests/types/boolean.c b/tests/utests/types/boolean.c
index 92c7d60..841db2a 100644
--- a/tests/utests/types/boolean.c
+++ b/tests/utests/types/boolean.c
@@ -80,11 +80,11 @@
/* invalid value */
TEST_ERROR_XML("defs", "l1", "unsure");
CHECK_LOG_CTX("Invalid boolean value \"unsure\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "l1", " true");
CHECK_LOG_CTX("Invalid boolean value \" true\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
}
static void
diff --git a/tests/utests/types/decimal64.c b/tests/utests/types/decimal64.c
index 4f4678e..e0a7cab 100644
--- a/tests/utests/types/decimal64.c
+++ b/tests/utests/types/decimal64.c
@@ -79,27 +79,27 @@
TEST_ERROR_XML("defs", "l1", "\n 15 \t\n ");
CHECK_LOG_CTX("Unsatisfied range - value \"15.0\" is out of the allowed range.",
- "Schema location /defs:l1, line number 3.");
+ "Schema location \"/defs:l1\", line number 3.");
TEST_ERROR_XML("defs", "l1", "\n 0 \t\n ");
CHECK_LOG_CTX("Unsatisfied range - value \"0.0\" is out of the allowed range.",
- "Schema location /defs:l1, line number 3.");
+ "Schema location \"/defs:l1\", line number 3.");
TEST_ERROR_XML("defs", "l1", "xxx");
CHECK_LOG_CTX("Invalid 1. character of decimal64 value \"xxx\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "l1", "");
CHECK_LOG_CTX("Invalid empty decimal64 value.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "l1", "8.5 xxx");
CHECK_LOG_CTX("Invalid 6. character of decimal64 value \"8.5 xxx\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "l1", "8.55 xxx");
CHECK_LOG_CTX("Value \"8.55\" of decimal64 type exceeds defined number (1) of fraction digits.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
}
static void
diff --git a/tests/utests/types/empty.c b/tests/utests/types/empty.c
index 4c1b20e..0ab9710 100644
--- a/tests/utests/types/empty.c
+++ b/tests/utests/types/empty.c
@@ -78,11 +78,11 @@
/* invalid value */
TEST_ERROR_XML("defs", "l1", "x");
CHECK_LOG_CTX("Invalid empty value length 1.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "l1", " ");
CHECK_LOG_CTX("Invalid empty value length 1.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
}
static void
diff --git a/tests/utests/types/enumeration.c b/tests/utests/types/enumeration.c
index 8b73e25..660479f 100644
--- a/tests/utests/types/enumeration.c
+++ b/tests/utests/types/enumeration.c
@@ -74,21 +74,21 @@
/* disabled feature */
TEST_ERROR_XML("defs", "l1", "yellow");
CHECK_LOG_CTX("Invalid enumeration value \"yellow\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
/* leading/trailing whitespaces */
TEST_ERROR_XML("defs", "l1", " white");
CHECK_LOG_CTX("Invalid enumeration value \" white\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "l1", "white\n");
CHECK_LOG_CTX("Invalid enumeration value \"white\n\".",
- "Schema location /defs:l1, line number 2.");
+ "Schema location \"/defs:l1\", line number 2.");
/* invalid value */
TEST_ERROR_XML("defs", "l1", "black");
CHECK_LOG_CTX("Invalid enumeration value \"black\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
}
static void
diff --git a/tests/utests/types/identityref.c b/tests/utests/types/identityref.c
index 0b82ab6..cdfe057 100644
--- a/tests/utests/types/identityref.c
+++ b/tests/utests/types/identityref.c
@@ -83,19 +83,19 @@
/* invalid value */
TEST_ERROR_XML("defs", "", "l1", "fast-ethernet");
CHECK_LOG_CTX("Invalid identityref \"fast-ethernet\" value - identity not found in module \"defs\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "xmlns:x=\"urn:tests:defs\"", "l1", "x:slow-ethernet");
CHECK_LOG_CTX("Invalid identityref \"x:slow-ethernet\" value - identity not found in module \"defs\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "xmlns:x=\"urn:tests:ident-base\"", "l1", "x:ident-base");
CHECK_LOG_CTX("Invalid identityref \"x:ident-base\" value - identity not derived from the base \"ident-base:ident-base\".",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML("defs", "xmlns:x=\"urn:tests:unknown\"", "l1", "x:ident-base");
CHECK_LOG_CTX("Invalid identityref \"x:ident-base\" value - unable to map prefix to YANG schema.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
}
static void
diff --git a/tests/utests/types/instanceid.c b/tests/utests/types/instanceid.c
index 7ffbe85..9d471c9 100644
--- a/tests/utests/types/instanceid.c
+++ b/tests/utests/types/instanceid.c
@@ -137,34 +137,34 @@
"<list xmlns=\"urn:tests:defs\"><id>b</id><value>x</value></list>",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l1", "/xdf:list[2]/xdf:value", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list[2]/xdf:value\" value - semantic error.",
- "Schema location /defs:l1.");
+ "Schema location \"/defs:l1\".");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l1", "/t:cont/t:1l", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:cont/t:1l\" value - syntax error.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l1", "/t:cont:t:1l", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:cont:t:1l\" value - syntax error.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l1", "/xdf:cont/xdf:invalid/xdf:path", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:cont/xdf:invalid/xdf:path\" value - semantic error.",
- "Schema location /defs:l1.");
+ "Schema location \"/defs:l1\".");
/* non-existing instances, instance-identifier is here in JSON format because it is already in internal
* representation without canonical prefixes */
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"/>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "/m:cont/m:l2", LY_ENOTFOUND);
CHECK_LOG_CTX_APPTAG("Invalid instance-identifier \"/mod:cont/l2\" value - required instance not found.",
- "Schema location /defs:l1, data location /defs:l1.", "instance-required");
+ "Schema location \"/defs:l1\", data location \"/defs:l1\".", "instance-required");
TEST_ERROR_XML2("<llist xmlns=\"urn:tests:defs\">1</llist>",
"defs", "xmlns:a=\"urn:tests:defs\"", "l1", "/a:llist[.='2']", LY_ENOTFOUND);
CHECK_LOG_CTX_APPTAG("Invalid instance-identifier \"/defs:llist[.='2']\" value - required instance not found.",
- "Schema location /defs:l1, data location /defs:l1.", "instance-required");
+ "Schema location \"/defs:l1\", data location \"/defs:l1\".", "instance-required");
TEST_ERROR_XML2("<list2 xmlns=\"urn:tests:defs\"><id>a</id><id2>a</id2></list2>"
"<list2 xmlns=\"urn:tests:defs\"><id>c</id><id2>b</id2></list2>"
@@ -172,7 +172,7 @@
"<llist xmlns=\"urn:tests:defs\">b</llist>",
"defs", "xmlns:a=\"urn:tests:defs\"", "l1", "/a:list2[a:id='a'][a:id2='a']/a:id", LY_ENOTFOUND);
CHECK_LOG_CTX_APPTAG("Invalid instance-identifier \"/defs:list2[id='a'][id2='a']/id\" value - required instance not found.",
- "Schema location /defs:l1, data location /defs:l1.", "instance-required");
+ "Schema location \"/defs:l1\", data location \"/defs:l1\".", "instance-required");
TEST_ERROR_XML2("<list2 xmlns=\"urn:tests:defs\"><id>a</id><id2>a</id2></list2>"
"<list2 xmlns=\"urn:tests:defs\"><id>c</id><id2>b</id2></list2>"
@@ -180,83 +180,83 @@
"<llist xmlns=\"urn:tests:defs\">2</llist>",
"defs", "xmlns:a=\"urn:tests:defs\"", "l1", "/a:llist[.='3']", LY_ENOTFOUND);
CHECK_LOG_CTX_APPTAG("Invalid instance-identifier \"/defs:llist[.='3']\" value - required instance not found.",
- "Schema location /defs:l1, data location /defs:l1.", "instance-required");
+ "Schema location \"/defs:l1\", data location \"/defs:l1\".", "instance-required");
TEST_ERROR_XML2("",
"defs", "xmlns:a=\"urn:tests:defs\"", "l1", "/a:list-keyless[3]", LY_ENOTFOUND);
CHECK_LOG_CTX_APPTAG("Invalid instance-identifier \"/defs:list-keyless[3]\" value - required instance not found.",
- "Schema location /defs:l1, data location /defs:l1.", "instance-required");
+ "Schema location \"/defs:l1\", data location \"/defs:l1\".", "instance-required");
/* more errors */
TEST_ERROR_XML2("<llist xmlns=\"urn:tests:defs\">x</llist>",
"defs", "xmlns:t=\"urn:tests:defs\"", "t:l1", "/t:llist[1", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[1\" value - syntax error.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"/>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "/m:cont[1]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/m:cont[1]\" value - semantic error.",
- "Schema location /defs:l1.");
+ "Schema location \"/defs:l1\".");
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"/>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "[1]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"[1]\" value - syntax error.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"><l2/></cont>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "/m:cont/m:l2[l2='1']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/m:cont/m:l2[l2='1']\" value - syntax error.",
- "Schema location /defs:l1, line number 1.");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"><l2/></cont>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "/m:cont/m:l2[m:l2='1']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/m:cont/m:l2[m:l2='1']\" value - semantic error.",
- "Schema location /defs:l1.");
+ "Schema location \"/defs:l1\".");
TEST_ERROR_XML2("<llist xmlns=\"urn:tests:defs\">1</llist><llist xmlns=\"urn:tests:defs\">2</llist>",
"defs", "xmlns:t=\"urn:tests:defs\"", "t:l1", "/t:llist[4]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[4]\" value - semantic error.",
- "Schema location /defs:l1.");
+ "Schema location \"/defs:l1\".");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/t:llist[6]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[6]\" value - semantic error.",
- "Schema location /defs:l2.");
+ "Schema location \"/defs:l2\".");
TEST_ERROR_XML2("<list xmlns=\"urn:tests:defs\"><id>1</id><value>x</value></list>",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/xdf:list[xdf:value='x']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list[xdf:value='x']\" value - semantic error.",
- "Schema location /defs:l2.");
+ "Schema location \"/defs:l2\".");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/xdf:list[.='x']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list[.='x']\" value - semantic error.",
- "Schema location /defs:l2.");
+ "Schema location \"/defs:l2\".");
TEST_ERROR_XML2("<llist xmlns=\"urn:tests:defs\">1</llist>",
"defs", "xmlns:t=\"urn:tests:defs\"", "t:l1", "/t:llist[.='x']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[.='x']\" value - semantic error.",
- "Schema location /defs:l1.");
+ "Schema location \"/defs:l1\".");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/t:llist[1][2]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[1][2]\" value - syntax error.",
- "Schema location /defs:l2, line number 1.");
+ "Schema location \"/defs:l2\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/t:llist[.='a'][.='b']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[.='a'][.='b']\" value - syntax error.",
- "Schema location /defs:l2, line number 1.");
+ "Schema location \"/defs:l2\", line number 1.");
TEST_ERROR_XML2("<list xmlns=\"urn:tests:defs\"><id>1</id><value>x</value></list>",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/xdf:list[xdf:id='1'][xdf:id='2']/xdf:value", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list[xdf:id='1'][xdf:id='2']/xdf:value\" value - syntax error.",
- "Schema location /defs:l2, line number 1.");
+ "Schema location \"/defs:l2\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/xdf:list2[xdf:id='1']/xdf:value", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list2[xdf:id='1']/xdf:value\" value - semantic error.",
- "Schema location /defs:l2.");
+ "Schema location \"/defs:l2\".");
}
static void
diff --git a/tests/utests/types/int16.c b/tests/utests/types/int16.c
index 7d021be..f6796a1 100644
--- a/tests/utests/types/int16.c
+++ b/tests/utests/types/int16.c
@@ -61,7 +61,7 @@
TEST_ERROR_XML("defs", "100");
CHECK_LOG_CTX("Unsatisfied range - value \"100\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
}
int
diff --git a/tests/utests/types/int32.c b/tests/utests/types/int32.c
index f614c62..9989a67 100644
--- a/tests/utests/types/int32.c
+++ b/tests/utests/types/int32.c
@@ -60,8 +60,8 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
TEST_ERROR_XML("defs", "0x01");
- CHECK_LOG_CTX("Invalid int32 value \"0x01\".",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Invalid type int32 value \"0x01\".",
+ "Schema location \"/defs:port\", line number 1.");
}
int
diff --git a/tests/utests/types/int64.c b/tests/utests/types/int64.c
index a5eafd2..6b5e47e 100644
--- a/tests/utests/types/int64.c
+++ b/tests/utests/types/int64.c
@@ -60,16 +60,16 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
TEST_ERROR_XML("defs", "");
- CHECK_LOG_CTX("Invalid empty int64 value.",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Invalid type int64 empty value.",
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", " ");
- CHECK_LOG_CTX("Invalid empty int64 value.",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Invalid type int64 empty value.",
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", "-10 xxx");
- CHECK_LOG_CTX("Invalid int64 value \"-10 xxx\".",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Invalid type int64 value \"-10 xxx\".",
+ "Schema location \"/defs:port\", line number 1.");
}
int
diff --git a/tests/utests/types/int8.c b/tests/utests/types/int8.c
index 9eea4cd..e572d72 100644
--- a/tests/utests/types/int8.c
+++ b/tests/utests/types/int8.c
@@ -460,8 +460,8 @@
" default \"128\";"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /TD_ERR0:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"128\" is out of type int8 min/max bounds.).",
+ "Schema location \"/TD_ERR0:port\".");
/* TEST DEFAULT VALUE ERROR */
schema = MODULE_CREATE_YANG("TD_ERR1",
@@ -471,7 +471,7 @@
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid default - value does not fit the type (Unsatisfied range - value \"-1\" is out of the allowed range.).",
- "Schema location /TD_ERR1:port.");
+ "Schema location \"/TD_ERR1:port\".");
/* TEST DEFAULT VALUE ERROR */
schema = MODULE_CREATE_YANG("TD_ERR2",
@@ -481,7 +481,7 @@
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid default - value does not fit the type (Unsatisfied range - value \"60\" is out of the allowed range.).",
- "Schema location /TD_ERR2:port.");
+ "Schema location \"/TD_ERR2:port\".");
/* TEST DEFAULT VALUE ERROR */
schema = MODULE_CREATE_YANG("TD_ERR3",
@@ -489,7 +489,7 @@
"leaf my_leaf {type my_int_type {range \"70 .. 80\";}}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid default - value does not fit the type (Unsatisfied range - value \"127\" is out of the allowed range.).",
- "Schema location /TD_ERR3:my_leaf.");
+ "Schema location \"/TD_ERR3:my_leaf\".");
/* TEST DEFAULT HEXADECIMAL */
schema = MODULE_CREATE_YANG("DF_HEX0",
@@ -553,8 +553,8 @@
" default \"0xff\";"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_HEX2:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"0xff\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_HEX2:port\".");
/* TEST DEFAULT HEXADECIMAL ERROR */
schema = MODULE_CREATE_YANG("DF_HEX3",
@@ -563,8 +563,8 @@
" default \"-0x81\";"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_HEX3:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"-0x81\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_HEX3:port\".");
/* TEST DEFAULT HEXADECIMAL ERROR */
schema = MODULE_CREATE_YANG("DF_HEX4",
@@ -573,8 +573,8 @@
" default \"0x80\";"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_HEX4:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"0x80\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_HEX4:port\".");
/* TEST DEFAULT VALUE OCTAL */
schema = MODULE_CREATE_YANG("DF_OCT0",
@@ -631,8 +631,8 @@
" default \"0377\";"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_OCT2:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"0377\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_OCT2:port\".");
/* TEST DEFAULT VALUE OCTAL ERROR*/
schema = MODULE_CREATE_YANG("DF_OCT3",
@@ -641,8 +641,8 @@
" default \"-0201\";"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_OCT3:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"-0201\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_OCT3:port\".");
/* TEST DEFAULT VALUE OCTAL ERROR*/
schema = MODULE_CREATE_YANG("DF_OCT4",
@@ -651,8 +651,8 @@
" default \"0200\";"
"}");
UTEST_INVALID_MODULE(schema, LYS_IN_YANG, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_OCT4:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"0200\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_OCT4:port\".");
}
static void
@@ -861,8 +861,8 @@
" <type name=\"int8\"> <range value = \"min .. 0 | 1 .. 12\"/> </type>"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /TD_ERR0:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"128\" is out of type int8 min/max bounds.).",
+ "Schema location \"/TD_ERR0:port\".");
/* TEST ERROR TD1 */
schema = MODULE_CREATE_YIN("TD_ERR1",
@@ -872,7 +872,7 @@
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid default - value does not fit the type (Unsatisfied range - value \"13\" is out of the allowed range.).",
- "Schema location /TD_ERR1:port.");
+ "Schema location \"/TD_ERR1:port\".");
/* TEST ERROR TD1 */
schema = MODULE_CREATE_YIN("TD_ERR3",
@@ -886,7 +886,7 @@
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
CHECK_LOG_CTX("Invalid default - value does not fit the type (Unsatisfied range - value \"10\" is out of the allowed range.).",
- "Schema location /TD_ERR3:my_leaf.");
+ "Schema location \"/TD_ERR3:my_leaf\".");
/* TEST DEFAULT VALUE HEXADECIMAL */
schema = MODULE_CREATE_YIN("DF_HEX0",
@@ -927,8 +927,8 @@
" <type name=\"int8\" />"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_HEX2:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"0xff\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_HEX2:port\".");
/* TEST DEFAULT VALUE HEXADECIMAL ERROR */
schema = MODULE_CREATE_YIN("DF_HEX2",
@@ -937,8 +937,8 @@
" <type name=\"int8\" />"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_HEX2:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"-0x81\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_HEX2:port\".");
/* TEST DEFAULT VALUE HEXADECIMAL ERROR */
schema = MODULE_CREATE_YIN("DF_HEX4",
@@ -947,8 +947,8 @@
" <type name=\"int8\" />"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_HEX4:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"0x80\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_HEX4:port\".");
/* TEST DEFAULT VALUE OCTAL */
schema = MODULE_CREATE_YIN("DF_OCT0",
@@ -989,8 +989,8 @@
" <type name=\"int8\" />"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_OCT2:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"-0201\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_OCT2:port\".");
/* TEST DEFAULT VALUE OCTAL ERROR */
schema = MODULE_CREATE_YIN("DF_OCT3",
@@ -999,8 +999,8 @@
" <type name=\"int8\" />"
"</leaf>");
UTEST_INVALID_MODULE(schema, LYS_IN_YIN, NULL, LY_EVALID);
- CHECK_LOG_CTX("Invalid default - value does not fit the type (Value is out of int8's min/max bounds.).",
- "Schema location /DF_OCT3:port.");
+ CHECK_LOG_CTX("Invalid default - value does not fit the type (Value \"0200\" is out of type int8 min/max bounds.).",
+ "Schema location \"/DF_OCT3:port\".");
}
static void
@@ -1118,19 +1118,19 @@
TEST_SUCCESS_XML("defs", "-0", INT8, "0", 0);
TEST_ERROR_XML("defs", "-1");
CHECK_LOG_CTX("Unsatisfied range - value \"-1\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", "51");
CHECK_LOG_CTX("Unsatisfied range - value \"51\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", "106");
CHECK_LOG_CTX("Unsatisfied range - value \"106\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", "104");
CHECK_LOG_CTX("Unsatisfied range - value \"104\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", "60");
CHECK_LOG_CTX("Unsatisfied range - value \"60\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
schema = MODULE_CREATE_YANG("T0", "leaf port {type int8; }");
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
@@ -1144,17 +1144,17 @@
TEST_SUCCESS_XML("T0", "-015", INT8, "-15", -15);
TEST_SUCCESS_XML("T0", "015", INT8, "15", 15);
TEST_ERROR_XML("T0", "-129");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"-129\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_XML("T0", "128");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"128\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_XML("T0", "256");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"256\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_XML("T0", "1024");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"1024\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
/*
* default value
@@ -1195,7 +1195,7 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
TEST_ERROR_XML("T2", "120");
- CHECK_LOG_CTX_APPTAG("invalid range of value", "Schema location /T2:port, line number 1.", "range-violation");
+ CHECK_LOG_CTX_APPTAG("invalid range of value", "Schema location \"/T2:port\", line number 1.", "range-violation");
}
static void
@@ -1219,19 +1219,19 @@
TEST_SUCCESS_JSON("defs", "-0", INT8, "0", 0);
TEST_ERROR_JSON("defs", "-1");
CHECK_LOG_CTX("Unsatisfied range - value \"-1\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_JSON("defs", "51");
CHECK_LOG_CTX("Unsatisfied range - value \"51\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_JSON("defs", "106");
CHECK_LOG_CTX("Unsatisfied range - value \"106\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_JSON("defs", "104");
CHECK_LOG_CTX("Unsatisfied range - value \"104\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_JSON("defs", "60");
CHECK_LOG_CTX("Unsatisfied range - value \"60\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
schema = MODULE_CREATE_YANG("T0", "leaf port {type int8; }");
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
@@ -1246,17 +1246,17 @@
TEST_ERROR_JSON("T0", "-015");
TEST_ERROR_JSON("defs", "+50");
TEST_ERROR_JSON("T0", "-129");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"-129\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_JSON("T0", "128");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"128\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_JSON("T0", "256");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"256\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
TEST_ERROR_JSON("T0", "1024");
- CHECK_LOG_CTX("Value is out of int8's min/max bounds.",
- "Schema location /T0:port, line number 1.");
+ CHECK_LOG_CTX("Value \"1024\" is out of type int8 min/max bounds.",
+ "Schema location \"/T0:port\", line number 1.");
/*
* default value
@@ -1355,7 +1355,7 @@
"121</port>";
CHECK_PARSE_LYD_PARAM(diff_expected, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, model_1);
CHECK_LOG_CTX("Unsatisfied range - value \"121\" is out of the allowed range.",
- "Schema location /defs:port, line number 1.");
+ "Schema location \"/defs:port\", line number 1.");
/*
* diff from default value
diff --git a/tests/utests/types/leafref.c b/tests/utests/types/leafref.c
index dab2596..0e19d8b 100644
--- a/tests/utests/types/leafref.c
+++ b/tests/utests/types/leafref.c
@@ -117,7 +117,7 @@
TEST_ERROR_XML2("<leaflisttarget xmlns=\"urn:tests:defs\">x</leaflisttarget>",
"defs", "", "lref", "y", LY_EVALID);
CHECK_LOG_CTX_APPTAG("Invalid leafref value \"y\" - no target instance \"/leaflisttarget\" with the same value.",
- "Schema location /defs:lref, data location /defs:lref.", "instance-required");
+ "Schema location \"/defs:lref\", data location \"/defs:lref\".", "instance-required");
TEST_ERROR_XML2("<list xmlns=\"urn:tests:defs\"><id>x</id><targets>a</targets><targets>b</targets></list>"
"<list xmlns=\"urn:tests:defs\"><id>y</id><targets>x</targets><targets>y</targets></list>"
@@ -125,36 +125,36 @@
"defs", "", "lref2", "b", LY_EVALID);
CHECK_LOG_CTX_APPTAG("Invalid leafref value \"b\" - "
"no target instance \"../list[id = current()/../str-norestr]/targets\" with the same value.",
- "Schema location /defs:lref2, data location /defs:lref2.", "instance-required");
+ "Schema location \"/defs:lref2\", data location \"/defs:lref2\".", "instance-required");
TEST_ERROR_XML2("<list xmlns=\"urn:tests:defs\"><id>x</id><targets>a</targets><targets>b</targets></list>"
"<list xmlns=\"urn:tests:defs\"><id>y</id><targets>x</targets><targets>y</targets></list>",
"defs", "", "lref2", "b", LY_EVALID);
CHECK_LOG_CTX_APPTAG("Invalid leafref value \"b\" - "
"no existing target instance \"../list[id = current()/../str-norestr]/targets\".",
- "Schema location /defs:lref2, data location /defs:lref2.", "instance-required");
+ "Schema location \"/defs:lref2\", data location \"/defs:lref2\".", "instance-required");
TEST_ERROR_XML2("<str-norestr xmlns=\"urn:tests:defs\">y</str-norestr>",
"defs", "", "lref2", "b", LY_EVALID);
CHECK_LOG_CTX_APPTAG("Invalid leafref value \"b\" - "
"no existing target instance \"../list[id = current()/../str-norestr]/targets\".",
- "Schema location /defs:lref2, data location /defs:lref2.", "instance-required");
+ "Schema location \"/defs:lref2\", data location \"/defs:lref2\".", "instance-required");
TEST_ERROR_XML2("<str-norestr xmlns=\"urn:tests:defs\">y</str-norestr>",
"leafrefs", "", "c", "<l><id>x</id><value>x</value><lr1>a</lr1></l>", LY_EVALID);
CHECK_LOG_CTX_APPTAG("Invalid leafref value \"a\" - no target instance \"../../../t:str-norestr\" with the same value.",
- "Schema location /leafrefs:c/l/lr1, data location /leafrefs:c/l[id='x'][value='x']/lr1.", "instance-required");
+ "Schema location \"/leafrefs:c/l/lr1\", data location \"/leafrefs:c/l[id='x'][value='x']/lr1\".", "instance-required");
TEST_ERROR_XML2("<str-norestr xmlns=\"urn:tests:defs\">z</str-norestr>",
"leafrefs", "", "c", "<l><id>y</id><value>y</value></l><l><id>x</id><value>x</value><lr2>z</lr2></l>", LY_EVALID);
CHECK_LOG_CTX_APPTAG("Invalid leafref value \"z\" - no existing target instance \"../../l[id=current()/../../../t:str-norestr]"
"[value=current()/../../../t:str-norestr]/value\".",
- "Schema location /leafrefs:c/l/lr2, data location /leafrefs:c/l[id='x'][value='x']/lr2.", "instance-required");
+ "Schema location \"/leafrefs:c/l/lr2\", data location \"/leafrefs:c/l[id='x'][value='x']/lr2\".", "instance-required");
TEST_ERROR_XML2("",
"defs", "", "lref", "%n", LY_EVALID);
CHECK_LOG_CTX_APPTAG("Invalid leafref value \"%n\" - no existing target instance \"/leaflisttarget\".",
- "Schema location /defs:lref, data location /defs:lref.", "instance-required");
+ "Schema location \"/defs:lref\", data location \"/defs:lref\".", "instance-required");
}
static void
diff --git a/tests/utests/types/string.c b/tests/utests/types/string.c
index e00fec6..466c1ae 100644
--- a/tests/utests/types/string.c
+++ b/tests/utests/types/string.c
@@ -726,7 +726,7 @@
/* error */
TEST_ERROR_XML("T0", "< df");
CHECK_LOG_CTX("Child element \"df\" inside a terminal node \"port\" found.",
- "Schema location /T0:port, data location /T0:port, line number 1.");
+ "Schema location \"/T0:port\", data location \"/T0:port\", line number 1.");
TEST_ERROR_XML("T0", "&text;");
CHECK_LOG_CTX("Entity reference \"&text;</po\" not supported, only predefined references allowed.", "Line number 1.");
TEST_ERROR_XML("T0", "\"\"");
@@ -744,14 +744,14 @@
TEST_SUCCESS_XML("T1", "abcde", STRING, "abcde");
TEST_SUCCESS_XML("T1", "abcde<", STRING, "abcde<");
TEST_ERROR_XML("T1", "p4abc");
- CHECK_LOG_CTX_APPTAG("invalid pattern of value", "Schema location /T1:port, line number 1.", "pattern-violation");
+ CHECK_LOG_CTX_APPTAG("invalid pattern of value", "Schema location \"/T1:port\", line number 1.", "pattern-violation");
/* size 20 */
TEST_SUCCESS_XML("T1", "ahojahojahojahojahoj", STRING, "ahojahojahojahojahoj");
TEST_SUCCESS_XML("T1", "abc-de", STRING, "abc-de");
/* ERROR LENGTH */
TEST_ERROR_XML("T1", "p4a<");
CHECK_LOG_CTX("Unsatisfied length - string \"p4a<\" length is not allowed.",
- "Schema location /T1:port, line number 1.");
+ "Schema location \"/T1:port\", line number 1.");
/* TEST DEFAULT VALUE */
schema = MODULE_CREATE_YANG("T2",
@@ -795,10 +795,10 @@
TEST_SUCCESS_XML("T_UTF8", "€€€€€", STRING, "€€€€€");
TEST_ERROR_XML("T_UTF8", "€€€");
CHECK_LOG_CTX("Unsatisfied length - string \"€€€\" length is not allowed.",
- "Schema location /T_UTF8:port, line number 1.");
+ "Schema location \"/T_UTF8:port\", line number 1.");
TEST_ERROR_XML("T_UTF8", "€€€€€€€€");
CHECK_LOG_CTX("Unsatisfied pattern - \"€€€€€€€€\" does not conform to \"[€]{5,7}\".",
- "Schema location /T_UTF8:port, line number 1.");
+ "Schema location \"/T_UTF8:port\", line number 1.");
/* ANCHOR TEST ^$ is implicit */
schema = MODULE_CREATE_YANG("T_ANCHOR", "leaf port {type string {"
@@ -807,10 +807,10 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
TEST_ERROR_XML("T_ANCHOR", "abc");
CHECK_LOG_CTX("Unsatisfied pattern - \"abc\" does not conform to \"a.*b\".",
- "Schema location /T_ANCHOR:port, line number 1.");
+ "Schema location \"/T_ANCHOR:port\", line number 1.");
TEST_ERROR_XML("T_ANCHOR", "cab");
CHECK_LOG_CTX("Unsatisfied pattern - \"cab\" does not conform to \"a.*b\".",
- "Schema location /T_ANCHOR:port, line number 1.");
+ "Schema location \"/T_ANCHOR:port\", line number 1.");
}
static void
@@ -872,14 +872,14 @@
TEST_SUCCESS_JSON("T1", "a\\nbcde", STRING, "a\nbcde");
TEST_ERROR_JSON("T1", "p4abc\\n");
CHECK_LOG_CTX("Unsatisfied pattern - \"p4abc\n\" does not conform to inverted \"p4.*\\n\".",
- "Schema location /T1:port, line number 1.");
+ "Schema location \"/T1:port\", line number 1.");
/* size 20 */
TEST_SUCCESS_JSON("T1", "ahojahojaho\\njahojaho", STRING, "ahojahojaho\njahojaho");
TEST_SUCCESS_JSON("T1", "abc\\n-de", STRING, "abc\n-de");
/* ERROR LENGTH */
TEST_ERROR_JSON("T1", "p4a\u042F");
CHECK_LOG_CTX("Unsatisfied length - string \"p4aЯ\" length is not allowed.",
- "Schema location /T1:port, line number 1.");
+ "Schema location \"/T1:port\", line number 1.");
/* TEST DEFAULT VALUE */
schema = MODULE_CREATE_YANG("T_DEFAULT2",
@@ -917,10 +917,10 @@
TEST_SUCCESS_JSON("T_UTF8", "€€€€€", STRING, "€€€€€");
TEST_ERROR_JSON("T_UTF8", "€€€");
CHECK_LOG_CTX("Unsatisfied length - string \"€€€\" length is not allowed.",
- "Schema location /T_UTF8:port, line number 1.");
+ "Schema location \"/T_UTF8:port\", line number 1.");
TEST_ERROR_JSON("T_UTF8", "€€€€€€€€");
CHECK_LOG_CTX("Unsatisfied pattern - \"€€€€€€€€\" does not conform to \"[€]{5,7}\".",
- "Schema location /T_UTF8:port, line number 1.");
+ "Schema location \"/T_UTF8:port\", line number 1.");
/* ANCHOR TEST ^$ is implicit */
schema = MODULE_CREATE_YANG("T_ANCHOR", "leaf port {type string {"
@@ -929,10 +929,10 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
TEST_ERROR_JSON("T_ANCHOR", "abc");
CHECK_LOG_CTX("Unsatisfied pattern - \"abc\" does not conform to \"a.*b\".",
- "Schema location /T_ANCHOR:port, line number 1.");
+ "Schema location \"/T_ANCHOR:port\", line number 1.");
TEST_ERROR_JSON("T_ANCHOR", "cb");
CHECK_LOG_CTX("Unsatisfied pattern - \"cb\" does not conform to \"a.*b\".",
- "Schema location /T_ANCHOR:port, line number 1.");
+ "Schema location \"/T_ANCHOR:port\", line number 1.");
}
static void
@@ -999,7 +999,7 @@
"121</port>";
CHECK_PARSE_LYD_PARAM(diff_expected, LYD_XML, 0, LYD_VALIDATE_PRESENT, LY_EVALID, model_1);
CHECK_LOG_CTX("Unsatisfied length - string \"121\" length is not allowed.",
- "Schema location /T_DIFF:port, line number 1.");
+ "Schema location \"/T_DIFF:port\", line number 1.");
/* diff from default value */
data_1 = "<cont xmlns=\"urn:tests:T_DIFF1\"></cont>";
diff --git a/tests/utests/types/uint16.c b/tests/utests/types/uint16.c
index 3cb12fb..7cbb014 100644
--- a/tests/utests/types/uint16.c
+++ b/tests/utests/types/uint16.c
@@ -61,7 +61,7 @@
TEST_ERROR_XML("defs", "\n 1500 \t\n ");
CHECK_LOG_CTX("Unsatisfied range - value \"1500\" is out of the allowed range.",
- "Schema location /defs:port, line number 3.");
+ "Schema location \"/defs:port\", line number 3.");
}
int
diff --git a/tests/utests/types/uint32.c b/tests/utests/types/uint32.c
index 9461471..e3e6377 100644
--- a/tests/utests/types/uint32.c
+++ b/tests/utests/types/uint32.c
@@ -60,8 +60,8 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
TEST_ERROR_XML("defs", "-10");
- CHECK_LOG_CTX("Value \"-10\" is out of uint32's min/max bounds.",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Value \"-10\" is out of type uint32 min/max bounds.",
+ "Schema location \"/defs:port\", line number 1.");
}
int
diff --git a/tests/utests/types/uint64.c b/tests/utests/types/uint64.c
index f160f66..401c37c 100644
--- a/tests/utests/types/uint64.c
+++ b/tests/utests/types/uint64.c
@@ -60,16 +60,16 @@
UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
TEST_ERROR_XML("defs", "");
- CHECK_LOG_CTX("Invalid empty uint64 value.",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Invalid type uint64 empty value.",
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", " ");
- CHECK_LOG_CTX("Invalid empty uint64 value.",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Invalid type uint64 empty value.",
+ "Schema location \"/defs:port\", line number 1.");
TEST_ERROR_XML("defs", "10 xxx");
- CHECK_LOG_CTX("Invalid uint64 value \"10 xxx\".",
- "Schema location /defs:port, line number 1.");
+ CHECK_LOG_CTX("Invalid type uint64 value \"10 xxx\".",
+ "Schema location \"/defs:port\", line number 1.");
}
int
diff --git a/tests/utests/types/uint8.c b/tests/utests/types/uint8.c
index 30654fa..dad4039 100644
--- a/tests/utests/types/uint8.c
+++ b/tests/utests/types/uint8.c
@@ -63,7 +63,7 @@
TEST_ERROR_XML("defs", "\n 15 \t\n ");
CHECK_LOG_CTX("Unsatisfied range - value \"15\" is out of the allowed range.",
- "Schema location /defs:port, line number 3.");
+ "Schema location \"/defs:port\", line number 3.");
}
int
diff --git a/tests/utests/types/union.c b/tests/utests/types/union.c
index aa209d3..39d68f8 100644
--- a/tests/utests/types/union.c
+++ b/tests/utests/types/union.c
@@ -103,7 +103,7 @@
TEST_ERROR_XML2("",
"defs", "", "un1", "123456789012345678901", LY_EVALID);
CHECK_LOG_CTX("Invalid union value \"123456789012345678901\" - no matching subtype found.",
- "Schema location /defs:un1, line number 1.");
+ "Schema location \"/defs:un1\", line number 1.");
}
static void
diff --git a/tests/utests/types/yang_types.c b/tests/utests/types/yang_types.c
index 6b13b4c..6ce7671 100644
--- a/tests/utests/types/yang_types.c
+++ b/tests/utests/types/yang_types.c
@@ -130,7 +130,7 @@
TEST_ERROR_XML("a", "l", "2005-05-31T23:15:15.-08:00");
CHECK_LOG_CTX("Unsatisfied pattern - \"2005-05-31T23:15:15.-08:00\" does not conform to "
"\"\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})\".",
- "Schema location /a:l, line number 1.");
+ "Schema location \"/a:l\", line number 1.");
/* xpath1.0 */
TEST_SUCCESS_XML("a\" xmlns:aa=\"urn:tests:a", "l2", "/aa:l2[. = '4']", STRING, "/a:l2[.='4']");
@@ -144,12 +144,12 @@
TEST_SUCCESS_XML("a", "l2", "/l2[. = '4']", STRING, "/l2[.='4']");
TEST_ERROR_XML("a", "l2", "/a:l2[. = '4']");
- CHECK_LOG_CTX("Failed to resolve prefix \"a\".", "Schema location /a:l2, line number 1.");
+ CHECK_LOG_CTX("Failed to resolve prefix \"a\".", "Schema location \"/a:l2\", line number 1.");
TEST_ERROR_XML("a\" xmlns:yl=\"urn:ietf:params:xml:ns:yang:ietf-yang-library", "l2",
"/yl:yang-library/yl:datastore/yl::name");
- CHECK_LOG_CTX("Storing value failed.", "Schema location /a:l2, line number 1.",
+ CHECK_LOG_CTX("Storing value failed.", "Schema location \"/a:l2\", line number 1.",
"Invalid character 'y'[31] of expression '/yl:yang-library/yl:datastore/yl::name'.",
- "Schema location /a:l2, line number 1.");
+ "Schema location \"/a:l2\", line number 1.");
}
static void