diff --git a/tests/Makefile.am b/tests/Makefile.am index dba0ce5..14a878d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,6 +46,7 @@ EXTRA_DIST = \ config-bad.xml \ config-bad2.xml \ config-bad3.xml \ - config-bad4.xml + config-bad4.xml \ + playlist.txt CLEANFILES = *~ *.core core *.gcno *.gcda diff --git a/tests/check_cmdline.c b/tests/check_cmdline.c index d7234c1..fd50fa0 100644 --- a/tests/check_cmdline.c +++ b/tests/check_cmdline.c @@ -11,6 +11,16 @@ extern int optind; START_TEST(test_configfile) { + char *argv[] = + { + "check_cmdline", "-c", EXAMPLESDIR "/ezstream-full.xml" , NULL + }; + int argc = (int)(sizeof(argv) / sizeof(argv[0])) - 1; + int ret; + + ret = 0; + ck_assert_int_eq(cmdline_parse(argc, argv, &ret), 0); + ck_assert_int_eq(ret, 0); } END_TEST @@ -55,6 +65,15 @@ END_TEST START_TEST(test_shuffle) { + char *argv[] = + { + "check_cmdline", "-s", SRCDIR "/playlist.txt", NULL + }; + int argc = (int)(sizeof(argv) / sizeof(argv[0])) - 1; + int ret; + + ck_assert_int_ne(cmdline_parse(argc, argv, &ret), 0); + ck_assert_int_eq(ret, 0); } END_TEST diff --git a/tests/playlist.txt b/tests/playlist.txt new file mode 100644 index 0000000..f05d59f --- /dev/null +++ b/tests/playlist.txt @@ -0,0 +1,5 @@ +1.ogg +2.ogg +3.ogg +4.ogg +5.ogg