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 BB8A446361 for ; Mon, 15 May 2023 15:28:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EF27468BF17; Mon, 15 May 2023 18:28:36 +0300 (EEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E4A3868BE7F for ; Mon, 15 May 2023 18:28:30 +0300 (EEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1ab0c697c2bso119276185ad.1 for ; Mon, 15 May 2023 08:28:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684164509; x=1686756509; 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=C7edYjj2fMshHjDBXHPkVKh79BcfLJr7RoumPMiBMV0=; b=cH4TrUvrfvP0pDP5TmDuKtdl0w8XAULQz+2PNPXsWpPT950/IBQoiud79tFzFRBIrw OX31gj6ej8YEn7oXt9H+LyWX2PKhpPVJx5kJeB/AZmlZkvJ7MLg5Thbvy7uSs6zInzMG J3Dn+q56XKUEoqFvDqNUrhnAlrBJnJri47GoKPXADxj3sDz11i2Q2DKQ845Wfe2Rjmxz raJoJUjciWR8SySoy0+BW8lP48s162zFLTViVYevAuTfqROWgAwzdqDKlCrixEwfelnm w07qkbYLavtHFSdAN7eYkgqczZRPigLAQu/M3Nm4VBo2m9GsTaFkMbopGBp7ERhflotv A1lg== X-Gm-Message-State: AC+VfDy/MNsUdeidPPq57djIP4imG1FxB4yDv7DmVfse0+D+PGDg5SEx FuATQC37LztzBk75ycIxmYyKnflhHIY= X-Google-Smtp-Source: ACHHUZ7MEfoHVVws9R5zECq0Kgw90pDQtnXT/Cqqfhrq5E3YWTbAqWTBqo1+sY58QTJxUkMDJKa7ig== X-Received: by 2002:a17:902:f816:b0:1a9:3916:c2d1 with SMTP id ix22-20020a170902f81600b001a93916c2d1mr35207267plb.54.1684164508673; Mon, 15 May 2023 08:28:28 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id f23-20020a170902ab9700b001a183ade911sm4911807plr.56.2023.05.15.08.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 08:28:28 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Mon, 15 May 2023 08:28:20 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 May 2023 08:28:12 -0700 Message-Id: <20230515152812.23405-2-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230515152812.23405-1-pal@sandflow.com> References: <20230515152812.23405-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v1 2/2] fate/imf: remove redundant code 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 | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/libavformat/tests/imf.c b/libavformat/tests/imf.c index a5bdf16645..a23b687c3d 100644 --- a/libavformat/tests/imf.c +++ b/libavformat/tests/imf.c @@ -257,7 +257,7 @@ const char *cpl_doc = "" ""; -const char *cpl_bad_doc = ""; +const char *cpl_bad_empty_doc = ""; const char *asset_map_doc = "" @@ -384,36 +384,11 @@ static int test_cpl_parsing(void) return 0; } -static int test_bad_cpl_parsing(FFIMFCPL **cpl) -{ - xmlDocPtr doc; - int ret; - - doc = xmlReadMemory(cpl_bad_doc, strlen(cpl_bad_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; - } - - ff_imf_cpl_free(*cpl); - *cpl = NULL; - - return 0; -} - -static int test_bad_resource_cpl_parsing(FFIMFCPL **cpl) -{ +static int test_bad_cpl(FFIMFCPL **cpl, const char* bad_cpl_doc) { xmlDocPtr doc; int ret; - doc = xmlReadMemory(cpl_bad_resource_doc, strlen(cpl_bad_resource_doc), NULL, NULL, 0); + doc = xmlReadMemory(bad_cpl_doc, strlen(bad_cpl_doc), NULL, NULL, 0); if (doc == NULL) { printf("XML parsing failed.\n"); return 1; @@ -591,7 +566,7 @@ int main(int argc, char *argv[]) ret = 1; printf("#### The following should fail ####\n"); - if (test_bad_cpl_parsing(&cpl) == 0) { + if (test_bad_cpl(&cpl, cpl_bad_empty_doc) == 0) { ret = 1; } else if (cpl) { printf("Improper cleanup after failed CPL parsing\n"); @@ -600,10 +575,7 @@ 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; - } else if (cpl) { - printf("Improper cleanup after failed CPL parsing\n"); + if (test_bad_cpl(&cpl, cpl_bad_resource_doc) != 0) { ret = 1; } printf("#### End emission of errors ####\n"); -- 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".