diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-04-14 13:11:49 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-04-14 13:13:51 +0100 |
commit | 3fc1a9bff1892f92d96bcf1fb86c157885673396 (patch) | |
tree | 209a6db48983052ef79396e09041f13c9f6f7a85 /tests/test-font.c | |
parent | 2a773323f1f7b5510ee0de7a1ea0ac8bec0e05d4 (diff) | |
download | pango-3fc1a9bff1892f92d96bcf1fb86c157885673396.tar.gz |
tests: Use the appropriate GTest API
Do not use homegrown assertion and failure macros, when GTest has
perfectly functional API to deal with all the cases Pango covers.
Using GTest also allows us to rely on appropriate formatting for
results and logging.
Diffstat (limited to 'tests/test-font.c')
-rw-r--r-- | tests/test-font.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/tests/test-font.c b/tests/test-font.c index 5ef6cc39..486504f9 100644 --- a/tests/test-font.c +++ b/tests/test-font.c @@ -133,25 +133,21 @@ test_metrics (void) metrics = pango_context_get_metrics (context, desc, pango_language_get_default ()); - g_test_message ("%s metrics\n" - "\tascent %d\n" - "\tdescent %d\n" - "\theight %d\n" - "\tchar width %d\n" - "\tdigit width %d\n" - "\tunderline position %d\n" - "\tunderline thickness %d\n" - "\tstrikethrough position %d\n" - "\tstrikethrough thickness %d\n", - str, - pango_font_metrics_get_ascent (metrics), - pango_font_metrics_get_descent (metrics), - pango_font_metrics_get_height (metrics), - pango_font_metrics_get_approximate_char_width (metrics), - pango_font_metrics_get_approximate_digit_width (metrics), - pango_font_metrics_get_underline_position (metrics), - pango_font_metrics_get_underline_thickness (metrics), - pango_font_metrics_get_strikethrough_position (metrics), + g_test_message ("%s metrics", str); + g_test_message ("\tascent: %d", pango_font_metrics_get_ascent (metrics)); + g_test_message ("\tdescent: %d", pango_font_metrics_get_descent (metrics)); + g_test_message ("\theight: %d", pango_font_metrics_get_height (metrics)); + g_test_message ("\tchar width: %d", + pango_font_metrics_get_approximate_char_width (metrics)); + g_test_message ("\tdigit width: %d", + pango_font_metrics_get_approximate_digit_width (metrics)); + g_test_message ("\tunderline position: %d", + pango_font_metrics_get_underline_position (metrics)); + g_test_message ("\tunderline thickness: %d", + pango_font_metrics_get_underline_thickness (metrics)); + g_test_message ("\tstrikethrough position: %d", + pango_font_metrics_get_strikethrough_position (metrics)); + g_test_message ("\tstrikethrough thickness: %d", pango_font_metrics_get_strikethrough_thickness (metrics)); pango_font_metrics_unref (metrics); |