From nobody Mon Feb 9 20:10:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661175188; cv=none; d=zohomail.com; s=zohoarc; b=bcVzPnEv1wugdK3gjgOHTkHiDQ5oScKBZmQiMzZUjTFz9UmorZUNIvYb7vTD0itxQz3/TuxeMSWxu6tTEFFEyAQkamxpHsEX4kBFXtpoqiUJQvQ0QviK9+ykt3Y42i7x43seAELp01q1POJl2wthB7kVSPBh5PWqnsAYVcdNV+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661175188; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5Q2YWo8z8zWrWFAb9OUb2DTTX0PBINwb9avPpvqIshQ=; b=bXGElJO2BitWMKF7Sy0LcwluKQ5NPuPEmGis3NEldt7mddQx42l9OP59NCYOONS9rQLP50YsOnxmq0zuARoWcCDoY8jEOYs32BppxKB/lXeZq+NupAWumjv8iUfcKp8MACNFc87ExGHmXDEhdVP2nWQqEMgp0+0j9EdnZpFGPW4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1661175188424198.07889816610452; Mon, 22 Aug 2022 06:33:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-359-c3TuBt4_PnKpAoDTRw29FQ-1; Mon, 22 Aug 2022 09:32:15 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 178B51C0897C; Mon, 22 Aug 2022 13:32:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 018871415125; Mon, 22 Aug 2022 13:32:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 63E7B1946A5F; Mon, 22 Aug 2022 13:32:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 568281946A58 for ; Mon, 22 Aug 2022 13:31:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4188540CFD0D; Mon, 22 Aug 2022 13:31:52 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DDB240CFD0A for ; Mon, 22 Aug 2022 13:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661175187; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5Q2YWo8z8zWrWFAb9OUb2DTTX0PBINwb9avPpvqIshQ=; b=UqS2ExYNktxmtG+XzeZlr5ZoURfVfllKaE427+0GZIvfSxQbjNh349iS6agllRCa2LosVb 5rD8VUtCwIwSuqQrVLlm36cGz9l8BYc7zqt2AeX0p3BDHpebO+j3XL/2oICSGH309X8pSQ r073keUO1EIVk6aK9QVnYLnOjL5SmDY= X-MC-Unique: c3TuBt4_PnKpAoDTRw29FQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 10/16] tests: remove superfluous cleanup: labels and ret return variables Date: Mon, 22 Aug 2022 09:31:44 -0400 Message-Id: <20220822133150.1098794-11-laine@redhat.com> In-Reply-To: <20220822133150.1098794-1-laine@redhat.com> References: <20220822133150.1098794-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661175189485100002 Content-Type: text/plain; charset="utf-8"; x-default="true" After converting virNetworkDef * to g_autoptr(virNetworkDef) the cleanup codepath was empty, so it has been removed. Signed-off-by: Laine Stump --- tests/networkxml2firewalltest.c | 12 ++++-------- tests/networkxml2xmlupdatetest.c | 5 ++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltes= t.c index f895ca8c56..ca793fd4ea 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -90,17 +90,16 @@ static int testCompareXMLToArgvFiles(const char *xml, g_autofree char *actualargv =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; g_autoptr(virNetworkDef) def =3D NULL; - int ret =3D -1; char *actual; g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); =20 virCommandSetDryRun(dryRunToken, &buf, true, true, testCommandDryRun, = NULL); =20 if (!(def =3D virNetworkDefParseFile(xml, NULL))) - goto cleanup; + return -1; =20 if (networkAddFirewallRules(def) < 0) - goto cleanup; + return -1; =20 actual =3D actualargv =3D virBufferContentAndReset(&buf); =20 @@ -112,12 +111,9 @@ static int testCompareXMLToArgvFiles(const char *xml, actual +=3D strlen(baseargs); =20 if (virTestCompareToFileFull(actual, cmdline, false) < 0) - goto cleanup; + return -1; =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 struct testInfo { diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatet= est.c index 4926609f90..58b6f70c96 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -23,7 +23,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *= updatexml, g_autoptr(virNetworkDef) def =3D NULL; =20 if (virTestLoadFile(updatexml, &updateXmlData) < 0) - goto error; + return -1; =20 if (!(def =3D virNetworkDefParseFile(netxml, NULL))) goto fail; @@ -37,7 +37,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *= updatexml, =20 if (!expectFailure) { if (virTestCompareToFile(actual, outxml) < 0) - goto error; + return -1; } =20 ret =3D 0; @@ -52,7 +52,6 @@ testCompareXMLToXMLFiles(const char *netxml, const char *= updatexml, ret =3D 0; } } - error: return ret; } =20 --=20 2.37.1