aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-21 14:51:35 +0100
committerMax Kellermann <max@duempel.org>2014-01-27 10:08:21 +0100
commit2b10ecfa37e273c752c3f87e2491e2a1a5f0ae58 (patch)
tree81c852b006ffcdf4f4f83fc1053895763cd03bbe /test
parentf7eb2b697ef6ac523632ad27b43b185f5901438c (diff)
downloadmpd-2b10ecfa37e273c752c3f87e2491e2a1a5f0ae58.tar.gz
mpd-2b10ecfa37e273c752c3f87e2491e2a1a5f0ae58.tar.xz
mpd-2b10ecfa37e273c752c3f87e2491e2a1a5f0ae58.zip
IcyMetadataParser: more robust tag parser
Allow semicolons and single quotes in the stream title. This is not part of any specification, but found in real life.
Diffstat (limited to 'test')
-rw-r--r--test/test_icy_parser.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_icy_parser.cxx b/test/test_icy_parser.cxx
index 83925cc99..2abf60f9e 100644
--- a/test/test_icy_parser.cxx
+++ b/test/test_icy_parser.cxx
@@ -14,6 +14,17 @@
#include <string>
+#include <string.h>
+
+static Tag *
+icy_parse_tag(const char *p)
+{
+ char *q = strdup(p);
+ Tag *tag = icy_parse_tag(q, q + strlen(q));
+ free(q);
+ return tag;
+}
+
static void
CompareTagTitle(const Tag &tag, const std::string &title)
{
@@ -51,10 +62,14 @@ public:
TestIcyParserTitle("StreamTitle='foo bar'", "foo bar");
TestIcyParserTitle("StreamTitle='foo bar';", "foo bar");
TestIcyParserTitle("StreamTitle='foo\"bar';", "foo\"bar");
+ TestIcyParserTitle("StreamTitle='foo=bar';", "foo=bar");
TestIcyParserTitle("a=b;StreamTitle='foo';", "foo");
TestIcyParserTitle("a=;StreamTitle='foo';", "foo");
TestIcyParserTitle("a=b;StreamTitle='foo';c=d", "foo");
TestIcyParserTitle("a=b;StreamTitle='foo'", "foo");
+ TestIcyParserTitle("a='b;c';StreamTitle='foo;bar'", "foo;bar");
+ TestIcyParserTitle("a='b'c';StreamTitle='foo'bar'", "foo'bar");
+ TestIcyParserTitle("StreamTitle='fo'o'b'ar';a='b'c'd'", "fo'o'b'ar");
}
};