summaryrefslogtreecommitdiffstats
path: root/src/tests/strlist-test.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-02-16 19:19:58 +0000
committerPierre Ossman <ossman@cendio.se>2006-02-16 19:19:58 +0000
commite205b25d65ccb380fa158711e24d55b6de5d9bc1 (patch)
tree470b4ced153c9ff18b8e35deb05c7a95efc838fc /src/tests/strlist-test.c
parent5b881e62282f26b353635120935d114e0c7c3f3c (diff)
Reorganised the source tree. We now have src/ with a couple of subdirs:
* daemon/ - Contains the files specific to the polypaudio daemon. * modules/ - All loadable modules. * polyp/ - Files that are part of the public, application interface or are only used in libpolyp. * polypcore/ - All other shared files. * tests/ - Test programs. * utils/ - Utility programs. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@487 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/tests/strlist-test.c')
-rw-r--r--src/tests/strlist-test.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/tests/strlist-test.c b/src/tests/strlist-test.c
new file mode 100644
index 00000000..14543112
--- /dev/null
+++ b/src/tests/strlist-test.c
@@ -0,0 +1,42 @@
+#include <stdio.h>
+
+#include <polypcore/strlist.h>
+#include <polypcore/xmalloc.h>
+#include <polypcore/gccmacro.h>
+
+int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char* argv[]) {
+ char *t, *u;
+ pa_strlist *l = NULL;
+
+ l = pa_strlist_prepend(l, "e");
+ l = pa_strlist_prepend(l, "d");
+ l = pa_strlist_prepend(l, "c");
+ l = pa_strlist_prepend(l, "b");
+ l = pa_strlist_prepend(l, "a");
+
+ t = pa_strlist_tostring(l);
+ pa_strlist_free(l);
+
+ fprintf(stderr, "1: %s\n", t);
+
+ l = pa_strlist_parse(t);
+ pa_xfree(t);
+
+ t = pa_strlist_tostring(l);
+ fprintf(stderr, "2: %s\n", t);
+ pa_xfree(t);
+
+ l = pa_strlist_pop(l, &u);
+ fprintf(stderr, "3: %s\n", u);
+ pa_xfree(u);
+
+ l = pa_strlist_remove(l, "c");
+
+ t = pa_strlist_tostring(l);
+ fprintf(stderr, "4: %s\n", t);
+ pa_xfree(t);
+
+ pa_strlist_free(l);
+
+ return 0;
+}