diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-06-09 15:45:44 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-06-09 15:45:44 +0000 |
commit | 8342c1ca220aa256d6cf1829c96886900713b6eb (patch) | |
tree | 141f0a3e44fab5f64ff39b7ba2d3ec545bf17d7a /tests/testmisc.c | |
parent | 217dace17ae69b0c3035dc4fedbb0b3d278ab801 (diff) | |
parent | 2751956b09f8f4dbedc07f2e0653419bfd9875ff (diff) | |
download | pango-8342c1ca220aa256d6cf1829c96886900713b6eb.tar.gz |
Merge branch 'fix-shape-tab-crash' into 'master'
Fix shape tab crash
See merge request GNOME/pango!192
Diffstat (limited to 'tests/testmisc.c')
-rw-r--r-- | tests/testmisc.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/testmisc.c b/tests/testmisc.c new file mode 100644 index 00000000..3e629f24 --- /dev/null +++ b/tests/testmisc.c @@ -0,0 +1,49 @@ +/* Pango + * testmisc.c: Test program for miscellaneous things + * + * Copyright (C) 2020 Matthias Clasen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include <glib.h> +#include <pango/pangocairo.h> + +static void +test_shape_tab_crash (void) +{ + PangoContext *context; + PangoLayout *layout; + + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + layout = pango_layout_new (context); + pango_layout_set_text (layout, "one\ttwo", -1); + pango_layout_is_ellipsized (layout); + + g_object_unref (layout); + g_object_unref (context); +} + +int +main (int argc, char *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/layout/shape-tab-crash", test_shape_tab_crash); + + return g_test_run (); +} |