diff mbox series

[FFmpeg-devel,01/12] avformat/tests/url: make format more readable

Message ID 20200208211823.31345-1-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,01/12] avformat/tests/url: make format more readable
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Marton Balint Feb. 8, 2020, 9:18 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/tests/url.c |  3 ++-
 tests/ref/fate/url      | 27 ++++++++++++++-------------
 2 files changed, 16 insertions(+), 14 deletions(-)

Comments

Marton Balint Feb. 14, 2020, 11:35 p.m. UTC | #1
On Sat, 8 Feb 2020, Marton Balint wrote:

> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavformat/tests/url.c |  3 ++-
> tests/ref/fate/url      | 27 ++++++++++++++-------------
> 2 files changed, 16 insertions(+), 14 deletions(-)

Ping for the series, will apply soon...

Thanks,
Marton

>
> diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c
> index 1623179128..11ed5bb0b7 100644
> --- a/libavformat/tests/url.c
> +++ b/libavformat/tests/url.c
> @@ -24,7 +24,7 @@ static void test(const char *base, const char *rel)
> {
>     char buf[200], buf2[200];
>     ff_make_absolute_url(buf, sizeof(buf), base, rel);
> -    printf("%s\n", buf);
> +    printf("%50s %-20s => %s\n", base, rel, buf);
>     if (base) {
>         /* Test in-buffer replacement */
>         snprintf(buf2, sizeof(buf2), "%s", base);
> @@ -38,6 +38,7 @@ static void test(const char *base, const char *rel)
> 
> int main(void)
> {
> +    printf("Testing ff_make_absolute_url:\n");
>     test(NULL, "baz");
>     test("/foo/bar", "baz");
>     test("/foo/bar", "../baz");
> diff --git a/tests/ref/fate/url b/tests/ref/fate/url
> index 1a6051ee0f..b5deba88ae 100644
> --- a/tests/ref/fate/url
> +++ b/tests/ref/fate/url
> @@ -1,13 +1,14 @@
> -baz
> -/foo/baz
> -/baz
> -/baz
> -http://server/foo/baz
> -http://server/foo/baz
> -http://server/baz
> -http://server/baz
> -http://server/baz
> -https://other/url
> -http://server/baz
> -http://server/foo/bar?someparam
> -http://other/url
> +Testing ff_make_absolute_url:
> +                                            (null) baz                  => baz
> +                                          /foo/bar baz                  => /foo/baz
> +                                          /foo/bar ../baz               => /baz
> +                                          /foo/bar /baz                 => /baz
> +                                http://server/foo/ baz                  => http://server/foo/baz
> +                             http://server/foo/bar baz                  => http://server/foo/baz
> +                                http://server/foo/ ../baz               => http://server/baz
> +                         http://server/foo/bar/123 ../../baz            => http://server/baz
> +                         http://server/foo/bar/123 /baz                 => http://server/baz
> +                         http://server/foo/bar/123 https://other/url    => https://other/url
> +    http://server/foo/bar?param=value/with/slashes /baz                 => http://server/baz
> +            http://server/foo/bar?param&otherparam ?someparam           => http://server/foo/bar?someparam
> +                             http://server/foo/bar //other/url          => http://other/url
> -- 
> 2.16.4
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint Feb. 15, 2020, 6:27 p.m. UTC | #2
On Sat, 15 Feb 2020, Marton Balint wrote:

>
>
> On Sat, 8 Feb 2020, Marton Balint wrote:
>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>> libavformat/tests/url.c |  3 ++-
>> tests/ref/fate/url      | 27 ++++++++++++++-------------
>> 2 files changed, 16 insertions(+), 14 deletions(-)
>
> Ping for the series, will apply soon...

Applied.

Regards,
Marton

>>
>> diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c
>> index 1623179128..11ed5bb0b7 100644
>> --- a/libavformat/tests/url.c
>> +++ b/libavformat/tests/url.c
>> @@ -24,7 +24,7 @@ static void test(const char *base, const char *rel)
>> {
>>     char buf[200], buf2[200];
>>     ff_make_absolute_url(buf, sizeof(buf), base, rel);
>> -    printf("%s\n", buf);
>> +    printf("%50s %-20s => %s\n", base, rel, buf);
>>     if (base) {
>>         /* Test in-buffer replacement */
>>         snprintf(buf2, sizeof(buf2), "%s", base);
>> @@ -38,6 +38,7 @@ static void test(const char *base, const char *rel)
>> 
>> int main(void)
>> {
>> +    printf("Testing ff_make_absolute_url:\n");
>>     test(NULL, "baz");
>>     test("/foo/bar", "baz");
>>     test("/foo/bar", "../baz");
>> diff --git a/tests/ref/fate/url b/tests/ref/fate/url
>> index 1a6051ee0f..b5deba88ae 100644
>> --- a/tests/ref/fate/url
>> +++ b/tests/ref/fate/url
>> @@ -1,13 +1,14 @@
>> -baz
>> -/foo/baz
>> -/baz
>> -/baz
>> -http://server/foo/baz
>> -http://server/foo/baz
>> -http://server/baz
>> -http://server/baz
>> -http://server/baz
>> -https://other/url
>> -http://server/baz
>> -http://server/foo/bar?someparam
>> -http://other/url
>> +Testing ff_make_absolute_url:
>> +                                            (null) baz                  => 
> baz
>> +                                          /foo/bar baz                  => 
> /foo/baz
>> +                                          /foo/bar ../baz               => 
> /baz
>> +                                          /foo/bar /baz                 => 
> /baz
>> +                                http://server/foo/ baz                  => 
> http://server/foo/baz
>> +                             http://server/foo/bar baz                  => 
> http://server/foo/baz
>> +                                http://server/foo/ ../baz               => 
> http://server/baz
>> +                         http://server/foo/bar/123 ../../baz            => 
> http://server/baz
>> +                         http://server/foo/bar/123 /baz                 => 
> http://server/baz
>> +                         http://server/foo/bar/123 https://other/url    => 
> https://other/url
>> +    http://server/foo/bar?param=value/with/slashes /baz                 => 
> http://server/baz
>> +            http://server/foo/bar?param&otherparam ?someparam           => 
> http://server/foo/bar?someparam
>> +                             http://server/foo/bar //other/url          => 
> http://other/url
>> -- 
>> 2.16.4
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c
index 1623179128..11ed5bb0b7 100644
--- a/libavformat/tests/url.c
+++ b/libavformat/tests/url.c
@@ -24,7 +24,7 @@  static void test(const char *base, const char *rel)
 {
     char buf[200], buf2[200];
     ff_make_absolute_url(buf, sizeof(buf), base, rel);
-    printf("%s\n", buf);
+    printf("%50s %-20s => %s\n", base, rel, buf);
     if (base) {
         /* Test in-buffer replacement */
         snprintf(buf2, sizeof(buf2), "%s", base);
@@ -38,6 +38,7 @@  static void test(const char *base, const char *rel)
 
 int main(void)
 {
+    printf("Testing ff_make_absolute_url:\n");
     test(NULL, "baz");
     test("/foo/bar", "baz");
     test("/foo/bar", "../baz");
diff --git a/tests/ref/fate/url b/tests/ref/fate/url
index 1a6051ee0f..b5deba88ae 100644
--- a/tests/ref/fate/url
+++ b/tests/ref/fate/url
@@ -1,13 +1,14 @@ 
-baz
-/foo/baz
-/baz
-/baz
-http://server/foo/baz
-http://server/foo/baz
-http://server/baz
-http://server/baz
-http://server/baz
-https://other/url
-http://server/baz
-http://server/foo/bar?someparam
-http://other/url
+Testing ff_make_absolute_url:
+                                            (null) baz                  => baz
+                                          /foo/bar baz                  => /foo/baz
+                                          /foo/bar ../baz               => /baz
+                                          /foo/bar /baz                 => /baz
+                                http://server/foo/ baz                  => http://server/foo/baz
+                             http://server/foo/bar baz                  => http://server/foo/baz
+                                http://server/foo/ ../baz               => http://server/baz
+                         http://server/foo/bar/123 ../../baz            => http://server/baz
+                         http://server/foo/bar/123 /baz                 => http://server/baz
+                         http://server/foo/bar/123 https://other/url    => https://other/url
+    http://server/foo/bar?param=value/with/slashes /baz                 => http://server/baz
+            http://server/foo/bar?param&otherparam ?someparam           => http://server/foo/bar?someparam
+                             http://server/foo/bar //other/url          => http://other/url