]> git.sesse.net Git - vlc/blobdiff - src/test/url.c
enable the block tests
[vlc] / src / test / url.c
index d03e48ca6d8953c7ff0c05bb7a692ade263715d3..64060b5c2eb6b80fe2e4958f9806588918fb39c7 100644 (file)
@@ -66,6 +66,15 @@ static inline void test_path (const char *in, const char *out)
     test (make_URI, in, out);
 }
 
+static inline void test_current_directory_path (const char *in, const char *cwd, const char *out)
+{
+    char * expected_result = NULL;
+    int val = asprintf(&expected_result, "file://%s/%s", cwd, out);
+    assert (val != -1);
+    
+    test (make_URI, in, expected_result);
+}
+
 int main (void)
 {
     int val;
@@ -108,15 +117,23 @@ int main (void)
     test_path ("/", "file:///");
     test_path ("/home/john/", "file:///home/john/");
     test_path ("/home/john/music.ogg", "file:///home/john/music.ogg");
-    //test_path ("\\\\server/pub/music.ogg", "file://server/pub/music.ogg");
+    test_path ("\\\\server/pub/music.ogg", "smb://server/pub/music.ogg");
+    test_path ("\\\\server\\pub\\music.ogg", "smb://server/pub/music.ogg");
 
     /*int fd = open (".", O_RDONLY);
     assert (fd != -1);*/
     val = chdir ("/tmp");
     assert (val != -1);
-    test_path ("movie.ogg", "file:///tmp/movie.ogg");
-    test_path (".", "file:///tmp/.");
-    test_path ("", "file:///tmp/");
+
+    char buf[256];
+    char * tmpdir;
+    tmpdir = getcwd(buf, sizeof(buf)/sizeof(*buf));
+    assert (tmpdir);
+
+    test_current_directory_path ("movie.ogg", tmpdir, "movie.ogg");
+    test_current_directory_path (".", tmpdir, ".");
+    test_current_directory_path ("", tmpdir, "");
+
     /*val = fchdir (fd);
     assert (val != -1);*/