From nobody Sun Feb 8 05:35:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1630788698; cv=none; d=zohomail.com; s=zohoarc; b=OGu7upHPDL9NyevFNJgGN7xSI5X3cGZ8n+6RyWTKDI2h//MuX4uNQxy1x5DK2Cy2PVNgEBD0RQv3xr388k4j96ZHDH3EBOANOVKo2on6QxbOead0HQPEK03zwXiJVl/GpjqThl5haNwtYse/NQu+n9Wpr1HXqTH/F3echYlqDac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630788698; 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=Um61ulYlUTHhmkIffNCSj3EwBc3CYF/CvicnvwLn6RQ=; b=KoJisl8vNh8HYF3azYNpoIuP9qlj5EmLTUaDT2AYEVBdTqo0B0hna8HmRQcn8vvnVJr9Z1exZ6KfnsyBz1W9KAYQy3xtg8kQsOBiLJk1VG7muMKcPIHPenjYD6BJ1zeSTDM67XVsY4vziVxjOkXtJpBQ5FzviQuHyKNw+5opL84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1630788698736781.4576955565113; Sat, 4 Sep 2021 13:51:38 -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-564-Sj2J3UmwNQK7cWBFnvXUTA-1; Sat, 04 Sep 2021 16:51:35 -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 20A5E1854E21; Sat, 4 Sep 2021 20:51:31 +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 061CB6091B; Sat, 4 Sep 2021 20:51:31 +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 A5729180BAB3; Sat, 4 Sep 2021 20:51:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 184KieN1008868 for ; Sat, 4 Sep 2021 16:44:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id D256C2619D; Sat, 4 Sep 2021 20:44:40 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C47E1F4 for ; Sat, 4 Sep 2021 20:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630788697; 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=Um61ulYlUTHhmkIffNCSj3EwBc3CYF/CvicnvwLn6RQ=; b=INq5RCdYbe4+bdV9qwGWW7qgfYxKkSjNzi5xNUdNGmvBrVzK2hrl9Pg/A7OkHmtDsCzavb IHfwlp4p7wEFCyOU12qLR68mM/d/aTdIdlxo+iJxRzsLPby1f8j5p8C2eFq3NyQoiizNT2 rK5vIGNDkWbLIEuaKVnymt59woOuS2o= X-MC-Unique: Sj2J3UmwNQK7cWBFnvXUTA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 16/24] tests: use g_auto instead of vshTableFree Date: Sat, 4 Sep 2021 22:44:14 +0200 Message-Id: <42e98a7b6d43df688546b92b2a92e5b2154fd86d.1630788206.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630788699324100001 Signed-off-by: J=C3=A1n Tomko --- tests/vshtabletest.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index 804aaf4d9c..569d7a852f 100644 --- a/tests/vshtabletest.c +++ b/tests/vshtabletest.c @@ -55,7 +55,7 @@ testVshTableHeader(const void *opaque G_GNUC_UNUSED) " 1 fedora28 running\n" " 2 rhel7.5 running\n"; =20 - vshTable *table =3D vshTableNew("Id", "Name", "State", + g_autoptr(vshTable) table =3D vshTableNew("Id", "Name", "State", NULL); //to ask about return if (!table) goto cleanup; @@ -75,7 +75,6 @@ testVshTableHeader(const void *opaque G_GNUC_UNUSED) =20 cleanup: VIR_FREE(act); - vshTableFree(table); return ret; } =20 @@ -84,7 +83,7 @@ testVshTableRowAppend(const void *opaque G_GNUC_UNUSED) { int ret =3D 0; =20 - vshTable *table =3D vshTableNew("Id", "Name", NULL); + g_autoptr(vshTable) table =3D vshTableNew("Id", "Name", NULL); if (!table) goto cleanup; =20 @@ -111,7 +110,6 @@ testVshTableRowAppend(const void *opaque G_GNUC_UNUSED) } =20 cleanup: - vshTableFree(table); return ret; } =20 @@ -126,7 +124,7 @@ testUnicode(const void *opaque G_GNUC_UNUSED) "-----------------------------------------\n" " 1 fedora28 running\n" " 2 =E3=81=A4=E3=81=B8=E3=82=BDrhel7.5=E3=81=A4=E3=81=B8=E3=82= =BD running\n"; - vshTable *table; + g_autoptr(vshTable) table =3D NULL; =20 table =3D vshTableNew("Id", "=E5=90=8D=E7=A8=B1", "=D0=B3=D0=BE=D1=81= =D1=83=D0=B4=D0=B0=D1=80=D1=81=D1=82=D0=B2=D0=BE", NULL); if (!table) @@ -141,7 +139,6 @@ testUnicode(const void *opaque G_GNUC_UNUSED) ret =3D -1; =20 cleanup: - vshTableFree(table); return ret; } =20 @@ -157,7 +154,7 @@ testUnicodeArabic(const void *opaque G_GNUC_UNUSED) "-----------------------------------------------------------------= --------------------------\n" " 1 =EF=BB=89=EF=BA=AA=EF=BB=B4=EF=BB=9F =EF=BA=8E=EF= =BB=A0=EF=BA=9C=EF=BB=98=EF=BB=B4=EF=BB=9F =EF=BB=95=EF=BA=8E=EF=BB=A3 =EF= =BB=8A=EF=BB=A7, =D9=A3=D9=A0 =EF=BB=8E=EF=BB=B4=EF=BB=A8=EF=BB=B3=EF=BA=8D= =EF=BB=AE=EF=BA=98=EF=BB=A7=EF=BA=8E=EF=BB=A4=EF=BA=97 =EF=BA=8E=EF=BB=A0= =EF=BA=9B=EF=BA=8E=EF=BB=A0=EF=BA=9B=D8=8C =EF=BA=84=EF=BA=B3=EF=BA=AD, =EF= =BA=A9=EF=BB=AE=EF=BB=9F =EF=BA=A9=EF=BB=AE=EF=BB=9F. =EF=BA=84=EF=BB=A3= =EF=BA=8E=EF=BB=A3 =EF=BA=8D =EF=BA=8E=EF=BB=A7 =EF=BB=B2=EF=BB=9C=EF=BB=A7= \n" " =EF=BA=BA=EF=BB=94=EF=BA=A3=EF=BA=93 =EF=BA=96=EF=BB= =9C=EF=BA=98=EF=BB=B4=EF=BB=9B=EF=BA=8D=D9=8B =EF=BB=8A=EF=BB=9F, =EF=BA=8E= =EF=BB=A0=EF=BA=A0=EF=BB=A7=EF=BB=AD=EF=BA=A9 =EF=BB=AD=EF=BA=8E=EF=BB=A0= =EF=BB=8C=EF=BA=97=EF=BA=8D=EF=BA=A9 =EF=BA=B5= =EF=BA=AD\n"; - vshTable *table; + g_autoptr(vshTable) table =3D NULL; wchar_t wc; =20 /* If this char is not classed as printable, the actual @@ -183,7 +180,6 @@ testUnicodeArabic(const void *opaque G_GNUC_UNUSED) ret =3D -1; =20 cleanup: - vshTableFree(table); return ret; } =20 @@ -192,7 +188,7 @@ static int testUnicodeZeroWidthChar(const void *opaque G_GNUC_UNUSED) { int ret =3D 0; - vshTable *table =3D NULL; + g_autoptr(vshTable) table =3D NULL; const char *exp =3D " I\u200Bd Name \u200BStatus\n" "--------------------------\n" @@ -220,7 +216,6 @@ testUnicodeZeroWidthChar(const void *opaque G_GNUC_UNUS= ED) ret =3D -1; =20 cleanup: - vshTableFree(table); return ret; } =20 @@ -228,7 +223,7 @@ static int testUnicodeCombiningChar(const void *opaque G_GNUC_UNUSED) { int ret =3D 0; - vshTable *table =3D NULL; + g_autoptr(vshTable) table =3D NULL; const char *exp =3D " Id N=C3=A1me =E2=93=88tatus\n" "--------------------------\n" @@ -247,7 +242,6 @@ testUnicodeCombiningChar(const void *opaque G_GNUC_UNUS= ED) ret =3D -1; =20 cleanup: - vshTableFree(table); return ret; } =20 @@ -256,7 +250,7 @@ static int testUnicodeNonPrintableChar(const void *opaque G_GNUC_UNUSED) { int ret =3D 0; - vshTable *table =3D NULL; + g_autoptr(vshTable) table =3D NULL; const char *exp =3D " I\\x09d Name Status\n" "----------------------------------\n" @@ -275,7 +269,6 @@ testUnicodeNonPrintableChar(const void *opaque G_GNUC_U= NUSED) ret =3D -1; =20 cleanup: - vshTableFree(table); return ret; } =20 @@ -283,9 +276,9 @@ static int testNTables(const void *opaque G_GNUC_UNUSED) { int ret =3D 0; - vshTable *table1 =3D NULL; - vshTable *table2 =3D NULL; - vshTable *table3 =3D NULL; + g_autoptr(vshTable) table1 =3D NULL; + g_autoptr(vshTable) table2 =3D NULL; + g_autoptr(vshTable) table3 =3D NULL; const char *exp1 =3D " Id Name Status\n" "--------------------------\n" @@ -336,9 +329,6 @@ testNTables(const void *opaque G_GNUC_UNUSED) ret =3D -1; =20 cleanup: - vshTableFree(table1); - vshTableFree(table2); - vshTableFree(table3); return ret; } =20 --=20 2.31.1