diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | src/tests/channelmap-test.c | 25 |
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; +} |