From nobody Mon Feb 9 19:06:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594006990; cv=none; d=zohomail.com; s=zohoarc; b=MSAlzCrJIDhAPWSZQ5cgCGmpVaXPNycdgmAjyLyWSps/JHuvTltmmHl02cwmrtb95e2TW10tnfoa4qQCkRn816gwg9jhPEYSlQ1BjqlW/2sBDzbT7r4+Mf3MyJCpigyeIvRSIpA4NGvfdfcT0DJc4zO2DdXO+QMxdUOEWT7c/rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594006990; 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=4O0jYAR/dxPDmxowKVgpwH4OPud+2zbK58YXHD94MGI=; b=beryDhBAauXevJxvY6aptLdcs60oQLjoF6PIoa6JGeTtELlIm+e9TbYbRlqhJEZzCjTfd1Qy2A+lsAepYoLilxomB3sRx6gbcS54PY3fxjK/iDhrkEB0vk3QZs9lkVs1KtWvds8xibH/wwI1JFCeel9G+H/YcrLYlPalgXumsCk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594006990100306.7867703635053; Sun, 5 Jul 2020 20:43:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-XX2JhUECNL23xilBSibZ_Q-1; Sun, 05 Jul 2020 23:42:26 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 739668015CE; Mon, 6 Jul 2020 03:42:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E2AB7BEAF; Mon, 6 Jul 2020 03:42:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 03E2F93F85; Mon, 6 Jul 2020 03:42:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0663gGp6004770 for ; Sun, 5 Jul 2020 23:42:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 65DF3285858; Mon, 6 Jul 2020 03:42:16 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-194.phx2.redhat.com [10.3.112.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08A81275E36 for ; Mon, 6 Jul 2020 03:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594006989; 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=4O0jYAR/dxPDmxowKVgpwH4OPud+2zbK58YXHD94MGI=; b=YMhV76MQc9jOKvLopWxFYHOnZpKE/dNoq066NeLmCY9GZw4vW8b1IFT15C5vnTp8XvAezm tbJO/x/HTANDX2JFjb+QFaJFZacBAB/buPvkTVsSFBbMPnF4SjHOvr4/kW7vS6MTZIoZUE tWNsvnKKs2x/rSafhzo7Ky3/9/Usj04= X-MC-Unique: XX2JhUECNL23xilBSibZ_Q-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 24/32] tests: eliminate unnecessary labels Date: Sun, 5 Jul 2020 23:41:19 -0400 Message-Id: <20200706034127.1117504-25-laine@redhat.com> In-Reply-To: <20200706034127.1117504-1-laine@redhat.com> References: <20200706034127.1117504-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- tests/virbuftest.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/tests/virbuftest.c b/tests/virbuftest.c index 39ae7c2b9d..df341be50c 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -100,7 +100,6 @@ static int testBufTrim(const void *data G_GNUC_UNUSED) virBufferPtr buf =3D NULL; g_autofree char *result =3D NULL; const char *expected =3D "a,b"; - int ret =3D -1; =20 virBufferTrim(buf, ""); buf =3D &bufinit; @@ -120,13 +119,10 @@ static int testBufTrim(const void *data G_GNUC_UNUSED) result =3D virBufferContentAndReset(buf); if (!result || STRNEQ(result, expected)) { virTestDifference(stderr, expected, result); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 static int @@ -158,7 +154,6 @@ static int testBufAddBuffer(const void *data G_GNUC_UNU= SED) g_auto(virBuffer) buf1 =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf2 =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf3 =3D VIR_BUFFER_INITIALIZER; - int ret =3D -1; g_autofree char *result =3D NULL; const char *expected =3D \ " A long time ago, in a galaxy far,\n" \ @@ -178,17 +173,17 @@ static int testBufAddBuffer(const void *data G_GNUC_U= NUSED) =20 if (virBufferUse(&buf1)) { VIR_TEST_DEBUG("buf1 already in use"); - goto cleanup; + return -1; } =20 if (virBufferUse(&buf2)) { VIR_TEST_DEBUG("buf2 already in use"); - goto cleanup; + return -1; } =20 if (virBufferUse(&buf3)) { VIR_TEST_DEBUG("buf3 already in use"); - goto cleanup; + return -1; } =20 virBufferAdjustIndent(&buf1, 2); @@ -213,52 +208,50 @@ static int testBufAddBuffer(const void *data G_GNUC_U= NUSED) =20 if (!virBufferUse(&buf1)) { VIR_TEST_DEBUG("Error adding to buf1"); - goto cleanup; + return -1; } =20 if (!virBufferUse(&buf2)) { VIR_TEST_DEBUG("Error adding to buf2"); - goto cleanup; + return -1; } =20 if (!virBufferUse(&buf3)) { VIR_TEST_DEBUG("Error adding to buf3"); - goto cleanup; + return -1; } =20 virBufferAddBuffer(&buf2, &buf3); =20 if (!virBufferUse(&buf2)) { VIR_TEST_DEBUG("buf2 cleared mistakenly"); - goto cleanup; + return -1; } =20 if (virBufferUse(&buf3)) { VIR_TEST_DEBUG("buf3 is not clear even though it should be"); - goto cleanup; + return -1; } =20 virBufferAddBuffer(&buf1, &buf2); =20 if (!virBufferUse(&buf1)) { VIR_TEST_DEBUG("buf1 cleared mistakenly"); - goto cleanup; + return -1; } =20 if (virBufferUse(&buf2)) { VIR_TEST_DEBUG("buf2 is not clear even though it should be"); - goto cleanup; + return -1; } =20 result =3D virBufferContentAndReset(&buf1); if (STRNEQ_NULLABLE(result, expected)) { virTestDifference(stderr, expected, result); - goto cleanup; + return -1; } =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 static int --=20 2.25.4