[vlc-commits] http: test cases for ICY plugin hand-over

Rémi Denis-Courmont git at videolan.org
Tue Mar 1 06:57:42 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Mar  1 07:38:06 2016 +0200| [b6a5c31fd7f55da73bda6513cf97a8432b6359b0] | committer: Rémi Denis-Courmont

http: test cases for ICY plugin hand-over

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b6a5c31fd7f55da73bda6513cf97a8432b6359b0
---

 modules/access/http/file_test.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/modules/access/http/file_test.c b/modules/access/http/file_test.c
index d9e043b..acc2aa9 100644
--- a/modules/access/http/file_test.c
+++ b/modules/access/http/file_test.c
@@ -37,6 +37,7 @@
 static const char url[] = "https://www.example.com:8443/dir/file.ext?a=b";
 static const char url_http[] = "http://www.example.com:8443/dir/file.ext?a=b";
 static const char url_mmsh[] = "mmsh://www.example.com:8443/dir/file.ext?a=b";
+static const char url_icyx[] = "icyx://www.example.com:8443/dir/file.ext?a=b";
 static const char ua[] = PACKAGE_NAME "/" PACKAGE_VERSION " (test suite)";
 
 static const char *replies[2] = { NULL, NULL };
@@ -221,6 +222,12 @@ int main(void)
     assert(vlc_http_file_seek(f, 0) == 0);
     assert(vlc_http_file_get_redirect(f) == NULL);
 
+    replies[0] = "HTTP/1.1 200 OK\r\n"
+                 "Icy-Name:CraptasticRadio\r\n"
+                 "\r\n";
+    assert(vlc_http_file_seek(f, 0) == 0);
+    assert(vlc_http_file_get_redirect(f) == NULL);
+
     vlc_http_file_destroy(f);
 
     secure = false;
@@ -236,6 +243,14 @@ int main(void)
     assert(str != NULL && strcmp(str, url_mmsh) == 0);
     free(str);
 
+    replies[0] = "HTTP/1.1 200 OK\r\n"
+                 "Icy-Name:CraptasticRadio\r\n"
+                 "\r\n";
+    vlc_http_file_seek(f, 0);
+    str = vlc_http_file_get_redirect(f);
+    assert(str != NULL && strcmp(str, url_icyx) == 0);
+    free(str);
+
     vlc_http_file_destroy(f);
 
     /* Dummy API calls */



More information about the vlc-commits mailing list