From patchwork Fri Jun 19 01:52:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Wang X-Patchwork-Id: 20489 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:80ca:0:0:0:0:0 with SMTP id c10csp106399ybm; Thu, 18 Jun 2020 18:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznM1ulCSHL8nRlTpIwCe1TPG/HSksLzonMY+WtbYCpWOzsboylzc+BmZF4Q7RIcO0U0uP8 X-Received: by 2002:a1c:9ec5:: with SMTP id h188mr1128182wme.9.1592531688493; Thu, 18 Jun 2020 18:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592531688; cv=none; d=google.com; s=arc-20160816; b=QsYI4TOP9TNCPMLePiI0fV5dYs2gL61s3xVqPG/IUHbavhLUG9JFOuoRSI/q8pl8/C 6o0hmkMN23oiQf+gLR3d0RvY7i6xEpDYejtR+K9ButyWm7QeBr1UeXQJx9n/n4WbDfks w/N0m7GMKaQNPW20V1pIlpzqC4j4/uWON0apDWxsdrd1bmdpqat5ACTCw6px4xnoo4OV bQD7PvYs+f/AGjRbKIituWx49gukz9424h2/xI1+Fn1COR9Ws2D8O3VSweWsoe5tvEzW fm/N9K9cl/jpJbefazf+PCGEHjC21Milbikf4RdFYAiX7qcJDtdVjDmoEbExbv6txeWP mOzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:ironport-sdr:ironport-sdr:delivered-to; bh=C0EOXcnMAxBRUadGH/t7vgMpgKrKqcNzRd1VvRjcPO0=; b=kEnILeGqQPl5NIP+iZo1/Lb84T3djgJqownajpDgDEPSMdKKQO6Wyf68sBoR38u3B0 iNatWamyxMWseixJn7vu/krNtt4WBvOjBqD0WdqNQOAahVGID4AOrYwjxBc2feoAlsjK ZCP9ljehJeZGwvRP5iEgAWgiOZ1bTNqJivNksvLuZPhivvxH1Nj2+cPMR087UQzIl/yU /FdsYoQZWMt9kzaUBCjPVbmSxb4oVeWkJ1BQQwsx1Vn4A2msAFhnYQdX0hwg8lDOZi22 1lHFENE3bPZgkh0Pw7iTD/VzDiBBvrStZch0hUuOOZrVJ6qY6NdSKJRHF2f49QMB0yPF 1rTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r11si4047524wrw.97.2020.06.18.18.54.48; Thu, 18 Jun 2020 18:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C868D68B661; Fri, 19 Jun 2020 04:53:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20B6068B5F3 for ; Fri, 19 Jun 2020 04:53:38 +0300 (EEST) IronPort-SDR: Ps5HcwWpqbmPYDXLMLrDP+8wWJvtbEUv7AcIFeZa0UNJQ/mchlsS5GD0MciEzErfaLEN82CyKI hDoaEpRd1K3g== X-IronPort-AV: E=McAfee;i="6000,8403,9656"; a="204278688" X-IronPort-AV: E=Sophos;i="5.75,253,1589266800"; d="scan'208";a="204278688" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2020 18:53:31 -0700 IronPort-SDR: 1N6QrRzEQdBYCwM0tOOGPcye7TzOvJ+VLosB9HMq783xrswXim2GVkDevPp7Tvi9Mkb1BPW8yF 8vnzrBWWscHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,253,1589266800"; d="scan'208";a="317989431" Received: from f.sh.intel.com ([10.239.159.122]) by FMSMGA003.fm.intel.com with ESMTP; 18 Jun 2020 18:53:29 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Jun 2020 09:52:48 +0800 Message-Id: <20200619015248.21873-9-fei.w.wang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200619015248.21873-1-fei.w.wang@intel.com> References: <20200619015248.21873-1-fei.w.wang@intel.com> Subject: [FFmpeg-devel] [PATCH v1 9/9] FATE/pixfmt_best: add more test case 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: Fei Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: F0J/Czbx68UV Content-Length: 3324 The new test case can cover the issue mentioned in commit 97ba9c1a Signed-off-by: Fei Wang --- libavutil/tests/pixfmt_best.c | 18 ++++++++++++++++++ tests/ref/fate/pixfmt_best | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/libavutil/tests/pixfmt_best.c b/libavutil/tests/pixfmt_best.c index 01387c7c98..30a41b1fa6 100644 --- a/libavutil/tests/pixfmt_best.c +++ b/libavutil/tests/pixfmt_best.c @@ -66,6 +66,21 @@ int main(void) ++pass; \ } while (0) +#define TEST_SPECIFIC(src, dst1, dst2, expected) do { \ + output = av_find_best_pix_fmt_of_2(dst1, dst2, \ + src, 0, NULL); \ + if (output != expected) { \ + printf("Matching %s with %s and %s: got %s, expected %s\n", \ + av_get_pix_fmt_name(src), \ + av_get_pix_fmt_name(dst1), \ + av_get_pix_fmt_name(dst2), \ + av_get_pix_fmt_name(output), \ + av_get_pix_fmt_name(expected)); \ + ++fail; \ + } else \ + ++pass; \ + } while (0) + // Same formats. for (i = 0; i < FF_ARRAY_ELEMS(pixfmt_list); i++) TEST(pixfmt_list[i], pixfmt_list[i]); @@ -135,6 +150,9 @@ int main(void) // Opaque formats are least unlike each other. TEST(AV_PIX_FMT_DXVA2_VLD, AV_PIX_FMT_VAAPI); + // Specific test list + TEST_SPECIFIC(AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_P012LE, AV_PIX_FMT_P010LE, AV_PIX_FMT_P010LE); + printf("%d tests passed, %d tests failed.\n", pass, fail); return !!fail; } diff --git a/tests/ref/fate/pixfmt_best b/tests/ref/fate/pixfmt_best index 5f51e2d845..1da1846275 100644 --- a/tests/ref/fate/pixfmt_best +++ b/tests/ref/fate/pixfmt_best @@ -1 +1 @@ -73 tests passed, 0 tests failed. +74 tests passed, 0 tests failed.