summaryrefslogtreecommitdiff
path: root/tests/markup-parse.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-04-14 13:11:49 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2020-04-14 13:13:51 +0100
commit3fc1a9bff1892f92d96bcf1fb86c157885673396 (patch)
tree209a6db48983052ef79396e09041f13c9f6f7a85 /tests/markup-parse.c
parent2a773323f1f7b5510ee0de7a1ea0ac8bec0e05d4 (diff)
downloadpango-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/markup-parse.c')
-rw-r--r--tests/markup-parse.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/markup-parse.c b/tests/markup-parse.c
index dff0ccc4..5f1454a1 100644
--- a/tests/markup-parse.c
+++ b/tests/markup-parse.c
@@ -48,12 +48,8 @@ test_file (const gchar *filename, GString *string)
char *str;
int start, end;
- if (!g_file_get_contents (filename, &contents, &length, &error))
- {
- fprintf (stderr, "%s\n", error->message);
- g_error_free (error);
- return;
- }
+ g_file_get_contents (filename, &contents, &length, &error);
+ g_assert_no_error (error);
ret = pango_parse_markup (contents, length, 0, &attrs, &text, NULL, &error);
g_free (contents);
@@ -152,7 +148,7 @@ main (int argc, char *argv[])
string = g_string_sized_new (0);
test_file (argv[1], string);
- g_print ("%s", string->str);
+ g_test_message ("%s", string->str);
return 0;
}