From 4658844f6c1d0e4352ee7baf0e7fcf56bde01d10 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 16:29:36 -0400 Subject: Test to build the object and unref it. --- tests/test-loader.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test-loader.c') diff --git a/tests/test-loader.c b/tests/test-loader.c index 7e77195..68bfe48 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -1,9 +1,25 @@ #include #include "libindicator/indicator-object.h" +void +destroy_cb (gpointer data) +{ + gboolean * bob = (gboolean *)data; + *bob = TRUE; + return; +} + void test_loader_refunref (void) { + GObject * object = g_object_new(INDICATOR_OBJECT_TYPE, NULL); + + gboolean unreffed = FALSE; + g_signal_connect(object, "destroy", G_CALLBACK(destroy_cb), &unreffed); + + g_object_unref(object); + + g_assert(unreffed == TRUE); return; } -- cgit v1.2.3