summaryrefslogtreecommitdiffstats
path: root/avahi-client/client-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-client/client-test.c')
-rw-r--r--avahi-client/client-test.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c
index 71d5096..cc41f49 100644
--- a/avahi-client/client-test.c
+++ b/avahi-client/client-test.c
@@ -1,15 +1,32 @@
#include <avahi-client/client.h>
#include <stdio.h>
+#include <glib.h>
int
main (int argc, char *argv[])
{
+ GMainLoop *loop;
AvahiClient *avahi;
+ char *ret;
+
+ loop = g_main_loop_new (NULL, FALSE);
avahi = avahi_client_new ();
- if (avahi != NULL)
- free (avahi);
+ g_assert (avahi != NULL);
+
+ ret = avahi_client_get_version_string (avahi);
+ printf ("Avahi Server Version: %s\n", ret);
+
+ ret = avahi_client_get_host_name (avahi);
+ printf ("Host Name: %s\n", ret);
+
+ ret = avahi_client_get_alternative_host_name (avahi, "ubuntu");
+ printf ("Alternative Host Name: %s\n", ret);
+
+ g_free (avahi);
+
+ g_main_loop_run (loop);
return 0;
}