diff options
author | Timm Bäder <mail@baedert.org> | 2019-04-24 18:30:46 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-05-05 07:18:39 +0200 |
commit | dde69802cd2bcea34d51565ec51048ebdab545b1 (patch) | |
tree | 2afea256b4881efee0620168a4dd494dc1948e91 /tests/rendernode.c | |
parent | 5530331b356c8bf5ab9494eedefedb44f8f9e7ed (diff) | |
download | gtk+-dde69802cd2bcea34d51565ec51048ebdab545b1.tar.gz |
Add error func to node deserialization
Diffstat (limited to 'tests/rendernode.c')
-rw-r--r-- | tests/rendernode.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/rendernode.c b/tests/rendernode.c index e0f5e1f9ec..4d69693c65 100644 --- a/tests/rendernode.c +++ b/tests/rendernode.c @@ -13,6 +13,19 @@ static GOptionEntry options[] = { { NULL } }; +static void +deserialize_error_func (const GtkCssSection *section, + const GError *error, + gpointer user_data) +{ + char *section_str = gtk_css_section_to_string (section); + + g_warning ("Error at %s: %s", section_str, error->message); + + free (section_str); +} + + int main(int argc, char **argv) { @@ -66,7 +79,7 @@ main(int argc, char **argv) } start = g_get_monotonic_time (); - node = gsk_render_node_deserialize (bytes, &error); + node = gsk_render_node_deserialize (bytes, deserialize_error_func, NULL); end = g_get_monotonic_time (); if (benchmark) { @@ -78,8 +91,6 @@ main(int argc, char **argv) if (node == NULL) { - g_printerr ("Invalid node file: %s\n", error->message); - g_clear_error (&error); return 1; } |