]> git.sesse.net Git - vlc/commitdiff
Test cases for make_path()
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 30 Jan 2010 16:34:06 +0000 (18:34 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 30 Jan 2010 16:34:31 +0000 (18:34 +0200)
src/test/url.c

index f4b665138dbe28fb674aeeecd58ce5dc6b837a26..f5df985fab8603d1771cfb5c7989f41edcbf9c7f 100644 (file)
@@ -144,5 +144,19 @@ int main (void)
     /*val = fchdir (fd);
     assert (val != -1);*/
 
+    /* URI to path tests */
+#define test( a, b ) test (make_path, a, b)
+    test ("mailto:john@example.com", NULL);
+    test ("http://www.example.com/file.html#ref", NULL);
+    test ("file://", NULL);
+    test ("file:///", "/");
+    test ("file://localhost/home/john/music%2Eogg", "/home/john/music.ogg");
+    test ("file://localhost/home/john/text#ref", "/home/john/text");
+    test ("fd://0foobar", NULL);
+    test ("fd://0#ref", "/dev/stdin");
+    test ("fd://1", "/dev/stdout");
+    test ("fd://12345", "/dev/fd/12345");
+#undef test
+
     return 0;
 }