From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4990345897 for ; Wed, 26 Apr 2023 17:53:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3411768BF44; Wed, 26 Apr 2023 20:53:26 +0300 (EEST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0149968BBA2 for ; Wed, 26 Apr 2023 20:53:19 +0300 (EEST) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-63b87d23729so5947514b3a.0 for ; Wed, 26 Apr 2023 10:53:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682531598; x=1685123598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eVhJQt2Ncf//MST5+udLOrIYmmFaDSGqaFASyE2AxcU=; b=Ha1OhDiU5F9EnAX8XZ092KgP5oXNS7OWwggiGUJQifYE1H/mfubCGAa/wp8AzcRcB9 Q6I9bV4jPcf53R66HjzvkkhcMPvvSYmAWDr7gKwCMMCcj/QrFyBoPGlfLtwx2OQCRqji ODx+n91YEdrJjoqzcXJWpopBWxY25+zWHKff194dknQtqEE0yQZ8RwJ/69x6xPLsctef Bkn0LjqxNDA1Bb5q0N0lM+Qawl54XeLY2TI/ME0km3/fkNUjSyZDQ6oRCfnkzWhfPa/x yzD5GqKH8PrLs/piW0q8iRkhU1lK1fYglwfFcDpq4nQ5Vc2eQeJrhNeXQIIv7kPYdG/x JTRw== X-Gm-Message-State: AAQBX9drgEWL94W5aXvCiJiOLvPQlub4h8UjCEtH3tE7nwtO/Z8eW5wN IegCpz2Ye0MfWX1ygoYnxO79djqMj3U= X-Google-Smtp-Source: AKy350YZaAylOyMqtrW6wrVFYuZV3z/RfwUQzP+BnSHauROBHXXz/V0qSnFodxuuiGnx6zkeDtbQkg== X-Received: by 2002:a05:6a00:1a8b:b0:63b:817f:664 with SMTP id e11-20020a056a001a8b00b0063b817f0664mr27139409pfv.22.1682531597814; Wed, 26 Apr 2023 10:53:17 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id i2-20020aa787c2000000b0063932e36437sm11580129pfo.134.2023.04.26.10.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 10:53:17 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Wed, 26 Apr 2023 10:53:11 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 26 Apr 2023 10:53:02 -0700 Message-Id: <20230426175302.946-2-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230426175302.946-1-pal@sandflow.com> References: <20230426175302.946-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/tests/imf: add invalid resource test X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Pierre-Anthony Lemieux Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Pierre-Anthony Lemieux --- libavformat/tests/imf.c | 65 +++++++++++++++++++++++++++++++++++++++++ tests/ref/fate/imf | 2 ++ 2 files changed, 67 insertions(+) diff --git a/libavformat/tests/imf.c b/libavformat/tests/imf.c index 2cacb43f47..cfd84fb8c8 100644 --- a/libavformat/tests/imf.c +++ b/libavformat/tests/imf.c @@ -218,6 +218,45 @@ const char *cpl_doc = "" ""; + const char *cpl_bad_resource_doc = + "" + "urn:uuid:8713c020-2489-45f5-a9f7-87be539e20b5" + "2021-07-13T17:06:22Z" + "FFMPEG" + "FFMPEG sample content" + "" + " " + " urn:uuid:8e097bb0-cff7-4969-a692-bad47bfb528f" + " " + "" + "" + "false" + "24" + "02:10:01.23" + "" + "24000 1001" + "" + "" + "urn:uuid:81fed4e5-9722-400a-b9d1-7f2bd21df4b6" + "" + "" + "urn:uuid:6ae100b0-92d1-41be-9321-85e0933dfc42" + "urn:uuid:e8ef9653-565c-479c-8039-82d4547973c5" + "" + "" + "urn:uuid:7d418acb-07a3-4e57-984c-b8ea2f7de4ec" + "24" + "urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751" + "" + "" + "" + "" + "" + "" + ""; + const char *cpl_bad_doc = ""; const char *asset_map_doc = @@ -366,6 +405,27 @@ static int test_bad_cpl_parsing(FFIMFCPL **cpl) return 0; } +static int test_bad_resource_cpl_parsing(FFIMFCPL **cpl) +{ + xmlDocPtr doc; + int ret; + + doc = xmlReadMemory(cpl_bad_resource_doc, strlen(cpl_bad_resource_doc), NULL, NULL, 0); + if (doc == NULL) { + printf("XML parsing failed.\n"); + return 1; + } + + ret = ff_imf_parse_cpl_from_xml_dom(doc, cpl); + xmlFreeDoc(doc); + if (ret) { + printf("CPL parsing failed.\n"); + return ret; + } + + return 0; +} + static int check_asset_locator_attributes(IMFAssetLocator *asset, IMFAssetLocator *expected_asset) { @@ -533,5 +593,10 @@ int main(int argc, char *argv[]) } printf("#### End failing test ####\n"); + printf("#### The following should emit errors ####\n"); + if (test_bad_resource_cpl_parsing(&cpl) != 0) + ret = 1; + printf("#### End emission of errors ####\n"); + return ret; } diff --git a/tests/ref/fate/imf b/tests/ref/fate/imf index 5093167bc7..fdfed8ac17 100644 --- a/tests/ref/fate/imf +++ b/tests/ref/fate/imf @@ -53,3 +53,5 @@ For asset: 4: #### The following should fail #### CPL parsing failed. #### End failing test #### +#### The following should emit errors #### +#### End emission of errors #### -- 2.25.1 _______________________________________________ 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".