From patchwork Sat Feb 8 21:18:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17718 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D8D2644B7C6 for ; Sat, 8 Feb 2020 23:18:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B274E68AFEB; Sat, 8 Feb 2020 23:18:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 08DB368AFEB for ; Sat, 8 Feb 2020 23:18:30 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id E6169E3B91; Sat, 8 Feb 2020 22:18:29 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bz5HrjUJSrEB; Sat, 8 Feb 2020 22:18:28 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 0ECEAE3B07; Sat, 8 Feb 2020 22:18:28 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 Feb 2020 22:18:12 +0100 Message-Id: <20200208211823.31345-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 Subject: [FFmpeg-devel] [PATCH 01/12] avformat/tests/url: make format more readable X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavformat/tests/url.c | 3 ++- tests/ref/fate/url | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) 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