11 #include <pulse/channelmap.h>
13 START_TEST (channelmap_test) {
14 char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
15 pa_channel_map map, map2;
17 pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_AIFF);
19 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
21 pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_AUX);
23 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
25 pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_ALSA);
27 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
29 pa_channel_map_init_extend(&map, 14, PA_CHANNEL_MAP_ALSA);
31 fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
33 pa_channel_map_parse(&map2, cm);
35 fail_unless(pa_channel_map_equal(&map, &map2));
37 pa_channel_map_parse(&map2, "left,test");
41 int main(int argc, char *argv[]) {
47 s = suite_create("Channel Map");
48 tc = tcase_create("channelmap");
49 tcase_add_test(tc, channelmap_test);
50 suite_add_tcase(s, tc);
52 sr = srunner_create(s);
53 srunner_run_all(sr, CK_NORMAL);
54 failed = srunner_ntests_failed(sr);
57 return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;