mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
Parse a file given on the cmdline
svn path=/trunk/; revision=18981
This commit is contained in:
parent
464ae98495
commit
4e8a4021a6
@ -1,5 +1,7 @@
|
||||
2007-11-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* tests/buildertest.c: Parse a file given on the cmdline.
|
||||
|
||||
* gtk/gtkbuilderparser.c (_gtk_builder_parser_parse_buffer):
|
||||
Leak less in error paths.
|
||||
|
||||
|
@ -1760,11 +1760,36 @@ test_reference_counting (void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
test_file (const gchar *filename)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GError *error = NULL;
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
|
||||
if (!gtk_builder_add_from_file (builder, filename, &error))
|
||||
{
|
||||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_object_unref (builder);
|
||||
builder = NULL;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
test_file (argv[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_print ("Testing parser\n");
|
||||
if (!test_parser ())
|
||||
g_error ("test_parser failed");
|
||||
|
Loading…
Reference in New Issue
Block a user