diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-05-08 23:43:35 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-05-08 23:44:38 -0400 |
commit | 10895f2d9794fb36820c827a3a68b3ee1559ac20 (patch) | |
tree | 264e70023640171befbdcd2668baf8287e5d2099 /tests/testmisc.c | |
parent | b3ebe097a3042737165ba497dc5b08f235df8167 (diff) | |
download | pango-10895f2d9794fb36820c827a3a68b3ee1559ac20.tar.gz |
Make pango_layout_line_get_height workfix-layout-line-height
We were just never setting the height. Ouch!
Test included.
Fixes: #487
Diffstat (limited to 'tests/testmisc.c')
-rw-r--r-- | tests/testmisc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/testmisc.c b/tests/testmisc.c index 1697b7cd..06b39a7a 100644 --- a/tests/testmisc.c +++ b/tests/testmisc.c @@ -101,6 +101,26 @@ test_language_emoji_crash (void) g_assert (scripts == NULL || num > 0); } +static void +test_line_height (void) +{ + PangoContext *context; + PangoLayout *layout; + PangoLayoutLine *line; + int height = 0; + + 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); + line = pango_layout_get_line_readonly (layout, 0); + pango_layout_line_get_height (line, &height); + + g_assert_cmpint (height, >, 0); + + g_object_unref (layout); + g_object_unref (context); +} + int main (int argc, char *argv[]) { @@ -111,6 +131,7 @@ main (int argc, char *argv[]) g_test_add_func ("/layout/itemize-utf8", test_itemize_utf8); g_test_add_func ("/layout/short-string-crash", test_short_string_crash); g_test_add_func ("/language/emoji-crash", test_language_emoji_crash); + g_test_add_func ("/layout/line-height", test_line_height); return g_test_run (); } |