[vlc-commits] url: add test cases for relative URIs
Rémi Denis-Courmont
git at videolan.org
Sun Jul 17 16:13:56 CEST 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 17 16:47:40 2016 +0300| [9078d0b6675e78c8e12526044fd85f58bf9238e2] | committer: Rémi Denis-Courmont
url: add test cases for relative URIs
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9078d0b6675e78c8e12526044fd85f58bf9238e2
---
src/test/url.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/test/url.c b/src/test/url.c
index fb78422..7710dcb 100644
--- a/src/test/url.c
+++ b/src/test/url.c
@@ -231,6 +231,18 @@ int main (void)
NULL, NULL);
test_url_parse("p://h/white%20spaced", "p", NULL, NULL, "h", 0,
"/white%20spaced", NULL);
+ /* Relative URIs */
+ test_url_parse("//example.com", NULL, NULL, NULL, "example.com", 0,
+ NULL, NULL);
+ test_url_parse("/file", NULL, NULL, NULL, NULL, 0, "/file", NULL);
+ test_url_parse("?opt=val", NULL, NULL, NULL, NULL, 0, "", "opt=val");
+ test_url_parse("/f?o=v", NULL, NULL, NULL, NULL, 0, "/f", "o=v");
+ test_url_parse("//example.com/file", NULL, NULL, NULL, "example.com", 0,
+ "/file", NULL);
+ test_url_parse("//example.com?opt=val", NULL, NULL, NULL, "example.com", 0,
+ NULL, "opt=val");
+ test_url_parse("//example.com/f?o=v", NULL, NULL, NULL, "example.com", 0,
+ "/f", "o=v");
/* Invalid URIs */
test_url_parse("p://G a r b a g e", "p", NULL, NULL, NULL, 0, NULL, NULL);
test_url_parse("p://h/G a r b a g e", "p", NULL, NULL, "h", 0, NULL, NULL);
More information about the vlc-commits
mailing list