aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-05 10:10:47 -0800
committerTed Gould <ted@gould.cx>2010-02-05 10:10:47 -0800
commit277508f994a163f0e4acb8a18253aa08b9b3514a (patch)
tree7762b246071e741fa9ae0332f53fa9c2d4ab2ede
parenta930e6973028bc4e86080f2ae4b072a3f9cc61d0 (diff)
downloadlibdbusmenu-277508f994a163f0e4acb8a18253aa08b9b3514a.tar.gz
libdbusmenu-277508f994a163f0e4acb8a18253aa08b9b3514a.tar.bz2
libdbusmenu-277508f994a163f0e4acb8a18253aa08b9b3514a.zip
Changing the ID to be -1 instead of 0
-rw-r--r--tests/test-glib-properties-client.c6
-rw-r--r--tests/test-glib-properties-server.c6
-rw-r--r--tests/test-glib-properties.h12
3 files changed, 12 insertions, 12 deletions
diff --git a/tests/test-glib-properties-client.c b/tests/test-glib-properties-client.c
index cb3d371..434465a 100644
--- a/tests/test-glib-properties-client.c
+++ b/tests/test-glib-properties-client.c
@@ -87,13 +87,13 @@ verify_root_to_layout(DbusmenuMenuitem * mi, proplayout_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) {
g_debug("\tPassed: %d", layout->id);
return TRUE;
}
@@ -142,7 +142,7 @@ layout_verify_timer (gpointer data)
layouton++;
- if (layouts[layouton].id == 0) {
+ if (layouts[layouton].id == -1) {
g_main_loop_quit(mainloop);
}
diff --git a/tests/test-glib-properties-server.c b/tests/test-glib-properties-server.c
index 8dad37f..091e550 100644
--- a/tests/test-glib-properties-server.c
+++ b/tests/test-glib-properties-server.c
@@ -46,14 +46,14 @@ set_props (DbusmenuMenuitem * mi, gchar ** props)
static DbusmenuMenuitem *
layout2menuitem (proplayout_t * layout)
{
- if (layout == NULL || layout->id == 0) return NULL;
+ if (layout == NULL || layout->id == -1) return NULL;
DbusmenuMenuitem * local = dbusmenu_menuitem_new_with_id(layout->id);
set_props(local, layout->properties);
if (layout->submenu != NULL) {
guint count;
- for (count = 0; layout->submenu[count].id != 0; count++) {
+ for (count = 0; layout->submenu[count].id != -1; count++) {
DbusmenuMenuitem * child = layout2menuitem(&layout->submenu[count]);
if (child != NULL) {
dbusmenu_menuitem_child_append(local, child);
@@ -72,7 +72,7 @@ static GMainLoop * mainloop = NULL;
static gboolean
timer_func (gpointer data)
{
- if (layouts[layouton].id == 0) {
+ if (layouts[layouton].id == -1) {
g_main_loop_quit(mainloop);
return FALSE;
}
diff --git a/tests/test-glib-properties.h b/tests/test-glib-properties.h
index 5e83f5c..c0c929a 100644
--- a/tests/test-glib-properties.h
+++ b/tests/test-glib-properties.h
@@ -24,7 +24,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
typedef struct _proplayout_t proplayout_t;
struct _proplayout_t {
- guint id;
+ gint id;
gchar ** properties;
proplayout_t * submenu;
};
@@ -68,7 +68,7 @@ proplayout_t submenu_4_1[] = {
{id: 17, properties: props2, submenu: NULL},
{id: 18, properties: props2, submenu: NULL},
{id: 19, properties: props2, submenu: NULL},
- {id: 0, properties: NULL, submenu: NULL}
+ {id: -1, properties: NULL, submenu: NULL}
};
proplayout_t submenu_4_2[] = {
@@ -82,7 +82,7 @@ proplayout_t submenu_4_2[] = {
{id: 27, properties: props2, submenu: NULL},
{id: 28, properties: props2, submenu: NULL},
{id: 29, properties: props2, submenu: NULL},
- {id: 0, properties: NULL, submenu: NULL}
+ {id: -1, properties: NULL, submenu: NULL}
};
proplayout_t submenu_4_3[] = {
@@ -96,14 +96,14 @@ proplayout_t submenu_4_3[] = {
{id: 37, properties: props2, submenu: NULL},
{id: 38, properties: props2, submenu: NULL},
{id: 39, properties: props2, submenu: NULL},
- {id: 0, properties: NULL, submenu: NULL}
+ {id: -1, properties: NULL, submenu: NULL}
};
proplayout_t submenu_4_0[] = {
{id: 1, properties: props2, submenu: submenu_4_1},
{id: 2, properties: props2, submenu: submenu_4_2},
{id: 3, properties: props2, submenu: submenu_4_3},
- {id: 0, properties: NULL, submenu: NULL}
+ {id: -1, properties: NULL, submenu: NULL}
};
proplayout_t layouts[] = {
@@ -111,6 +111,6 @@ proplayout_t layouts[] = {
{id: 10, properties: props2, submenu: NULL},
{id: 20, properties: props3, submenu: NULL},
{id: 100, properties: props2, submenu: submenu_4_0},
- {id: 0, properties: NULL, submenu: NULL}
+ {id: -1, properties: NULL, submenu: NULL}
};