prepare 0.3 release
[azimuth] / tests / test-watcher.c
1 #include <glib.h>
2
3 #include "connection-watcher.h"
4
5 static void
6 connection_added_cb (ConnectionWatcher *watcher,
7     TpConnection *conn)
8 {
9   g_print ("conn added: %s\n", tp_proxy_get_object_path (conn));
10 }
11
12 int
13 main (int argc,
14     char **argv)
15 {
16   GMainLoop *loop;
17   ConnectionWatcher *watcher;
18
19   g_type_init ();
20
21   loop = g_main_loop_new (NULL, FALSE);
22   watcher = connection_watcher_new ();
23
24   g_signal_connect (watcher, "connection-added",
25       G_CALLBACK (connection_added_cb), NULL);
26
27   connection_watcher_start (watcher);
28
29   g_print ("run\n");
30   g_main_loop_run (loop);
31
32   g_object_unref (watcher);
33   g_main_loop_unref (loop);
34   return 0;
35 }