printers CHANGE unify formatting options for data and schema printers
Replaces LYD_PRINT_FORMAT by the LYD_PRINT_SHRINK with the inverse
meaning. This way the default formating (do format output) is unified
between data and schema printers. The commit also introduces
LYS_PRINT_SHRINK with the same value to have the option explicitely also
for the schema printers and to allow to print schemas without
unnecessary indentations and new lines.
diff --git a/tests/utests/data/test_merge.c b/tests/utests/data/test_merge.c
index 95e2f86..5d3050c 100644
--- a/tests/utests/data/test_merge.c
+++ b/tests/utests/data/test_merge.c
@@ -246,7 +246,7 @@
st->source = NULL;
}
- lyd_print_mem(&str, st->target, LYD_XML, 0);
+ lyd_print_mem(&str, st->target, LYD_XML, LYD_PRINT_SHRINK);
assert_string_equal(str, output_template);
ly_in_free(in, 0);
@@ -285,7 +285,7 @@
assert_int_equal(lyd_validate_all(&st->target, NULL, LYD_VALIDATE_PRESENT, NULL), LY_SUCCESS);
/* check the result */
- lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS);
+ lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS | LYD_PRINT_SHRINK);
assert_string_equal(printed, result);
free(printed);
}
@@ -327,7 +327,7 @@
assert_int_equal(lyd_validate_all(&st->target, NULL, LYD_VALIDATE_PRESENT, NULL), LY_SUCCESS);
/* check the result */
- lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS);
+ lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS | LYD_PRINT_SHRINK);
assert_string_equal(printed, result);
free(printed);
}
@@ -397,7 +397,7 @@
assert_int_equal(lyd_validate_all(&st->target, NULL, LYD_VALIDATE_PRESENT, NULL), LY_SUCCESS);
/* check the result */
- lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS);
+ lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS | LYD_PRINT_SHRINK);
assert_string_equal(printed, result);
free(printed);
}
@@ -476,7 +476,7 @@
assert_int_equal(lyd_validate_all(&st->target, NULL, LYD_VALIDATE_PRESENT, NULL), LY_SUCCESS);
/* check the result */
- lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS);
+ lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS | LYD_PRINT_SHRINK);
assert_string_equal(printed, result);
free(printed);
}
@@ -534,7 +534,7 @@
assert_int_equal(lyd_validate_all(&st->target, NULL, LYD_VALIDATE_PRESENT, NULL), LY_SUCCESS);
/* check the result */
- lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS);
+ lyd_print_mem(&printed, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS | LYD_PRINT_SHRINK);
assert_string_equal(printed, result);
free(printed);
}
@@ -646,7 +646,7 @@
assert_int_equal(lyd_merge_siblings(&st->target, st->source, 0), LY_SUCCESS);
- lyd_print_mem(&prt, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS);
+ lyd_print_mem(&prt, st->target, LYD_XML, LYD_PRINT_WITHSIBLINGS | LYD_PRINT_SHRINK);
assert_string_equal(prt, res);
free(prt);
}