tests: Reduce number of random fonts
authorBenjamin Otte <otte@redhat.com>
Thu, 13 Jul 2023 10:56:17 +0000 (12:56 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Jul 2023 11:16:43 +0000 (13:16 +0200)
We were clowing through all the Pango caches for no benefit.

It made the test generation stuck in fontconfig loops instead of
quickly generating tests.

So don't do that and limit the different fonts to some reasonable list
of options.

tests/rendernode-create-tests.c

index 2bd7a3876b3a43d9021ca7183a103dc0657eb53a..e2028b39b2a2095f7a84cd1770a2de5e763d3e65 100644 (file)
@@ -407,8 +407,8 @@ text (guint n)
       else
         pango_font_description_set_style (desc, PANGO_STYLE_NORMAL);
 
-      pango_font_description_set_weight (desc, 100 * g_random_int_range (1, 10));
-      pango_font_description_set_size (desc, PANGO_SCALE * g_random_int_range (8,32));
+      pango_font_description_set_weight (desc, 200 * g_random_int_range (1, 5));
+      pango_font_description_set_size (desc, PANGO_SCALE * 4 * g_random_int_range (2,8));
 
       font = pango_context_load_font (context, desc);
       pango_layout_set_font_description (layout, desc);