alsa-sink: Some trivial tidyups
[pulseaudio-mirror.git] / src / tests / channelmap-test.c
blob6cf58fb02db84b586aeb070b8de8a10fece91dcd
1 #ifdef HAVE_CONFIG_H
2 #include <config.h>
3 #endif
5 #include <stdio.h>
6 #include <assert.h>
8 #include <pulse/channelmap.h>
9 #include <pulse/gccmacro.h>
11 int main(int argc, char *argv[]) {
12 char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
13 pa_channel_map map, map2;
15 pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_AIFF);
17 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
19 pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_AUX);
21 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
23 pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_ALSA);
25 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
27 pa_channel_map_init_extend(&map, 14, PA_CHANNEL_MAP_ALSA);
29 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
31 pa_channel_map_parse(&map2, cm);
33 assert(pa_channel_map_equal(&map, &map2));
35 pa_channel_map_parse(&map2, "left,test");
37 return 0;