aboutsummaryrefslogtreecommitdiff
path: root/tests/test-glib-layout-client.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-05 10:54:42 -0800
committerTed Gould <ted@gould.cx>2010-02-05 10:54:42 -0800
commit873763b18e85fe2d53f847e00d5207e4926bb619 (patch)
tree833014e2b5bea30c53b5e3660e3a47180be1faa8 /tests/test-glib-layout-client.c
parenta207ebb4db1921fe122a9c78b97f17e7ec175a29 (diff)
parent0f6f4c9cdd83d80dfd77fbedcc9a9468cb16eaae (diff)
downloadlibdbusmenu-873763b18e85fe2d53f847e00d5207e4926bb619.tar.gz
libdbusmenu-873763b18e85fe2d53f847e00d5207e4926bb619.tar.bz2
libdbusmenu-873763b18e85fe2d53f847e00d5207e4926bb619.zip
Fix IDs to handle the root ID of zero better and to handle merging of properties if items are reused.
Diffstat (limited to 'tests/test-glib-layout-client.c')
-rw-r--r--tests/test-glib-layout-client.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/test-glib-layout-client.c b/tests/test-glib-layout-client.c
index bb2d13a..5ea0cf8 100644
--- a/tests/test-glib-layout-client.c
+++ b/tests/test-glib-layout-client.c
@@ -36,8 +36,10 @@ verify_root_to_layout(DbusmenuMenuitem * mi, layout_t * layout)
g_debug("Verifying ID: %d", layout->id);
if (layout->id != dbusmenu_menuitem_get_id(mi)) {
- g_debug("Failed as ID %d is not equal to %d", layout->id, dbusmenu_menuitem_get_id(mi));
- return FALSE;
+ if (!(dbusmenu_menuitem_get_root(mi) && dbusmenu_menuitem_get_id(mi) == 0)) {
+ g_debug("Failed as ID %d is not equal to %d", layout->id, dbusmenu_menuitem_get_id(mi));
+ return FALSE;
+ }
}
GList * children = dbusmenu_menuitem_get_children(mi);
@@ -55,13 +57,13 @@ verify_root_to_layout(DbusmenuMenuitem * mi, layout_t * layout)
}
guint i = 0;
- for (i = 0; children != NULL && layout->submenu[i].id != 0; children = g_list_next(children), i++) {
+ for (i = 0; children != NULL && layout->submenu[i].id != -1; children = g_list_next(children), i++) {
if (!verify_root_to_layout(DBUSMENU_MENUITEM(children->data), &layout->submenu[i])) {
return FALSE;
}
}
- if (children == NULL && layout->submenu[i].id == 0) {
+ if (children == NULL && layout->submenu[i].id == -1) {
return TRUE;
}
@@ -88,7 +90,7 @@ layout_updated (DbusmenuClient * client, gpointer data)
layouton++;
- if (layouts[layouton].id == 0) {
+ if (layouts[layouton].id == -1) {
g_main_loop_quit(mainloop);
}