]> code.delx.au - pulseaudio/blob - src/tests/strlist-test.c
Merge dead branch 'liboil-test'
[pulseaudio] / src / tests / strlist-test.c
1 #include <stdio.h>
2
3 #include <pulse/xmalloc.h>
4 #include <pulse/gccmacro.h>
5
6 #include <pulsecore/strlist.h>
7
8 int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char* argv[]) {
9 char *t, *u;
10 pa_strlist *l = NULL;
11
12 l = pa_strlist_prepend(l, "e");
13 l = pa_strlist_prepend(l, "d");
14 l = pa_strlist_prepend(l, "c");
15 l = pa_strlist_prepend(l, "b");
16 l = pa_strlist_prepend(l, "a");
17
18 t = pa_strlist_tostring(l);
19 pa_strlist_free(l);
20
21 fprintf(stderr, "1: %s\n", t);
22
23 l = pa_strlist_parse(t);
24 pa_xfree(t);
25
26 t = pa_strlist_tostring(l);
27 fprintf(stderr, "2: %s\n", t);
28 pa_xfree(t);
29
30 l = pa_strlist_pop(l, &u);
31 fprintf(stderr, "3: %s\n", u);
32 pa_xfree(u);
33
34 l = pa_strlist_remove(l, "c");
35
36 t = pa_strlist_tostring(l);
37 fprintf(stderr, "4: %s\n", t);
38 pa_xfree(t);
39
40 pa_strlist_free(l);
41
42 return 0;
43 }