Commit 857f096b authored by Moritz Grimm's avatar Moritz Grimm
Browse files

Libshout behaves irregularly; make tests cope

parent cb77b073
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "cfg.h" #include "cfg.h"
#include "mdata.h" #include "mdata.h"
#include "stream.h" #include "stream.h"
#include "xalloc.h"
Suite * stream_suite(void); Suite * stream_suite(void);
void setup_checked(void); void setup_checked(void);
...@@ -67,19 +68,27 @@ START_TEST(test_stream) ...@@ -67,19 +68,27 @@ START_TEST(test_stream)
cfg_set_metadata_no_updates("no", NULL); cfg_set_metadata_no_updates("no", NULL);
ck_assert_int_ne(stream_set_metadata(s1, NULL, NULL), 0); ck_assert_int_ne(stream_set_metadata(s1, NULL, NULL), 0);
/*
* Not running stream_set_metadata checked as libshout behaves
* different on different systems, making these unreliable ...
*/
m_str = NULL;
stream_set_metadata(s1, m, &m_str);
xfree(m_str);
m_str = NULL; m_str = NULL;
ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0);
ck_assert_ptr_eq(m_str, NULL);
ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test15-title.ogg"), 0); ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test15-title.ogg"), 0);
ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0); stream_set_metadata(s1, m, &m_str);
ck_assert_ptr_eq(m_str, NULL); xfree(m_str);
m_str = NULL;
ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test16-nometa.ogg"), 0); ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test16-nometa.ogg"), 0);
ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0); stream_set_metadata(s1, m, &m_str);
ck_assert_ptr_eq(m_str, NULL); xfree(m_str);
m_str = NULL;
cfg_set_metadata_format_str("test", NULL); cfg_set_metadata_format_str("test", NULL);
ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test01-artist+album+title.ogg"), 0); ck_assert_int_eq(mdata_parse_file(m, SRCDIR "/test01-artist+album+title.ogg"), 0);
ck_assert_int_ne(stream_set_metadata(s1, m, &m_str), 0); stream_set_metadata(s1, m, &m_str);
ck_assert_ptr_eq(m_str, NULL); xfree(m_str);
m_str = NULL;
mdata_destroy(&m); mdata_destroy(&m);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment