diff --git a/tests/Makefile.am b/tests/Makefile.am index 14a878d..c107566 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 diff --git a/tests/check_playlist.c b/tests/check_playlist.c new file mode 100644 index 0000000..8c7b6f2 --- /dev/null +++ b/tests/check_playlist.c @@ -0,0 +1,64 @@ +#include + +#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); +}