From 2983e5a3ac9135add9026fb2872b175bfc7203ce Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 10 Nov 2021 23:47:16 -0500 Subject: 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); } -- cgit v1.2.1