mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
tests: modify channelmap-tets to use 'check' framework
This commit is contained in:
parent
d746225b98
commit
dbf176acbd
2 changed files with 27 additions and 6 deletions
|
|
@ -420,9 +420,9 @@ volume_test_LDADD = $(AM_LDADD) libpulse.la libpulsecommon-@PA_MAJORMINOR@.la
|
|||
volume_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
|
||||
|
||||
channelmap_test_SOURCES = tests/channelmap-test.c
|
||||
channelmap_test_CFLAGS = $(AM_CFLAGS)
|
||||
channelmap_test_CFLAGS = $(AM_CFLAGS) $(LIBCHECK_CFLAGS)
|
||||
channelmap_test_LDADD = $(AM_LDADD) libpulse.la
|
||||
channelmap_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
|
||||
channelmap_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
|
||||
|
||||
cpulimit_test_SOURCES = tests/cpulimit-test.c daemon/cpulimit.c daemon/cpulimit.h
|
||||
cpulimit_test_CFLAGS = $(AM_CFLAGS)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <check.h>
|
||||
|
||||
#include <pulse/channelmap.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
START_TEST (channelmap_test) {
|
||||
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
|
||||
pa_channel_map map, map2;
|
||||
|
||||
|
|
@ -29,9 +32,27 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
pa_channel_map_parse(&map2, cm);
|
||||
|
||||
assert(pa_channel_map_equal(&map, &map2));
|
||||
fail_unless(pa_channel_map_equal(&map, &map2));
|
||||
|
||||
pa_channel_map_parse(&map2, "left,test");
|
||||
|
||||
return 0;
|
||||
}
|
||||
END_TEST
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int failed = 0;
|
||||
Suite *s;
|
||||
TCase *tc;
|
||||
SRunner *sr;
|
||||
|
||||
s = suite_create("Channel Map");
|
||||
tc = tcase_create("channelmap");
|
||||
tcase_add_test(tc, channelmap_test);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
sr = srunner_create(s);
|
||||
srunner_run_all(sr, CK_NORMAL);
|
||||
failed = srunner_ntests_failed(sr);
|
||||
srunner_free(sr);
|
||||
|
||||
return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue