summaryrefslogtreecommitdiff
path: root/plparse/tests
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2012-10-29 08:22:10 +0100
committerBastien Nocera <hadess@hadess.net>2012-10-29 11:20:50 +0100
commitfeeb3d38ae02e1ff9bdf5e8e9fbb2800e0849845 (patch)
tree596af9024f65e7321edab42ce44ae3fe180dd976 /plparse/tests
parent386c1cca31ee41e888540c8dc4f47023eaeb65bb (diff)
downloadtotem-pl-parser-feeb3d38ae02e1ff9bdf5e8e9fbb2800e0849845.tar.gz
plparse: Don't overescape parse URIs in XSPF
Passing a URI through g_file_new()/g_file_get_uri() will create escaping problems if the original URI contained spaces on purpose (for example, rtmp URLs with additional parameters). Original patch by György Balló <ballogy@freestart.hu> https://bugzilla.gnome.org/show_bug.cgi?id=687088
Diffstat (limited to 'plparse/tests')
-rw-r--r--plparse/tests/parser.c10
-rw-r--r--plparse/tests/playlist.xspf2
2 files changed, 11 insertions, 1 deletions
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index 2350a1c..48882f9 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -513,6 +513,15 @@ test_parsing_xspf_genre (void)
}
static void
+test_parsing_xspf_escaping (void)
+{
+ char *uri;
+ uri = get_relative_uri (TEST_SRCDIR "playlist.xspf");
+ g_assert_cmpstr (parser_test_get_entry_field (uri, TOTEM_PL_PARSER_FIELD_URI), ==, "http://207.200.96.226:8000 extraparam=1");
+ g_free (uri);
+}
+
+static void
test_smi_starttime (void)
{
char *uri;
@@ -1138,6 +1147,7 @@ main (int argc, char *argv[])
g_test_add_func ("/parser/parsing/not_really_php_but_html_instead", test_parsing_not_really_php_but_html_instead);
g_test_add_func ("/parser/parsing/num_items_in_pls", test_parsing_num_entries);
g_test_add_func ("/parser/parsing/xspf_genre", test_parsing_xspf_genre);
+ g_test_add_func ("/parser/parsing/xspf_escaping", test_parsing_xspf_escaping);
g_test_add_func ("/parser/parsing/itms_link", test_itms_parsing);
g_test_add_func ("/parser/parsing/lastfm-attributes", test_lastfm_parsing);
g_test_add_func ("/parser/parsing/m3u_separator", test_m3u_separator);
diff --git a/plparse/tests/playlist.xspf b/plparse/tests/playlist.xspf
index 543780d..75cd302 100644
--- a/plparse/tests/playlist.xspf
+++ b/plparse/tests/playlist.xspf
@@ -3,7 +3,7 @@
<creator>audacious-plugins-1.4.5</creator>
<trackList>
<track>
- <location>http://207.200.96.226:8000</location>
+ <location>http://207.200.96.226:8000 extraparam=1</location>
<title>Sven Van Hess - Ocean Jive (Groove Salad: a nicely chilled plate of ambient beats and grooves. [SomaFM])</title>
<meta rel="mtime">0</meta>
<extension application="http://www.rhythmbox.org">