[libpeas] Add a GtkBuilder test
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Add a GtkBuilder test
- Date: Wed, 9 Feb 2011 11:04:25 +0000 (UTC)
commit 73cfe8d3d90fb6e6b1ab44458b3a597ccd46b5ba
Author: Garrett Regier <alias301 gmail com>
Date: Tue Feb 8 15:43:01 2011 -0800
Add a GtkBuilder test
tests/libpeas-gtk/plugin-manager.c | 38 ++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/tests/libpeas-gtk/plugin-manager.c b/tests/libpeas-gtk/plugin-manager.c
index f8e6634..62aa246 100644
--- a/tests/libpeas-gtk/plugin-manager.c
+++ b/tests/libpeas-gtk/plugin-manager.c
@@ -382,6 +382,42 @@ test_gtk_plugin_manager_configure_dialog (TestFixture *fixture)
g_list_free (list);
}
+static void
+test_gtk_plugin_manager_gtkbuilder (TestFixture *fixture)
+{
+ GtkBuilder *builder;
+ GError *error = NULL;
+ PeasGtkPluginManager *manager;
+ PeasGtkPluginManagerView *view;
+ static const gchar *gtkbuilder_string =
+ "<?xml version='1.0' encoding='UTF-8'?>\n"
+ "<interface>\n"
+ "<object class='PeasGtkPluginManagerView' id='view'>\n"
+ " <property name='show-builtin'>True</property>\n"
+ "</object>\n"
+ "<object class='PeasGtkPluginManager' id='manager'>\n"
+ " <property name='view'>view</property>\n"
+ "</object>\n"
+ "</interface>";
+
+ builder = gtk_builder_new ();
+
+ gtk_builder_add_from_string (builder, gtkbuilder_string, -1, &error);
+ g_assert_no_error (error);
+
+ manager = PEAS_GTK_PLUGIN_MANAGER (gtk_builder_get_object (builder, "manager"));
+ g_assert (PEAS_GTK_IS_PLUGIN_MANAGER (manager));
+
+ view = PEAS_GTK_PLUGIN_MANAGER_VIEW (peas_gtk_plugin_manager_get_view (manager));
+
+ g_assert (G_OBJECT (view) == gtk_builder_get_object (builder, "view"));
+
+ g_assert (peas_gtk_plugin_manager_view_get_show_builtin (view));
+
+ /* Freeing the builder will free the objects */
+ g_object_unref (builder);
+}
+
int
main (int argc,
char **argv)
@@ -404,6 +440,8 @@ main (int argc,
TEST ("about-dialog", about_dialog);
TEST ("configure-dialog", configure_dialog);
+ TEST ("gtkbuilder", gtkbuilder);
+
#undef TEST
return g_test_run ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]