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

Fix cfg_get_metadata_program() and add tests when NULL is expected from getters

This commit is contained in:
Moritz Grimm 2015-05-21 23:25:05 +02:00
parent fb9c44f7fa
commit 34bdab6a36
2 changed files with 4 additions and 1 deletions

View File

@ -757,7 +757,7 @@ cfg_get_media_stream_once(void)
const char *
cfg_get_metadata_program(void)
{
return (cfg.metadata.program);
return (cfg.metadata.program[0] ? cfg.metadata.program : NULL);
}
const char *

View File

@ -174,6 +174,7 @@ END_TEST
START_TEST(test_program_config_file)
{
ck_assert_ptr_eq(cfg_get_program_config_file(), NULL);
TEST_STRLCPY(cfg_set_program_config_file, cfg_get_program_config_file,
PATH_MAX);
}
@ -247,6 +248,7 @@ END_TEST
START_TEST(test_server_user)
{
ck_assert_str_eq(cfg_get_server_user(), DEFAULT_USER);
TEST_STRLCPY(cfg_set_server_user, cfg_get_server_user, UCREDS_SIZE);
}
END_TEST
@ -415,6 +417,7 @@ END_TEST
START_TEST(test_metadata_program)
{
ck_assert_ptr_eq(cfg_get_metadata_program(), NULL);
TEST_STRLCPY(cfg_set_metadata_program, cfg_get_metadata_program,
PATH_MAX);
}