summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-04-26 14:34:45 +0000
committerLennart Poettering <lennart@poettering.net>2006-04-26 14:34:45 +0000
commit5f7cc0c870ebe77dd457209503f75d65b35b8014 (patch)
tree836f6ed02a6b12d9d4304c08c445f0bd8aece03c /src
parent195e96912f062b3faa93547dde014c45ccb74628 (diff)
add new test 'channelmap-test'
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@800 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am8
-rw-r--r--src/tests/channelmap-test.c25
2 files changed, 32 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 2061b0ca..fbb14702 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -187,7 +187,8 @@ noinst_PROGRAMS = \
strlist-test \
voltest \
memblockq-test \
- sync-playback
+ sync-playback \
+ channelmap-test
if HAVE_SIGXCPU
noinst_PROGRAMS += \
@@ -235,6 +236,11 @@ voltest_CFLAGS = $(AM_CFLAGS)
voltest_LDADD = $(AM_LDADD) libpolyp-@PA_MAJORMINOR@.la
voltest_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
+channelmap_test_SOURCES = tests/channelmap-test.c
+channelmap_test_CFLAGS = $(AM_CFLAGS)
+channelmap_test_LDADD = $(AM_LDADD) libpolyp-@PA_MAJORMINOR@.la
+channelmap_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
+
cpulimit_test_SOURCES = tests/cpulimit-test.c daemon/cpulimit.c daemon/cpulimit.h
cpulimit_test_CFLAGS = $(AM_CFLAGS)
cpulimit_test_LDADD = $(AM_LDADD) libpolypcore.la
diff --git a/src/tests/channelmap-test.c b/src/tests/channelmap-test.c
new file mode 100644
index 00000000..522c136f
--- /dev/null
+++ b/src/tests/channelmap-test.c
@@ -0,0 +1,25 @@
+/* $Id$ */
+
+#include <stdio.h>
+#include <assert.h>
+
+#include <polyp/channelmap.h>
+#include <polypcore/gccmacro.h>
+
+int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
+ char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
+ pa_channel_map map, map2;
+
+ pa_channel_map_init_auto(&map, 5);
+
+ fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
+
+ pa_channel_map_parse(&map2, cm);
+
+ assert(pa_channel_map_equal(&map, &map2));
+
+ pa_channel_map_parse(&map2, "left,test");
+
+
+ return 0;
+}