1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00

Add playlist test harness

This commit is contained in:
Moritz Grimm 2015-05-26 14:31:43 +02:00
parent 7a4c7291da
commit e3f43db0c9
2 changed files with 70 additions and 0 deletions

View File

@ -5,6 +5,7 @@ TESTS = \
check_cfg_xmlfile \
check_cmdline \
check_log \
check_playlist \
check_xalloc
check_PROGRAMS = $(TESTS)
@ -28,6 +29,11 @@ check_log_SOURCES = \
check_log_DEPENDENCIES = $(top_builddir)/src/libezstream.la
check_log_LDADD = $(check_log_DEPENDENCIES) @CHECK_LIBS@
check_playlist_SOURCES = \
check_playlist.c
check_playlist_DEPENDENCIES = $(top_builddir)/src/libezstream.la
check_playlist_LDADD = $(check_playlist_DEPENDENCIES) @CHECK_LIBS@
check_xalloc_SOURCES = \
check_xalloc.c
check_xalloc_DEPENDENCIES = $(top_builddir)/src/libezstream.la

64
tests/check_playlist.c Normal file
View File

@ -0,0 +1,64 @@
#include <check.h>
#include "playlist.h"
Suite * playlist_suite(void);
void setup_checked(void);
void teardown_checked(void);
START_TEST(test_read)
{
}
END_TEST
Suite *
playlist_suite(void)
{
Suite *s;
TCase *tc_playlist;
s = suite_create("Playlist");
tc_playlist = tcase_create("Playlist");
tcase_add_checked_fixture(tc_playlist, setup_checked, teardown_checked);
tcase_add_test(tc_playlist, test_read);
suite_add_tcase(s, tc_playlist);
return (s);
}
void
setup_checked(void)
{
if (0 < cfg_init() ||
0 < log_init() ||
0 < playlist_init())
ck_abort_msg("setup_checked failed");
}
void
teardown_checked(void)
{
playlist_exit();
log_exit();
cfg_exit();
}
int
main(void)
{
unsigned int num_failed;
Suite *s;
SRunner *sr;
s = playlist_suite();
sr = srunner_create(s);
srunner_run_all(sr, CK_NORMAL);
num_failed = srunner_ntests_failed(sr);
srunner_free(sr);
if (num_failed)
return (1);
return (0);
}