From nobody Sun Feb 8 11:16:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.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=1578987558; cv=none; d=zohomail.com; s=zohoarc; b=IWsApUrSpt9EjC4uXyLfrCmQnlSi4h9ue5hD9pj4vLbHLsiqbcxm0DZIhb8P0GzPpwMXznTyThKXoPDyYnIWHzjy2e/rsUYwbfHcqnyfgRTJBiy274pEe+3WqSSPDD3YlFEpmIVZTrYOqLeeNVSFyRJxGCCDJC0EITh51Fv50C4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578987558; 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=kDI8YxVzYSIlt0t5zyfNk+B+V6eScKzIsGMbC2jvE10=; b=UDhoV+FeHh2jxvztvvGHltzZZKB2j2blnKq+0hCW8VReZAW+mRpoV0Tj3aZFoEWn4ssbg5MG2XB/e3E3XC73pVI/zGFE7v83VqWDpWjiEq7JAvQ72jfDU38kalyEVEMi4vz+cS/7WUWEaEesII1gfGCd3pMkkLpeUUdytY4T81g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578987558348302.1562526785119; Mon, 13 Jan 2020 23:39:18 -0800 (PST) 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-334-F9bl4HBdNayRPx61njoqpQ-1; Tue, 14 Jan 2020 02:35:25 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 924DE18C8C00; Tue, 14 Jan 2020 07:35:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 577AC10841A6; Tue, 14 Jan 2020 07:35:19 +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 E854418089D6; Tue, 14 Jan 2020 07:35:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00E7Yr0q020060 for ; Tue, 14 Jan 2020 02:34:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 688678886E; Tue, 14 Jan 2020 07:34:53 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id E60F88177F for ; Tue, 14 Jan 2020 07:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578987557; 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=kDI8YxVzYSIlt0t5zyfNk+B+V6eScKzIsGMbC2jvE10=; b=S0Y3fezg/37WdtneXjPdOLWxUmJhVVdOvB87FsD6CWbkNxhrABxHABtSNdQDlrjNVwdwaw /JrbQzyydPjpsLEYfBfDt+/Hrm3lWGS9qJNollM8fk1sfcEjd8x2ktQjVa/HIXjYT8c9F+ bjK1SFXwvR/OD4+L1bj3CZafXMaz7T0= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 14 Jan 2020 08:35:37 +0100 Message-Id: <203578ea9ef1eb9cbacf4f7314daf67cbf98c2b8.1578987257.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/7] virbuftest: remove unnecessary labels 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.84 on 10.5.11.22 X-MC-Unique: F9bl4HBdNayRPx61njoqpQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Remove the ret variables and labels from functions that no longer need them. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Erik Skultety --- tests/virbuftest.c | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/tests/virbuftest.c b/tests/virbuftest.c index 2b241424ad..bb7fa9e2e9 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -246,7 +246,6 @@ testBufAddStr(const void *opaque) const struct testBufAddStrData *data =3D opaque; virBuffer buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *actual =3D NULL; - int ret =3D -1; =20 virBufferAddLit(&buf, "\n"); virBufferAdjustIndent(&buf, 2); @@ -256,19 +255,16 @@ testBufAddStr(const void *opaque) =20 if (!(actual =3D virBufferContentAndReset(&buf))) { VIR_TEST_DEBUG("buf is empty"); - goto cleanup; + return -1; } =20 if (STRNEQ_NULLABLE(actual, data->expect)) { VIR_TEST_DEBUG("testBufAddStr(): Strings don't match:"); virTestDifference(stderr, data->expect, actual); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 @@ -278,7 +274,6 @@ testBufEscapeStr(const void *opaque) const struct testBufAddStrData *data =3D opaque; virBuffer buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *actual =3D NULL; - int ret =3D -1; =20 virBufferAddLit(&buf, "\n"); virBufferAdjustIndent(&buf, 2); @@ -288,19 +283,16 @@ testBufEscapeStr(const void *opaque) =20 if (!(actual =3D virBufferContentAndReset(&buf))) { VIR_TEST_DEBUG("buf is empty"); - goto cleanup; + return -1; } =20 if (STRNEQ_NULLABLE(actual, data->expect)) { VIR_TEST_DEBUG("testBufEscapeStr(): Strings don't match:"); virTestDifference(stderr, data->expect, actual); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 @@ -310,25 +302,21 @@ testBufEscapeRegex(const void *opaque) const struct testBufAddStrData *data =3D opaque; virBuffer buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *actual =3D NULL; - int ret =3D -1; =20 virBufferEscapeRegex(&buf, "%s", data->data); =20 if (!(actual =3D virBufferContentAndReset(&buf))) { VIR_TEST_DEBUG("testBufEscapeRegex: buf is empty"); - goto cleanup; + return -1; } =20 if (STRNEQ_NULLABLE(actual, data->expect)) { VIR_TEST_DEBUG("testBufEscapeRegex: Strings don't match:"); virTestDifference(stderr, data->expect, actual); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 @@ -337,7 +325,6 @@ testBufSetIndent(const void *opaque G_GNUC_UNUSED) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *actual =3D NULL; - int ret =3D -1; =20 virBufferSetIndent(&buf, 11); virBufferAddLit(&buf, "test\n"); @@ -345,17 +332,14 @@ testBufSetIndent(const void *opaque G_GNUC_UNUSED) virBufferAddLit(&buf, "test2\n"); =20 if (!(actual =3D virBufferContentAndReset(&buf))) - goto cleanup; + return -1; =20 if (STRNEQ(actual, " test\n test2\n")) { VIR_TEST_DEBUG("testBufSetIndent: expected indent not set"); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list