libyang REFACTOR parsed/printed bytes in in/out structs
diff --git a/tests/utests/schema/test_printer_yang.c b/tests/utests/schema/test_printer_yang.c
index 24e8b31..6352695 100644
--- a/tests/utests/schema/test_printer_yang.c
+++ b/tests/utests/schema/test_printer_yang.c
@@ -133,16 +133,17 @@
"}\n";
char *printed;
struct ly_out *out;
- size_t size = 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));
- assert_int_equal(strlen(orig), size = lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(LY_SUCCESS, lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(strlen(orig), ly_out_printed(out));
assert_string_equal(printed, orig);
ly_out_reset(out);
- assert_int_equal(strlen(compiled), lys_print(out, mod, LYS_OUT_YANG_COMPILED, 0, 0));
+ assert_int_equal(LY_SUCCESS, lys_print(out, mod, LYS_OUT_YANG_COMPILED, 0, 0));
+ assert_int_equal(strlen(compiled), ly_out_printed(out));
assert_string_equal(printed, compiled);
ly_out_reset(out);
@@ -188,10 +189,12 @@
" }\n"
"}\n";
assert_non_null(mod = lys_parse_mem(ctx, orig, LYS_IN_YANG));
- assert_int_equal(strlen(orig), lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(LY_SUCCESS, lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(strlen(orig), ly_out_printed(out));
assert_string_equal(printed, orig);
ly_out_reset(out);
- assert_int_equal(strlen(compiled), lys_print(out, mod, LYS_OUT_YANG_COMPILED, 0, 0));
+ assert_int_equal(LY_SUCCESS, lys_print(out, mod, LYS_OUT_YANG_COMPILED, 0, 0));
+ assert_int_equal(strlen(compiled), ly_out_printed(out));
assert_string_equal(printed, compiled);
ly_out_reset(out);
@@ -213,10 +216,12 @@
" }\n"
"}\n";
assert_non_null(mod = lys_parse_mem(ctx, orig, LYS_IN_YANG));
- assert_int_equal(strlen(orig), lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(LY_SUCCESS, lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(strlen(orig), ly_out_printed(out));
assert_string_equal(printed, orig);
ly_out_reset(out);
- assert_int_equal(strlen(compiled), lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(LY_SUCCESS, lys_print(out, mod, LYS_OUT_YANG, 0, 0));
+ assert_int_equal(strlen(compiled), ly_out_printed(out));
assert_string_equal(printed, compiled);
/* missing free(printed); which is done in the following lyp_free() */