[glib] Improve GMenuModel test coverage
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Improve GMenuModel test coverage
- Date: Sun, 2 Jun 2013 05:48:20 +0000 (UTC)
commit dcf5dea9225efd3ef60a23a5a0fcbbb1e95cc794
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jun 2 01:44:15 2013 -0400
Improve GMenuModel test coverage
gio/tests/gmenumodel.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/gmenumodel.c b/gio/tests/gmenumodel.c
index b5bdac2..75c70cd 100644
--- a/gio/tests/gmenumodel.c
+++ b/gio/tests/gmenumodel.c
@@ -995,6 +995,8 @@ test_attributes (void)
g_assert (g_variant_is_of_type (v, G_VARIANT_TYPE("a(si)")));
g_variant_unref (v);
+ g_menu_remove_all (menu);
+
g_object_unref (menu);
g_object_unref (item);
}
@@ -1116,6 +1118,9 @@ test_menuitem (void)
GMenu *menu;
GMenu *submenu;
GMenuItem *item;
+ GIcon *icon;
+ gboolean b;
+ gchar *s;
menu = g_menu_new ();
submenu = g_menu_new ();
@@ -1124,6 +1129,20 @@ test_menuitem (void)
g_menu_item_set_attribute (item, "attribute", "b", TRUE);
g_menu_item_set_link (item, G_MENU_LINK_SUBMENU, G_MENU_MODEL (submenu));
g_menu_append_item (menu, item);
+
+ icon = g_themed_icon_new ("bla");
+ g_menu_item_set_icon (item, icon);
+ g_object_unref (icon);
+
+ g_assert (g_menu_item_get_attribute (item, "attribute", "b", &b));
+ g_assert (b);
+
+ g_menu_item_set_action_and_target (item, "action", "(bs)", TRUE, "string");
+ g_assert (g_menu_item_get_attribute (item, "target", "(bs)", &b, &s));
+ g_assert (b);
+ g_assert_cmpstr (s, ==, "string");
+ g_free (s);
+
g_object_unref (item);
item = g_menu_item_new_from_model (G_MENU_MODEL (menu), 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]