diff options
author | Ted Gould <ted@gould.cx> | 2010-02-05 11:00:07 -0800 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-05 11:00:07 -0800 |
commit | c77ed1ccc280c56949b0a5a3f2d8d08bae498d29 (patch) | |
tree | 4b8cc5313c3c6828565df8efad57ab85d53f4d3a /tests/test-glib-objects.c | |
parent | a61a7ba8cc024d3d75f73e336ba83128631d3019 (diff) | |
parent | f3a13c8b0be55927b8b91ff37ba922ba323b44b7 (diff) | |
download | libdbusmenu-c77ed1ccc280c56949b0a5a3f2d8d08bae498d29.tar.gz libdbusmenu-c77ed1ccc280c56949b0a5a3f2d8d08bae498d29.tar.bz2 libdbusmenu-c77ed1ccc280c56949b0a5a3f2d8d08bae498d29.zip |
* Upstrem Merge
* Fixing handing of root IDs being zero
* Handling syncing of properties when reusing items
* Shipping new JSON files and READMEs for testing.
Diffstat (limited to 'tests/test-glib-objects.c')
-rw-r--r-- | tests/test-glib-objects.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test-glib-objects.c b/tests/test-glib-objects.c index f3fbcc8..1d4f673 100644 --- a/tests/test-glib-objects.c +++ b/tests/test-glib-objects.c @@ -47,6 +47,30 @@ test_object_menuitem (void) return; } +/* Check to make sure a new ID is bigger than 0 */ +static void +test_object_menuitem_id (void) +{ + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + g_assert(G_IS_OBJECT(item)); + g_assert(DBUSMENU_IS_MENUITEM(item)); + + g_assert(dbusmenu_menuitem_get_id(item) > 0); + + /* Set up a check to make sure it gets destroyed on unref */ + g_object_add_weak_pointer(G_OBJECT(item), (gpointer *)&item); + g_object_unref(item); + + /* Did it go away? */ + g_assert(item == NULL); + + return; +} + /* Set a string prop, make sure it's stored as one */ static void test_object_menuitem_props_string (void) @@ -255,6 +279,7 @@ static void test_glib_objects_suite (void) { g_test_add_func ("/dbusmenu/glib/objects/menuitem/base", test_object_menuitem); + g_test_add_func ("/dbusmenu/glib/objects/menuitem/id", test_object_menuitem_id); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_string", test_object_menuitem_props_string); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_int", test_object_menuitem_props_int); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_bool", test_object_menuitem_props_bool); |