diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-07-30 10:04:58 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-07-30 10:10:29 -0400 |
commit | c2c9733047a524b794ba11208c758264d266ad20 (patch) | |
tree | f9231b310778a555d43aa6343941df7cebc40cd9 /tests/testmisc.c | |
parent | 6e04db81b9dc5913607bd97e1000d59c6ed0c496 (diff) | |
download | pango-c2c9733047a524b794ba11208c758264d266ad20.tar.gz |
Add a reproducer for a pidgin crash
This test is reproducing the crash reported in #490.
Diffstat (limited to 'tests/testmisc.c')
-rw-r--r-- | tests/testmisc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/testmisc.c b/tests/testmisc.c index f5583cab..9f1f24da 100644 --- a/tests/testmisc.c +++ b/tests/testmisc.c @@ -54,6 +54,25 @@ test_itemize_empty_crash (void) g_object_unref (context); } +/* Test that pango_layout_set_text (layout, "short", 200) + * does not lead to a crash. (pidgin does this) + */ +static void +test_short_string_crash (void) +{ + PangoContext *context; + PangoLayout *layout; + int width, height; + + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + layout = pango_layout_new (context); + pango_layout_set_text (layout, "short text", 200); + pango_layout_get_pixel_size (layout, &width, &height); + + g_object_unref (layout); + g_object_unref (context); +} + int main (int argc, char *argv[]) { @@ -61,6 +80,7 @@ main (int argc, char *argv[]) g_test_add_func ("/layout/shape-tab-crash", test_shape_tab_crash); g_test_add_func ("/layout/itemize-empty-crash", test_itemize_empty_crash); + g_test_add_func ("/layout/short-string-crash", test_short_string_crash); return g_test_run (); } |