From c51c4474ad6539c6c3d15feaabfd310ce384d628 Mon Sep 17 00:00:00 2001 From: Christopher Aillon Date: Tue, 18 Oct 2005 14:10:58 +0000 Subject: [PATCH] 2005-10-18 Christopher Aillon * test/libnm_glib_test.c: Test unregistering, too. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1041 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 4 ++++ test/libnm_glib_test.c | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 948f1ed4a..e765abca1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-10-18 Christopher Aillon + + * test/libnm_glib_test.c: Test unregistering, too. + 2005-10-17 Christopher Aillon * configure.in: Bump to 0.5.0 diff --git a/test/libnm_glib_test.c b/test/libnm_glib_test.c index ac5b2eafa..0f56e04dc 100644 --- a/test/libnm_glib_test.c +++ b/test/libnm_glib_test.c @@ -61,6 +61,7 @@ int main( int argc, char *argv[] ) { GMainLoop *loop; libnm_glib_ctx *ctx; + guint id; ctx = libnm_glib_init (); if (!ctx) @@ -68,14 +69,17 @@ int main( int argc, char *argv[] ) fprintf (stderr, "Could not initialize libnm.\n"); exit (1); } - libnm_glib_register_callback (ctx, status_printer, ctx, NULL); + + id = libnm_glib_register_callback (ctx, status_printer, ctx, NULL); + fprintf (stderr, "Registered Callback with ID %d\n", id); + libnm_glib_unregister_callback (ctx, id); + fprintf (stderr, "Unregistered Callback with ID %d\n", id); + + id = libnm_glib_register_callback (ctx, status_printer, ctx, NULL); + fprintf (stderr, "Registered Callback with ID %d\n", id); loop = g_main_loop_new (NULL, FALSE); -// id = g_timeout_add (2000, status_printer, (gpointer)ctx); - g_main_loop_run (loop); -// g_source_remove (id); - exit (0); }