summaryrefslogtreecommitdiffstats
path: root/libavahi-core/strlst-test.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-05-07 13:37:03 +0000
committerLennart Poettering <lennart@poettering.net>2005-05-07 13:37:03 +0000
commitc58379bde376cb2298fca14f83a86626f1b76f2f (patch)
tree976f81b6e3530f29187ce0c017da9c91e584af06 /libavahi-core/strlst-test.c
parente2c8b4dac0fefea406db0ec1a3b1c0861557601e (diff)
rename libavahi-core to avahi-core
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@57 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'libavahi-core/strlst-test.c')
-rw-r--r--libavahi-core/strlst-test.c83
1 files changed, 0 insertions, 83 deletions
diff --git a/libavahi-core/strlst-test.c b/libavahi-core/strlst-test.c
deleted file mode 100644
index ebbf194..0000000
--- a/libavahi-core/strlst-test.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* $Id$ */
-
-/***
- This file is part of avahi.
-
- avahi is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- avahi is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
- Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with avahi; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA.
-***/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <stdio.h>
-
-#include "strlst.h"
-
-int main(int argc, char *argv[]) {
- gchar *t;
- guint8 data[1024];
- AvahiStringList *a = NULL, *b;
- guint size, n;
-
- a = avahi_string_list_add(a, "start");
- a = avahi_string_list_add(a, "foo");
- a = avahi_string_list_add(a, "bar");
- a = avahi_string_list_add(a, "quux");
- a = avahi_string_list_add_arbitrary(a, (guint8*) "null\0null", 9);
- a = avahi_string_list_add(a, "end");
-
- t = avahi_string_list_to_string(a);
- printf("--%s--\n", t);
- g_free(t);
-
- size = avahi_string_list_serialize(a, data, sizeof(data));
-
- printf("%u\n", size);
-
- for (t = (gchar*) data, n = 0; n < size; n++, t++) {
- if (*t <= 32)
- printf("(%u)", *t);
- else
- printf("%c", *t);
- }
-
- printf("\n");
-
- b = avahi_string_list_parse(data, size);
-
- g_assert(avahi_string_list_equal(a, b));
-
- t = avahi_string_list_to_string(b);
- printf("--%s--\n", t);
- g_free(t);
-
- avahi_string_list_free(b);
-
- b = avahi_string_list_copy(a);
-
- g_assert(avahi_string_list_equal(a, b));
-
- t = avahi_string_list_to_string(b);
- printf("--%s--\n", t);
- g_free(t);
-
- avahi_string_list_free(a);
- avahi_string_list_free(b);
-
- return 0;
-}