leafref OPTIMIZE hash-based target search if possible
diff --git a/tests/utests/data/test_validation.c b/tests/utests/data/test_validation.c
index c582399..7126370 100644
--- a/tests/utests/data/test_validation.c
+++ b/tests/utests/data/test_validation.c
@@ -1185,7 +1185,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\".",
+ 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\".");
ly_in_free(in, 0);
@@ -1278,7 +1278,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\".",
+ 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\".");
CHECK_PARSE_LYD_PARAM("<cont xmlns=\"urn:tests:j\">\n"
diff --git a/tests/utests/extensions/test_schema_mount.c b/tests/utests/extensions/test_schema_mount.c
index 130268c..7d3ec3c 100644
--- a/tests/utests/extensions/test_schema_mount.c
+++ b/tests/utests/extensions/test_schema_mount.c
@@ -1121,7 +1121,7 @@
"<target xmlns=\"urn:sm\">wrong-target-value</target>\n";
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\".",
+ "Invalid leafref value \"target-value\" - no target instance \"/sm:target\" with the same value.",
"Schema location \"/ietf-interfaces:interfaces/interface/sm:sm-name\", "
"data location \"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name\".");
@@ -1147,7 +1147,7 @@
"}\n";
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\".",
+ "Invalid leafref value \"target-value\" - no target instance \"/sm:target\" with the same value.",
"Schema location \"/ietf-interfaces:interfaces/interface/sm:sm-name\", "
"data location \"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name\", line number 18.");
diff --git a/tests/utests/types/leafref.c b/tests/utests/types/leafref.c
index 0e19d8b..d304b2e 100644
--- a/tests/utests/types/leafref.c
+++ b/tests/utests/types/leafref.c
@@ -131,13 +131,13 @@
"<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\".",
+ "no target instance \"../list[id = current()/../str-norestr]/targets\" with the same value.",
"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\".",
+ "no target instance \"../list[id = current()/../str-norestr]/targets\" with the same value.",
"Schema location \"/defs:lref2\", data location \"/defs:lref2\".", "instance-required");
TEST_ERROR_XML2("<str-norestr xmlns=\"urn:tests:defs\">y</str-norestr>",
@@ -147,13 +147,13 @@
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\".",
+ CHECK_LOG_CTX_APPTAG("Invalid leafref value \"z\" - no target instance \"../../l[id=current()/../../../t:str-norestr]"
+ "[value=current()/../../../t:str-norestr]/value\" with the same value.",
"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\".",
+ CHECK_LOG_CTX_APPTAG("Invalid leafref value \"%n\" - no target instance \"/leaflisttarget\" with the same value.",
"Schema location \"/defs:lref\", data location \"/defs:lref\".", "instance-required");
}