summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-06-11 14:02:15 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-06-11 14:03:38 -0400
commit21081ce6a196f3665f06ce6fee013ed513f7acd7 (patch)
treedbf9492a8025421a551c3571d8b6924a86773233
parent0679991e1633636bb29e7f2c204f6522f9541b63 (diff)
downloadpango-21081ce6a196f3665f06ce6fee013ed513f7acd7.tar.gz
test-break: Some fixes
Try to make test-break not fail on my system. First I made it skip tests that produce missing glyphs, then I made it call setlocale(). In the end, I needed to just install the right Thai fonts. But these fixes are still useful.
-rw-r--r--tests/test-break.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test-break.c b/tests/test-break.c
index aec36008..df9b78e2 100644
--- a/tests/test-break.c
+++ b/tests/test-break.c
@@ -70,6 +70,14 @@ test_file (const gchar *filename, GString *string)
layout = pango_layout_new (context);
pango_layout_set_text (layout, text, length);
pango_layout_set_attributes (layout, attributes);
+
+ if (pango_layout_get_unknown_glyphs_count (layout) > 0)
+ {
+ char *msg = g_strdup_printf ("Missing glyphs - skipping %s. Maybe fonts are missing?", filename);
+ g_test_skip (msg);
+ g_free (msg);
+ }
+
pango_layout_get_log_attrs (layout, &attrs, &len);
s1 = g_string_new ("Breaks: ");
@@ -251,9 +259,6 @@ test_break (gconstpointer d)
return;
}
- if (context == NULL)
- context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
-
expected_file = get_expected_filename (filename);
dump = g_string_sized_new (0);
@@ -296,6 +301,10 @@ main (int argc, char *argv[])
g_test_init (&argc, &argv, NULL);
+ setlocale (LC_ALL, "");
+
+ context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
+
/* allow to easily generate expected output for new test cases */
if (argc > 1)
{