diff mbox series

[FFmpeg-devel,v2,2/2] avformat/tests/url: add test cases of double dot is not goto directory

Message ID 20200725024537.97453-2-lq@chinaffmpeg.org
State New
Headers show
Series [FFmpeg-devel,v2,1/2] avformat/url: check double dot is not to parent directory | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Liu Steven July 25, 2020, 2:45 a.m. UTC
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/tests/url.c | 5 +++++
 tests/ref/fate/url      | 5 +++++
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c
index 1d961a1b43..0201217109 100644
--- a/libavformat/tests/url.c
+++ b/libavformat/tests/url.c
@@ -67,6 +67,11 @@  int main(void)
     test("http://server/foo/bar?param&otherparam", "?someparam");
     test("http://server/foo/bar", "//other/url");
     test("http://server/foo/bar", "../../../../../other/url");
+    test("http://server/foo/bar", "../../../../../other/url/test..mp3");
+    test("http://server/foo/bar", "../../../../../other/url/test..");
+    test("http://server/foo/bar", "../../../../../other/url/..mp3");
+    test("http://server/foo/bar", "../../../../../other/url/..test/mp3");
+    test("http://server/foo/bar", "../../../../../other/url/test../mp3");
     test("http://server/foo/bar", "/../../../../../other/url");
     test("http://server/foo/bar", "/test/../../../../../other/url");
     test("http://server/foo/bar", "/test/../../test/../../../other/url");
diff --git a/tests/ref/fate/url b/tests/ref/fate/url
index 533ba2cb1e..6e12ee81bd 100644
--- a/tests/ref/fate/url
+++ b/tests/ref/fate/url
@@ -14,6 +14,11 @@  Testing ff_make_absolute_url:
             http://server/foo/bar?param&otherparam ?someparam           => http://server/foo/bar?someparam
                              http://server/foo/bar //other/url          => http://other/url
                              http://server/foo/bar ../../../../../other/url => http://server/other/url
+                             http://server/foo/bar ../../../../../other/url/test..mp3 => http://server/other/url/test..mp3
+                             http://server/foo/bar ../../../../../other/url/test.. => http://server/other/url/test..
+                             http://server/foo/bar ../../../../../other/url/..mp3 => http://server/other/url/..mp3
+                             http://server/foo/bar ../../../../../other/url/..test/mp3 => http://server/other/url/..test/mp3
+                             http://server/foo/bar ../../../../../other/url/test../mp3 => http://server/other/url/test../mp3
                              http://server/foo/bar /../../../../../other/url => http://server/other/url
                              http://server/foo/bar /test/../../../../../other/url => http://server/other/url
                              http://server/foo/bar /test/../../test/../../../other/url => http://server/other/url