[vlc-devel] [PATCH 3/4] test/url: add tests for invalid URLs

Filip Roséen filip at atch.se
Fri Oct 28 10:49:46 CEST 2016


These added checks are there to make sure that common mistakes when
parsing the port-specification of an URL are avoided.
---
 src/test/url.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/test/url.c b/src/test/url.c
index 3ebc2be..3346728 100644
--- a/src/test/url.c
+++ b/src/test/url.c
@@ -311,6 +311,11 @@ int main (void)
     test_url_parse("p://G a r b a g e", NULL, NULL, NULL, NULL, 0, NULL, NULL);
     test_url_parse("p://h/G a r b a g e", NULL, NULL, NULL, NULL, 0, NULL, NULL);
     test_url_parse("http://example.com:123xyz", NULL, NULL, NULL, NULL, 0, NULL, NULL);
+    test_url_parse("http://example.com: 123", NULL, NULL, NULL, NULL, 0, NULL, NULL );
+    test_url_parse("http://example.com:+123", NULL, NULL, NULL, NULL, 0, NULL, NULL );
+    test_url_parse("http://example.com:-123", NULL, NULL, NULL, NULL, 0, NULL, NULL );
+    test_url_parse("http://example.com:-4294967298", NULL, NULL, NULL, NULL, 0, NULL, NULL );
+    test_url_parse("http://example.com:-18446744073709551615", NULL, NULL, NULL, NULL, 0, NULL, NULL );
 
     /* Reference test cases for reference URI resolution */
     static const char *rfc3986_cases[] =
-- 
2.10.1



More information about the vlc-devel mailing list