mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2024-12-04 14:46:31 -05:00
Further playlist test improvements
This commit is contained in:
parent
8b42aff63d
commit
40b7b33f7c
@ -49,6 +49,7 @@ AM_CFLAGS = @EZ_CFLAGS@ @CHECK_CFLAGS@ \
|
|||||||
AM_LDFLAGS = @EZ_LDFLAGS@
|
AM_LDFLAGS = @EZ_LDFLAGS@
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
|
bad-executable.sh \
|
||||||
config-bad.xml \
|
config-bad.xml \
|
||||||
config-bad2.xml \
|
config-bad2.xml \
|
||||||
config-bad3.xml \
|
config-bad3.xml \
|
||||||
|
1
tests/bad-executable.sh
Executable file
1
tests/bad-executable.sh
Executable file
@ -0,0 +1 @@
|
|||||||
|
# This is not a proper executable
|
@ -38,6 +38,7 @@ START_TEST(test_playlist_program)
|
|||||||
playlist_t p;
|
playlist_t p;
|
||||||
|
|
||||||
ck_assert_ptr_eq(playlist_program("nonexistent.sh"), NULL);
|
ck_assert_ptr_eq(playlist_program("nonexistent.sh"), NULL);
|
||||||
|
ck_assert_ptr_eq(playlist_program(SRCDIR "/playlist.txt"), NULL);
|
||||||
p = playlist_program(EXAMPLESDIR "/play.sh");
|
p = playlist_program(EXAMPLESDIR "/play.sh");
|
||||||
ck_assert_ptr_ne(p, NULL);
|
ck_assert_ptr_ne(p, NULL);
|
||||||
ck_assert_str_eq(playlist_get_next(p),
|
ck_assert_str_eq(playlist_get_next(p),
|
||||||
@ -46,7 +47,11 @@ START_TEST(test_playlist_program)
|
|||||||
ck_assert_uint_eq(playlist_get_position(p), 0);
|
ck_assert_uint_eq(playlist_get_position(p), 0);
|
||||||
ck_assert_int_eq(playlist_goto_entry(p,
|
ck_assert_int_eq(playlist_goto_entry(p,
|
||||||
"Great_Artist_-_Great_Song.ogg"), 0);
|
"Great_Artist_-_Great_Song.ogg"), 0);
|
||||||
ck_assert_int_eq(playlist_reread(p), 0);
|
ck_assert_int_eq(playlist_reread(&p), 0);
|
||||||
|
playlist_free(&p);
|
||||||
|
p = playlist_program(SRCDIR "/bad-executable.sh");
|
||||||
|
ck_assert_ptr_ne(p, NULL);
|
||||||
|
ck_assert_ptr_eq(playlist_get_next(p), NULL);
|
||||||
playlist_free(&p);
|
playlist_free(&p);
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
@ -71,9 +76,7 @@ playlist_suite(void)
|
|||||||
void
|
void
|
||||||
setup_checked(void)
|
setup_checked(void)
|
||||||
{
|
{
|
||||||
if (0 < cfg_init() ||
|
if (0 < playlist_init())
|
||||||
0 < log_init() ||
|
|
||||||
0 < playlist_init())
|
|
||||||
ck_abort_msg("setup_checked failed");
|
ck_abort_msg("setup_checked failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,8 +84,6 @@ void
|
|||||||
teardown_checked(void)
|
teardown_checked(void)
|
||||||
{
|
{
|
||||||
playlist_exit();
|
playlist_exit();
|
||||||
log_exit();
|
|
||||||
cfg_exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user