2005-10-18 Christopher Aillon <caillon@redhat.com>

* 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
This commit is contained in:
Christopher Aillon
2005-10-18 14:10:58 +00:00
committed by Chris Aillon
parent 846ac5f251
commit c51c4474ad
2 changed files with 13 additions and 5 deletions

View File

@@ -1,3 +1,7 @@
2005-10-18 Christopher Aillon <caillon@redhat.com>
* test/libnm_glib_test.c: Test unregistering, too.
2005-10-17 Christopher Aillon <caillon@redhat.com>
* configure.in: Bump to 0.5.0

View File

@@ -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);
}