summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-11-21 23:01:53 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-11-24 19:57:58 -0500
commitc1f9c9f85bf9f400e44477304e5eb135f1183ac9 (patch)
tree76b58ba908a57ee66e513cf3965161ed7fe70977 /tests
parent12a46f672c5fb5c6232218f02018c30cd44a16e2 (diff)
downloadpango-c1f9c9f85bf9f400e44477304e5eb135f1183ac9.tar.gz
Add flags to serialize and deserialize
This gives us some room to add more things to these apis, e.g. a way to store not just the input part of a layout, but also the output.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-layout.c2
-rw-r--r--tests/testserialize.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 7415efe7..f4b36c77 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -236,7 +236,7 @@ test_file (const char *filename, GString *string)
bytes = g_bytes_new_take (contents, length);
- layout = pango_layout_deserialize (context, bytes, &error);
+ layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_DEFAULT, &error);
g_assert_no_error (error);
g_bytes_unref (bytes);
diff --git a/tests/testserialize.c b/tests/testserialize.c
index b09b6ac3..d04ec7cf 100644
--- a/tests/testserialize.c
+++ b/tests/testserialize.c
@@ -142,7 +142,7 @@ test_serialize_layout_minimal (void)
bytes = g_bytes_new_static (test, -1);
- layout = pango_layout_deserialize (context, bytes, &error);
+ layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_DEFAULT, &error);
g_assert_no_error (error);
g_assert_true (PANGO_IS_LAYOUT (layout));
g_assert_cmpstr (pango_layout_get_text (layout), ==, "Almost nothing");
@@ -152,7 +152,7 @@ test_serialize_layout_minimal (void)
g_assert_cmpint (pango_layout_get_alignment (layout), ==, PANGO_ALIGN_LEFT);
g_assert_cmpint (pango_layout_get_width (layout), ==, -1);
- out_bytes = pango_layout_serialize (layout);
+ out_bytes = pango_layout_serialize (layout, PANGO_LAYOUT_SERIALIZE_DEFAULT);
str = g_bytes_get_data (out_bytes, NULL);
g_assert_cmpstr (str, ==, test);
@@ -215,7 +215,7 @@ test_serialize_layout_valid (void)
bytes = g_bytes_new_static (test, -1);
- layout = pango_layout_deserialize (context, bytes, &error);
+ layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_DEFAULT, &error);
g_assert_no_error (error);
g_assert_true (PANGO_IS_LAYOUT (layout));
g_assert_cmpstr (pango_layout_get_text (layout), ==, "Some fun with layouts!");
@@ -230,7 +230,7 @@ test_serialize_layout_valid (void)
g_assert_cmpint (pango_layout_get_width (layout), ==, 350000);
g_assert_cmpfloat_with_epsilon (pango_layout_get_line_spacing (layout), 1.5, 0.0001);
- out_bytes = pango_layout_serialize (layout);
+ out_bytes = pango_layout_serialize (layout, PANGO_LAYOUT_SERIALIZE_DEFAULT);
str = g_bytes_get_data (out_bytes, NULL);
g_assert_cmpstr (str, ==, test);
@@ -299,7 +299,7 @@ test_serialize_layout_invalid (void)
GError *error = NULL;
bytes = g_bytes_new_static (test[i].json, -1);
- layout = pango_layout_deserialize (context, bytes, &error);
+ layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_DEFAULT, &error);
g_assert_null (layout);
g_assert_error (error, PANGO_LAYOUT_DESERIALIZE_ERROR, test[i].expected_error);
g_bytes_unref (bytes);