From b03128c902c0b9906a34e3cc9f4fc5985d7a06d3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Dec 2009 14:52:44 -0600 Subject: Adding a menuitem allocation test. --- tests/test-glib-objects.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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 . 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 -- cgit v1.2.3