aboutsummaryrefslogtreecommitdiff
path: root/tests/test-glib-objects.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-12-21 14:52:44 -0600
committerTed Gould <ted@gould.cx>2009-12-21 14:52:44 -0600
commitb03128c902c0b9906a34e3cc9f4fc5985d7a06d3 (patch)
tree3fa4c2ccb07d3154df946aeeb8c4571af423f715 /tests/test-glib-objects.c
parent7f05a7e84a3bf4bf936bc9e81465e7feac1f7487 (diff)
downloadlibdbusmenu-b03128c902c0b9906a34e3cc9f4fc5985d7a06d3.tar.gz
libdbusmenu-b03128c902c0b9906a34e3cc9f4fc5985d7a06d3.tar.bz2
libdbusmenu-b03128c902c0b9906a34e3cc9f4fc5985d7a06d3.zip
Adding a menuitem allocation test.
Diffstat (limited to 'tests/test-glib-objects.c')
-rw-r--r--tests/test-glib-objects.c14
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