diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-glib-objects.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-glib-objects.c b/tests/test-glib-objects.c index cc95b81..cc59751 100644 --- a/tests/test-glib-objects.c +++ b/tests/test-glib-objects.c @@ -27,8 +27,22 @@ with this program. If not, see <http://www.gnu.org/licenses/>. void test_object_menuitem (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)); + /* 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; } void |