From nobody Mon Feb 2 07:31:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769611629; cv=none; d=zohomail.com; s=zohoarc; b=d6rUoa3aKSYoKjI5ftw2VfUiHdKDVsx6I7Ws26ejtjQ+aDaAuITz4Wif2r0pJNsuQmllPbl/wGlUKx+txStS6hXbMliBDEB3IuPJLmhZjtiuNoiWE75n/KMCpgWxTs/uTGkfrEXJJ27tIorOGLToTPc965rAX0jWB8N9AXkBq+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769611629; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=7b4xZU9+GavjGbPhFs2SSG9Ug0AfU4H5HntorwNOjO4=; b=Ms5Bqh1X93KVrX+CIwFQkHX7UKu5E7MQm/+p9Y2RMsyiJpMxCn+39SG06gO7j/fzbL1Ou7UmdxGLOFJHtJtPR5PxpRok03jFZWQTtV712ciZWZtGkVLUkUuC9flQMKE73q124XoplEPqguiNmgXhW/f4DloznuAEtALnP9ela6w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769611629749129.72232870987762; Wed, 28 Jan 2026 06:47:09 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id F168B41B7E; Wed, 28 Jan 2026 09:47:08 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 27A2944107; Wed, 28 Jan 2026 09:33:07 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 3B39E418AB; Wed, 28 Jan 2026 09:33:01 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8A12841C9D for ; Wed, 28 Jan 2026 09:31:02 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-139-B5KZswn_Mf-lHnqwXO8FqQ-1; Wed, 28 Jan 2026 09:31:00 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E03151800447 for ; Wed, 28 Jan 2026 14:30:59 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 49CED1956095 for ; Wed, 28 Jan 2026 14:30:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769610662; h=from:from: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; bh=7b4xZU9+GavjGbPhFs2SSG9Ug0AfU4H5HntorwNOjO4=; b=DFO8OFfToD9rralVvGVbos7RFp7SeoXSwYsHXxuPwSVNqJH0DMZnmMjhbaCrSJzbipSZ4Z nRPCrmIzeuMaOO82TfoOb5fb34xNFmpTFR1ONErvp/df2/INDg4Z1mUePjrEOTMVs+qJRD TBNSKxTmOOrfZKRvt3xWhQ/TkO45700= X-MC-Unique: B5KZswn_Mf-lHnqwXO8FqQ-1 X-Mimecast-MFC-AGG-ID: B5KZswn_Mf-lHnqwXO8FqQ_1769610660 To: devel@lists.libvirt.org Subject: [PATCH 13/20] networkxml2xmltest: Introduce testRun() Date: Wed, 28 Jan 2026 15:30:34 +0100 Message-ID: <75147384389ac04be092b611ee8481d088b6bc30.1769610369.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: KOPlJ73f5l7WQg0-JAqqlRKxnuJSNLYdhE4XtIXY3Cc_1769610660 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SIGRUZ2VYI2JHBPG6RASUNVJJBJPKZIQ X-Message-ID-Hash: SIGRUZ2VYI2JHBPG6RASUNVJJBJPKZIQ X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769611631748158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik This is a beginning of something bigger. The idea is that one DO_TEST_FULL() macro (and its friends) will run multiple test cases (just like qemuxmlconftest does). But in order to do that in a readable fashion, the macro should merely just expand to a function call. The function will then call virTestRunLog(), multiple times possibly. This is the first step in that direction. Signed-off-by: Michal Privoznik --- tests/networkxml2xmltest.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 325a43c385..552364818d 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -103,6 +103,19 @@ testCompareXMLToXMLHelper(const void *data) return result; } =20 +static void +testRun(const char *name, + int *ret, + virNetworkXMLOption *xmlopt, + testCompareNetXML2XMLResult expectResult, + unsigned int flags) +{ + g_autofree char *name_xml2xml =3D g_strdup_printf("Network XML-2-XML %= s", name); + struct testInfo info =3D { .name =3D name, .flags =3D flags, .expectRe= sult =3D expectResult, .xmlopt =3D xmlopt }; + + virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLHelper, &info); +} + static int mymain(void) { @@ -113,12 +126,7 @@ mymain(void) return -1; =20 #define DO_TEST_FULL(name, flags, expectResult) \ - do { \ - const struct testInfo info =3D {name, flags, expectResult, xmlopt}= ; \ - if (virTestRun("Network XML-2-XML " name, \ - testCompareXMLToXMLHelper, &info) < 0) \ - ret =3D -1; \ - } while (0) + testRun(name, &ret, xmlopt, expectResult, flags) #define DO_TEST(name) \ DO_TEST_FULL(name, 0, TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) #define DO_TEST_FLAGS(name, flags) \ --=20 2.52.0