Commit 21081ce6 authored by Matthias Clasen's avatar Matthias Clasen

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.
parent 0679991e
......@@ -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)
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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment