aboutsummaryrefslogtreecommitdiff
path: root/tests/test-libappindicator.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-11-11 22:21:11 -0600
committerTed Gould <ted@gould.cx>2010-11-11 22:21:11 -0600
commitaad192611ca84bfabc036658066ea584385f0982 (patch)
tree4eedb331ca4ab407c81ac1d66667003344265475 /tests/test-libappindicator.c
parentca62d8c2fa745e4d033a9b6c79b146b1bbb86a2f (diff)
downloadlibayatana-appindicator-aad192611ca84bfabc036658066ea584385f0982.tar.gz
libayatana-appindicator-aad192611ca84bfabc036658066ea584385f0982.tar.bz2
libayatana-appindicator-aad192611ca84bfabc036658066ea584385f0982.zip
Fleshing out a function to see if an invalid name results in no entries
Diffstat (limited to 'tests/test-libappindicator.c')
-rw-r--r--tests/test-libappindicator.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test-libappindicator.c b/tests/test-libappindicator.c
index 46460f0..cadf783 100644
--- a/tests/test-libappindicator.c
+++ b/tests/test-libappindicator.c
@@ -386,9 +386,34 @@ test_libappindicator_desktop_menu (void)
void
test_libappindicator_desktop_menu_bad (void)
{
+ AppIndicator * ci = app_indicator_new ("my-id-desktop-menu-bad",
+ "my-name",
+ APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
+
+ g_assert(ci != NULL);
+ g_assert(app_indicator_get_label(ci) == NULL);
+ g_assert(app_indicator_get_label_guide(ci) == NULL);
+
+ app_indicator_build_menu_from_desktop(ci, SRCDIR "/test-libappindicator.desktop", "Not Test Program");
+
+ GValue serverval = {0};
+ g_value_init(&serverval, DBUSMENU_TYPE_SERVER);
+ g_object_get_property(G_OBJECT(ci), "dbus-menu-server", &serverval);
+ DbusmenuServer * server = DBUSMENU_SERVER(g_value_get_object(&serverval));
+ g_assert(server != NULL);
+ GValue rootval = {0};
+ g_value_init(&rootval, DBUSMENU_TYPE_MENUITEM);
+ g_object_get_property(G_OBJECT(server), DBUSMENU_SERVER_PROP_ROOT_NODE, &rootval);
+ DbusmenuMenuitem * root = DBUSMENU_MENUITEM(g_value_get_object(&rootval));
+ g_assert(root != NULL);
+
+ GList * children = dbusmenu_menuitem_get_children(root);
+ g_assert(g_list_length(children) == 0);
+ g_object_unref(G_OBJECT(ci));
+ return;
}
void