printers CHANGE provide error information from ly_out constructors
Provide specific LY_ERR value to inform what failed when creating
ly_out structure.
diff --git a/tests/utests/data/test_parser_xml.c b/tests/utests/data/test_parser_xml.c
index e81a3f0..460eaa0 100644
--- a/tests/utests/data/test_parser_xml.c
+++ b/tests/utests/data/test_parser_xml.c
@@ -178,7 +178,7 @@
struct lyd_node *tree;
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&str, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&str, 0, &out));
data =
"<any xmlns=\"urn:tests:a\">"
@@ -327,7 +327,7 @@
struct lyd_node *tree;
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&str, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&str, 0, &out));
/* invalid value, no flags */
data = "<foo3 xmlns=\"urn:tests:a\"/>";
@@ -404,7 +404,7 @@
const struct lyd_node *node;
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&str, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&str, 0, &out));
data =
"<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" msgid=\"25\" custom-attr=\"val\">"
@@ -490,7 +490,7 @@
const struct lyd_node *node;
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&str, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&str, 0, &out));
data =
"<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" msgid=\"25\" custom-attr=\"val\">"
@@ -549,7 +549,7 @@
const struct lyd_node *node;
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&str, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&str, 0, &out));
data =
"<notification xmlns=\"urn:ietf:params:xml:ns:netconf:notification:1.0\">"
@@ -617,7 +617,7 @@
const struct lyd_node *node;
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&str, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&str, 0, &out));
data =
"<c xmlns=\"urn:tests:a\">"
diff --git a/tests/utests/data/test_printer_xml.c b/tests/utests/data/test_printer_xml.c
index ad15d16..9e46a33 100644
--- a/tests/utests/data/test_printer_xml.c
+++ b/tests/utests/data/test_printer_xml.c
@@ -182,7 +182,7 @@
struct ly_out *out;
s->func = test_leaf;
- assert_non_null(out = ly_out_new_memory(&printed, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&printed, 0, &out));
data = "<int8 xmlns=\"urn:tests:types\">\n 15 \t\n </int8>";
result = "<int8 xmlns=\"urn:tests:types\">15</int8>";
@@ -207,7 +207,7 @@
struct ly_out *out;
s->func = test_anydata;
- assert_non_null(out = ly_out_new_memory(&printed, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&printed, 0, &out));
data = "<any xmlns=\"urn:tests:types\"><somexml xmlns:x=\"url:x\" xmlns=\"example.com\"><x:x/></somexml></any>";
assert_non_null(tree = lyd_parse_mem(s->ctx, data, LYD_XML, LYD_VALOPT_DATA_ONLY));
@@ -276,7 +276,7 @@
s->func = test_defaults;
- assert_non_null(out = ly_out_new_memory(&printed, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&printed, 0, &out));
/* standard default value */
data = "<c xmlns=\"urn:defaults\">aa</c>";
diff --git a/tests/utests/data/test_validation.c b/tests/utests/data/test_validation.c
index 836ad25..f183eca 100644
--- a/tests/utests/data/test_validation.c
+++ b/tests/utests/data/test_validation.c
@@ -1022,7 +1022,7 @@
const struct lys_module *mod = ly_ctx_get_module_latest(ctx, "f");
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&str, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&str, 0, &out));
/* get defaults */
tree = NULL;
diff --git a/tests/utests/schema/test_printer_yang.c b/tests/utests/schema/test_printer_yang.c
index 9e0f707..feea18e 100644
--- a/tests/utests/schema/test_printer_yang.c
+++ b/tests/utests/schema/test_printer_yang.c
@@ -135,7 +135,7 @@
struct ly_out *out;
size_t size = 0;
- assert_non_null(out = ly_out_new_memory(&printed, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&printed, 0, &out));
assert_int_equal(LY_SUCCESS, ly_ctx_new(NULL, 0, &ctx));
assert_non_null(mod = lys_parse_mem(ctx, orig, LYS_IN_YANG));
diff --git a/tests/utests/schema/test_printer_yin.c b/tests/utests/schema/test_printer_yin.c
index 7ab8b0e..8a1fee9 100644
--- a/tests/utests/schema/test_printer_yin.c
+++ b/tests/utests/schema/test_printer_yin.c
@@ -583,7 +583,7 @@
char *printed;
struct ly_out *out;
- assert_non_null(out = ly_out_new_memory(&printed, 0));
+ assert_int_equal(LY_SUCCESS, ly_out_new_memory(&printed, 0, &out));
assert_int_equal(LY_SUCCESS, ly_ctx_new(NULL, 0, &ctx));
assert_non_null(mod = lys_parse_mem(ctx, orig, LYS_IN_YANG));