mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
b6838cb9f4
This adds a test tool gsk/node-parser that takes node files and parses them. A few of these node files have been added, for crashes I encountered while developing the new parsing code.
31 lines
604 B
C
31 lines
604 B
C
#include <gtk/gtk.h>
|
|
|
|
int
|
|
main (int argc, char **argv)
|
|
{
|
|
GError *error = NULL;
|
|
GskRenderNode *node;
|
|
GBytes *bytes;
|
|
GFile *file;
|
|
|
|
g_assert (argc == 2);
|
|
|
|
gtk_init ();
|
|
|
|
file = g_file_new_for_commandline_arg (argv[1]);
|
|
bytes = g_file_load_bytes (file, NULL, NULL, &error);
|
|
g_assert_no_error (error);
|
|
g_assert (bytes != NULL);
|
|
|
|
node = gsk_render_node_deserialize (bytes, &error);
|
|
if (error)
|
|
g_test_message ("Error: %s\n", error->message);
|
|
|
|
g_clear_error (&error);
|
|
g_clear_pointer (&node, gsk_render_node_unref);
|
|
g_bytes_unref (bytes);
|
|
g_object_unref (file);
|
|
|
|
return 0;
|
|
}
|