[pango/more-test-coverage2: 10/15] tests: Improve coverage




commit fcf5189f59098785540ceb751a2db2f8061c6fce
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jul 6 07:20:38 2021 -0400

    tests: Improve coverage
    
    Spot-check a copied layout in test-break.

 tests/test-break.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
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:");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]