[pango/fix-cluster-accounting: 4/4] wip: A more biting layout width test




commit 2983e5a3ac9135add9026fb2872b175bfc7203ce
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Nov 10 23:47:16 2021 -0500

    wip: A more biting layout width test

 tests/testmisc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/tests/testmisc.c b/tests/testmisc.c
index a91dcbb3..adf76f2a 100644
--- a/tests/testmisc.c
+++ b/tests/testmisc.c
@@ -758,24 +758,28 @@ static void
 test_wrap_char (void)
 {
   PangoContext *context;
+  PangoFontDescription *desc;
   PangoLayout *layout;
   int w, h, w0, h0;
 
   context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
+  desc = pango_font_description_from_string ("Sans 10");
   layout = pango_layout_new (context);
+  pango_layout_set_font_description (layout, desc);
   pango_layout_set_text (layout, "Rows can have suffix widgets", -1);
   pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
 
   pango_layout_set_width (layout, 0);
   pango_layout_get_size (layout, &w0, &h0);
+  g_assert_cmpint (w0, <=, 25136);
 
-  pango_layout_set_width (layout, w0);
+  pango_layout_set_width (layout, 25136);
   pango_layout_get_size (layout, &w, &h);
 
-  g_assert_cmpint (w0, ==, w);
-  g_assert_cmpint (h0, >=, h);
+  g_assert_cmpint (w, <=, 25136);
 
   g_object_unref (layout);
+  pango_font_description_free (desc);
   g_object_unref (context);
 }
 


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