libyang REFACTOR avoid connection between context and log location storage
libyang works strictly with a single context now, so it is not necessary
to connect the log location information with a specific context. It also
clarifies what to do when the context is not available in the function
but still a location information in an error message could be useful.
diff --git a/tests/utests/basic/test_xml.c b/tests/utests/basic/test_xml.c
index 9c9c62a..aa13893 100644
--- a/tests/utests/basic/test_xml.c
+++ b/tests/utests/basic/test_xml.c
@@ -377,7 +377,7 @@
/* empty value but in single quotes */
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\'\'", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_SUCCESS, lyxml_ctx_next(xmlctx));
assert_int_equal(LYXML_ATTR_CONTENT, xmlctx->status);
@@ -389,7 +389,7 @@
/* empty element content - only formating before defining child */
assert_int_equal(LY_SUCCESS, ly_in_new_memory(">\n <y>", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ELEMENT;
assert_int_equal(LY_SUCCESS, lyxml_ctx_next(xmlctx));
assert_int_equal(LYXML_ELEM_CONTENT, xmlctx->status);
@@ -401,7 +401,7 @@
/* empty element content is invalid - missing content terminating character < */
assert_int_equal(LY_SUCCESS, ly_in_new_memory("", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ELEM_CONTENT;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Unexpected end-of-input.", "Line number 1.");
@@ -409,7 +409,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory("xxx", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ELEM_CONTENT;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Invalid character sequence \"xxx\", expected element tag start ('<').", "Line number 1.");
@@ -434,7 +434,7 @@
/* test using n-bytes UTF8 hexadecimal code points */
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\'$¢€𐍈\'", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_SUCCESS, lyxml_ctx_next(xmlctx));
assert_int_equal(LYXML_ATTR_CONTENT, xmlctx->status);
@@ -447,7 +447,7 @@
/* invalid characters in string */
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\'R\'", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Invalid character sequence \"'\", expected ;.", "Line number 1.");
@@ -455,7 +455,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\"R\"", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Invalid character sequence \"\"\", expected ;.", "Line number 1.");
@@ -463,7 +463,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\"&nonsense;\"", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Entity reference \"&nonsense;\" not supported, only predefined references allowed.", "Line number 1.");
@@ -471,7 +471,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory(">&#o122;", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ELEMENT;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Invalid character reference \"&#o122;\".", "Line number 1.");
@@ -479,7 +479,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\'\'", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Invalid character reference \"\'\" (0x00000006).", "Line number 1.");
@@ -487,7 +487,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\'\'", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Invalid character reference \"\'\" (0x0000fdd0).", "Line number 1.");
@@ -495,7 +495,7 @@
assert_int_equal(LY_SUCCESS, ly_in_new_memory("=\'\'", &in));
xmlctx->in = in;
- LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, in);
+ LOG_LOCINIT(NULL, NULL, NULL, in);
xmlctx->status = LYXML_ATTRIBUTE;
assert_int_equal(LY_EVALID, lyxml_ctx_next(xmlctx));
CHECK_LOG_CTX("Invalid character reference \"\'\" (0x0000ffff).", "Line number 1.");