Parse a file given on the cmdline

svn path=/trunk/; revision=18981
This commit is contained in:
Matthias Clasen 2007-11-10 23:59:05 +00:00
parent 464ae98495
commit 4e8a4021a6
2 changed files with 27 additions and 0 deletions

View File

@ -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.

View File

@ -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");