diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-07-06 07:20:38 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-07-06 14:45:48 -0400 |
commit | fcf5189f59098785540ceb751a2db2f8061c6fce (patch) | |
tree | b1483605f48d6a832b08e16e8c1e9342918a698e | |
parent | 66ad8cb94a8ce2a53a615c66f1894dfe58b6064d (diff) | |
download | pango-fcf5189f59098785540ceb751a2db2f8061c6fce.tar.gz |
tests: Improve coverage
Spot-check a copied layout in test-break.
-rw-r--r-- | tests/test-break.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test-break.c b/tests/test-break.c index a3930937..b906a7e2 100644 --- a/tests/test-break.c +++ b/tests/test-break.c @@ -50,6 +50,7 @@ test_file (const gchar *filename, GString *string) char *text; PangoAttrList *attributes; PangoLayout *layout; + PangoLayout *layout2; g_file_get_contents (filename, &contents, &length, &error); g_assert_no_error (error); @@ -84,6 +85,14 @@ test_file (const gchar *filename, GString *string) pango_layout_get_log_attrs (layout, &attrs, &len); + layout2 = pango_layout_copy (layout); + attrs2 = pango_layout_get_log_attrs_readonly (layout2, &len2); + + g_assert_cmpint (len, ==, len2); + g_assert_true (memcmp (attrs, attrs2, sizeof (PangoLogAttr) * len) == 0); + + g_object_unref (layout2); + s1 = g_string_new ("Breaks: "); s2 = g_string_new ("Whitespace: "); s3 = g_string_new ("Words:"); |