log UPDATE parser data path print
Fixes #1930
diff --git a/tests/utests/data/test_parser_json.c b/tests/utests/data/test_parser_json.c
index 4fdc1bf..a44e6b6 100644
--- a/tests/utests/data/test_parser_json.c
+++ b/tests/utests/data/test_parser_json.c
@@ -28,7 +28,10 @@
{
const char *schema = "module a {namespace urn:tests:a;prefix a;yang-version 1.1; import ietf-yang-metadata {prefix md;}"
"md:annotation hint { type int8;}"
- "list l1 { key \"a b c\"; leaf a {type string;} leaf b {type string;} leaf c {type int16;} leaf d {type string;}}"
+ "list l1 { key \"a b c\"; leaf a {type string;} leaf b {type string;} leaf c {type int16;}"
+ " leaf d {type string;}"
+ " container cont {leaf e {type boolean;}}"
+ "}"
"leaf foo { type string;}"
"container c {"
" leaf x {type string;}"
@@ -148,6 +151,12 @@
"Metadata in JSON must be namespace-qualified, missing prefix for \"hint\".",
"Schema location \"/a:foo\", line number 1.");
+ /* invalid JSON type */
+ data = "{\"a:l1\" : [{ \"a\" : \"val-a\", \"b\" : \"val-b\", \"c\" : 1, \"cont\" : { \"e\" : \"0\" } }]}";
+ PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
+ "Invalid non-boolean-encoded boolean value \"0\".",
+ "Data location \"/a:l1[a='val-a'][b='val-b'][c='1']/cont/e\", line number 1.");
+
/* reverse solidus in JSON object member name */
data = "{\"@a:foo\":{\"a:hi\\nt\":1},\"a:foo\":\"xxx\"}";
assert_int_equal(LY_EINVAL, lyd_parse_data_mem(UTEST_LYCTX, data, LYD_JSON, 0, LYD_VALIDATE_PRESENT, &tree));
@@ -391,18 +400,18 @@
/* 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.");
+ "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\".", "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\".", "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.");
+ "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);
@@ -416,7 +425,7 @@
assert_non_null(leaf = (struct lyd_node_term *)leaf->next);
CHECK_LYSC_NODE(leaf->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR | LYS_KEY, 1, "c", 1, LYS_LEAF, 1, 0, NULL, 0);
assert_non_null(leaf = (struct lyd_node_term *)leaf->next);
- CHECK_LYSC_NODE(leaf->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR, 1, "d", 0, LYS_LEAF, 1, 0, NULL, 0);
+ CHECK_LYSC_NODE(leaf->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR, 1, "d", 1, LYS_LEAF, 1, 0, NULL, 0);
CHECK_LOG_CTX(NULL, NULL);
CHECK_LYD_STRING(tree, LYD_PRINT_SHRINK | LYD_PRINT_WITHSIBLINGS,
@@ -511,7 +520,7 @@
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.");
+ "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);
@@ -523,7 +532,7 @@
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.");
+ "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);
diff --git a/tests/utests/data/test_parser_xml.c b/tests/utests/data/test_parser_xml.c
index 4e5cc2e..271cc4b 100644
--- a/tests/utests/data/test_parser_xml.c
+++ b/tests/utests/data/test_parser_xml.c
@@ -30,12 +30,10 @@
" namespace urn:tests:a;\n"
" prefix a;\n"
" yang-version 1.1;\n"
- " list l1 {\n"
- " key \"a b c\";\n"
- " leaf a {type string;}\n"
- " leaf b {type string;}\n"
- " leaf c {type int16;}\n"
- " leaf d {type string;}}\n"
+ " list l1 { key \"a b c\"; leaf a {type string;} leaf b {type string;} leaf c {type int16;}"
+ " leaf d {type string;}"
+ " container cont {leaf e {type boolean;}}"
+ " }"
" leaf foo { type string;}\n"
" container c {\n"
" leaf x {type string;}\n"
@@ -85,7 +83,6 @@
leaf = (struct lyd_node_term *)tree->next->next;
CHECK_LYD_VALUE(leaf->value, STRING, "default-val");
assert_true(leaf->flags & LYD_DEFAULT);
-
lyd_free_all(tree);
/* make foo2 explicit */
@@ -98,7 +95,6 @@
leaf = (struct lyd_node_term *)tree;
CHECK_LYD_VALUE(leaf->value, STRING, "default-val");
assert_false(leaf->flags & LYD_DEFAULT);
-
lyd_free_all(tree);
/* parse foo2 but make it implicit, skip metadata xxx from missing schema */
@@ -112,8 +108,13 @@
leaf = (struct lyd_node_term *)tree;
CHECK_LYD_VALUE(leaf->value, STRING, "default-val");
assert_true(leaf->flags & LYD_DEFAULT);
-
lyd_free_all(tree);
+
+ /* invalid value */
+ data = "<l1 xmlns=\"urn:tests:a\"><a>val-a</a><b>val-b</b><c>1</c><cont><e>0</e></cont></l1>";
+ PARSER_CHECK_ERROR(data, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
+ "Invalid boolean value \"0\".",
+ "Data location \"/a:l1[a='val-a'][b='val-b'][c='1']/cont/e\", line number 1.");
}
static void
@@ -133,6 +134,7 @@
tree = tree->next;
CHECK_LYSC_NODE(tree->schema, NULL, 0, LYS_CONFIG_R | LYS_STATUS_CURR | LYS_SET_CONFIG, 1, "any",
1, LYS_ANYDATA, 0, 0, NULL, 0);
+
const char *data_expected =
"<any xmlns=\"urn:tests:a\">\n"
" <element1>\n"
@@ -142,7 +144,6 @@
"</any>\n";
CHECK_LYD_STRING(tree, LYD_PRINT_WITHSIBLINGS, data_expected);
-
lyd_free_all(tree);
}
@@ -167,18 +168,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\".", "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\".", "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\".", "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.");
+ "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);
@@ -192,7 +193,7 @@
assert_non_null(leaf = (struct lyd_node_term *)leaf->next);
CHECK_LYSC_NODE(leaf->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR | LYS_KEY, 1, "c", 1, LYS_LEAF, 1, 0, NULL, 0);
assert_non_null(leaf = (struct lyd_node_term *)leaf->next);
- CHECK_LYSC_NODE(leaf->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR, 1, "d", 0, LYS_LEAF, 1, 0, NULL, 0);
+ CHECK_LYSC_NODE(leaf->schema, NULL, 0, LYS_CONFIG_W | LYS_STATUS_CURR, 1, "d", 1, LYS_LEAF, 1, 0, NULL, 0);
CHECK_LOG_CTX("Invalid position of the key \"b\" in a list.", NULL);
lyd_free_all(tree);
@@ -210,7 +211,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.", "Data location \"/a:l1[c='1']/b\", line number 1.");
}
static void
@@ -267,7 +268,7 @@
"</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.");
+ "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);
@@ -283,7 +284,7 @@
"</l1>\n";
PARSER_CHECK_ERROR(data, 0, LYD_VALIDATE_PRESENT, tree, LY_EVALID,
"Invalid type int16 value \"val_c\".",
- "Schema location \"/a:l1/c\", data location \"/a:l1[a='val_a'][b='val_b']\", line number 4.");
+ "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 7181782..b8e4b03 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.", "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.", "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.", "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);
@@ -267,7 +267,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.", "Data location \"/c:lt[k='val5']\".",
"too-many-elements");
}
@@ -356,7 +356,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");
+ "Data location \"/d:lt[k='val2']\".", "data-not-unique");
/* now try with more instances */
LYD_TREE_CREATE("<lt xmlns=\"urn:tests:d\">\n"
@@ -454,7 +454,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");
+ "Data location \"/d:lt[k='val2']\".", "data-not-unique");
}
static void
@@ -580,7 +580,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");
+ "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"
@@ -618,7 +618,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");
+ "Data location \"/d:lt2[k='val2']\".", "data-not-unique");
CHECK_PARSE_LYD_PARAM("<lt2 xmlns=\"urn:tests:d\">\n"
" <k>val1</k>\n"
@@ -664,7 +664,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");
+ "Data location \"/d:lt2[k='val3']\".", "data-not-unique");
}
static void
@@ -725,28 +725,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\".", "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\".", "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\".", "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\".", "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\".", "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>"
@@ -755,12 +755,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\".", "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\".", "Data location \"/e:cont/ll[.='d']\", line number 1.");
/* cases */
CHECK_PARSE_LYD_PARAM("<l xmlns=\"urn:tests:e\">a</l>"
@@ -768,7 +768,7 @@
"<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\".", "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>"
@@ -1095,12 +1095,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.");
+ "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\".");
+ "Data location \"/h:cont/cont2\".");
lyd_free_all(tree);
}
@@ -1139,7 +1139,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");
+ "Data location \"/i:cont/l2\".", "must-violation");
LYD_TREE_CREATE("<cont xmlns=\"urn:tests:i\">\n"
" <l>right</l>\n"
@@ -1151,7 +1151,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", "Data location \"/i:cont/l3\".", "not-left");
}
const char *schema_j =
@@ -1228,7 +1228,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 target instance \"/lf3\" with the same value.",
- "Schema location \"/j:cont/l1/act/input/lf2\", data location \"/j:cont/l1[k='val1']/act/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"
@@ -1292,8 +1292,8 @@
"</modify-user-password>";
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.");
+ CHECK_LOG_CTX("Unsatisfied length - string \"123\" length is not allowed.",
+ "Data location \"/val-str:modify-user-password\", line number 3.");
ly_in_free(in, 0);
}
@@ -1321,7 +1321,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 target instance \"/lf4\" with the same value.",
- "Schema location \"/j:cont/l1/act/output/lf2\", data location \"/j:cont/l1[k='val1']/act/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"
@@ -1422,7 +1422,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.");
+ "Data location \"/k:ch\", line number 5.");
CHECK_PARSE_LYD_PARAM(
"{\n"
@@ -1432,7 +1432,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.");
+ "Data location \"/k:ch\", line number 5.");
}
int