From nobody Mon Feb 9 23:15:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536724775851266.6786587928891; Tue, 11 Sep 2018 20:59:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D1C655F74A; Wed, 12 Sep 2018 03:59:33 +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 9611660BE0; Wed, 12 Sep 2018 03:59:33 +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 4ED6F181A12E; Wed, 12 Sep 2018 03:59:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8C3waY4016718 for ; Tue, 11 Sep 2018 23:58:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8114F308BDB2; Wed, 12 Sep 2018 03:58:36 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 75827308BDAE for ; Wed, 12 Sep 2018 03:58:33 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id B326D3097043 for ; Wed, 12 Sep 2018 03:58:30 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowADn7X7ijphbsNeyAQ--.247S5; Wed, 12 Sep 2018 11:58:29 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Wed, 12 Sep 2018 11:58:22 +0800 Message-Id: <20180912035823.22834-4-shi_lei@massclouds.com> In-Reply-To: <20180912035823.22834-1-shi_lei@massclouds.com> References: <20180912035823.22834-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowADn7X7ijphbsNeyAQ--.247S5 X-Coremail-Antispam: 1Uf129KBjvAXoW3urW7Kw43Aw4DtF1fJw43Wrg_yoW8JF1xto WSqFy3K3WrGw18WFyUtw48KrZxXay5ua13A3WkJa4kCasFqrZ8Jr4kWrW7WFWDZF1fJrZx uas7G343Krs7Xrn3n29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3 AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRM_MaDUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbidQW-T1n5eYlpYAAAsZ X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 212 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 12 Sep 2018 03:58:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 12 Sep 2018 03:58:32 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] tests: fix incorrect indentation or empty for first line in function body 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 12 Sep 2018 03:59:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Shi Lei --- tests/qemuxml2argvmock.c | 2 +- tests/sexpr2xmltest.c | 30 +++++----- tests/virnetdevmock.c | 1 - tests/virnettlshelpers.c | 18 +++--- tests/virshtest.c | 118 +++++++++++++++++++-------------------- tests/vshtabletest.c | 3 - tests/xml2sexprtest.c | 24 ++++---- 7 files changed, 96 insertions(+), 100 deletions(-) diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 4b4a6f7..79152d9 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -66,7 +66,7 @@ virNumaIsAvailable(void) int virNumaGetMaxNode(void) { - return 7; + return 7; } =20 /* We shouldn't need to mock virNumaNodeIsAvailable() and *definitely* not diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index efe6411..4a1a1ed 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -21,37 +21,37 @@ static virDomainXMLOptionPtr xmlopt; static int testCompareFiles(const char *xml, const char *sexpr) { - char *sexprData =3D NULL; - char *gotxml =3D NULL; - int ret =3D -1; - virDomainDefPtr def =3D NULL; + char *sexprData =3D NULL; + char *gotxml =3D NULL; + int ret =3D -1; + virDomainDefPtr def =3D NULL; =20 - if (virTestLoadFile(sexpr, &sexprData) < 0) + if (virTestLoadFile(sexpr, &sexprData) < 0) goto fail; =20 - if (!(def =3D xenParseSxprString(sexprData, + if (!(def =3D xenParseSxprString(sexprData, NULL, -1, caps, xmlopt))) goto fail; =20 - if (!virDomainDefCheckABIStability(def, def, xmlopt)) { + if (!virDomainDefCheckABIStability(def, def, xmlopt)) { fprintf(stderr, "ABI stability check failed on %s", xml); goto fail; - } + } =20 - if (!(gotxml =3D virDomainDefFormat(def, caps, 0))) + if (!(gotxml =3D virDomainDefFormat(def, caps, 0))) goto fail; =20 - if (virTestCompareToFile(gotxml, xml) < 0) + if (virTestCompareToFile(gotxml, xml) < 0) goto fail; =20 - ret =3D 0; + ret =3D 0; =20 fail: - VIR_FREE(sexprData); - VIR_FREE(gotxml); - virDomainDefFree(def); + VIR_FREE(sexprData); + VIR_FREE(gotxml); + virDomainDefFree(def); =20 - return ret; + return ret; } =20 struct testInfo { diff --git a/tests/virnetdevmock.c b/tests/virnetdevmock.c index a9967b7..3eb5059 100644 --- a/tests/virnetdevmock.c +++ b/tests/virnetdevmock.c @@ -34,7 +34,6 @@ virNetDevSysfsFile(char **pf_sysfs_device_link, const char *ifname, const char *file) { - if (virAsprintfQuiet(pf_sysfs_device_link, "%s/%s/%s", NET_DEV_TEST_DATA_PREFIX, ifname, file) < 0) { fprintf(stderr, "Out of memory\n"); diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c index 5c94f89..8cb8c3e 100644 --- a/tests/virnettlshelpers.c +++ b/tests/virnettlshelpers.c @@ -126,19 +126,19 @@ static void testTLSDerEncode(ASN1_TYPE src, const char *src_name, gnutls_datum_t * res) { - int size; - char *data =3D NULL; + int size; + char *data =3D NULL; =20 - size =3D 0; - asn1_der_coding(src, src_name, NULL, &size, NULL); + size =3D 0; + asn1_der_coding(src, src_name, NULL, &size, NULL); =20 - if (VIR_ALLOC_N(data, size) < 0) - abort(); + if (VIR_ALLOC_N(data, size) < 0) + abort(); =20 - asn1_der_coding(src, src_name, data, &size, NULL); + asn1_der_coding(src, src_name, data, &size, NULL); =20 - res->data =3D (unsigned char *)data; - res->size =3D size; + res->data =3D (unsigned char *)data; + res->size =3D size; } =20 =20 diff --git a/tests/virshtest.c b/tests/virshtest.c index 10cd0d3..5e73ad9 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -44,18 +44,18 @@ static const char *domstate_fc4 =3D "running\n\n"; static int testFilterLine(char *buffer, const char *toRemove) { - char *start; - char *end; + char *start; + char *end; =20 - if (!(start =3D strstr(buffer, toRemove))) + if (!(start =3D strstr(buffer, toRemove))) return -1; =20 - if (!(end =3D strstr(start+1, "\n"))) { + if (!(end =3D strstr(start+1, "\n"))) { *start =3D '\0'; - } else { + } else { memmove(start, end, strlen(end)+1); - } - return 0; + } + return 0; } =20 static int @@ -96,31 +96,31 @@ static char *custom_uri; =20 static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_DEFAULT, "list", NULL }; - const char *exp =3D "\ + const char *const argv[] =3D { VIRSH_DEFAULT, "list", NULL }; + const char *exp =3D "\ Id Name State \n\ ----------------------\n\ 1 test running \n\ \n"; - return testCompareOutputLit(exp, NULL, argv); + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "list", NULL }; - const char *exp =3D "\ + const char *const argv[] =3D { VIRSH_CUSTOM, "list", NULL }; + const char *exp =3D "\ Id Name State \n\ ----------------------\n\ 1 fv0 running \n\ 2 fc4 running \n\ \n"; - return testCompareOutputLit(exp, NULL, argv); + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareNodeinfoDefault(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_DEFAULT, "nodeinfo", NULL }; - const char *exp =3D "\ + const char *const argv[] =3D { VIRSH_DEFAULT, "nodeinfo", NULL }; + const char *exp =3D "\ CPU model: i686\n\ CPU(s): 16\n\ CPU frequency: 1400 MHz\n\ @@ -130,17 +130,17 @@ Thread(s) per core: 2\n\ NUMA cell(s): 2\n\ Memory size: 3145728 KiB\n\ \n"; - return testCompareOutputLit(exp, NULL, argv); + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareNodeinfoCustom(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { - VIRSH_CUSTOM, - "nodeinfo", - NULL - }; - const char *exp =3D "\ + const char *const argv[] =3D { + VIRSH_CUSTOM, + "nodeinfo", + NULL + }; + const char *exp =3D "\ CPU model: i986\n\ CPU(s): 50\n\ CPU frequency: 6000 MHz\n\ @@ -150,91 +150,91 @@ Thread(s) per core: 2\n\ NUMA cell(s): 4\n\ Memory size: 8192000 KiB\n\ \n"; - return testCompareOutputLit(exp, NULL, argv); + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDominfoByID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", "2", NULL }; - const char *exp =3D dominfo_fc4; - return testCompareOutputLit(exp, "\nCPU time:", argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", "2", NULL }; + const char *exp =3D dominfo_fc4; + return testCompareOutputLit(exp, "\nCPU time:", argv); } =20 static int testCompareDominfoByUUID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", DOM_UUID, NULL }; - const char *exp =3D dominfo_fc4; - return testCompareOutputLit(exp, "\nCPU time:", argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", DOM_UUID, NULL= }; + const char *exp =3D dominfo_fc4; + return testCompareOutputLit(exp, "\nCPU time:", argv); } =20 static int testCompareDominfoByName(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", "fc4", NULL }; - const char *exp =3D dominfo_fc4; - return testCompareOutputLit(exp, "\nCPU time:", argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", "fc4", NULL }; + const char *exp =3D dominfo_fc4; + return testCompareOutputLit(exp, "\nCPU time:", argv); } =20 static int testCompareDomuuidByID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domuuid", "2", NULL }; - const char *exp =3D domuuid_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domuuid", "2", NULL }; + const char *exp =3D domuuid_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomuuidByName(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domuuid", "fc4", NULL }; - const char *exp =3D domuuid_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domuuid", "fc4", NULL }; + const char *exp =3D domuuid_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomidByName(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domid", "fc4", NULL }; - const char *exp =3D domid_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domid", "fc4", NULL }; + const char *exp =3D domid_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomidByUUID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domid", DOM_UUID, NULL }; - const char *exp =3D domid_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domid", DOM_UUID, NULL }; + const char *exp =3D domid_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomnameByID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domname", "2", NULL }; - const char *exp =3D domname_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domname", "2", NULL }; + const char *exp =3D domname_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomnameByUUID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domname", DOM_UUID, NULL }; - const char *exp =3D domname_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domname", DOM_UUID, NULL= }; + const char *exp =3D domname_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomstateByID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domstate", "2", NULL }; - const char *exp =3D domstate_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domstate", "2", NULL }; + const char *exp =3D domstate_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomstateByUUID(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domstate", DOM_UUID, NULL = }; - const char *exp =3D domstate_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domstate", DOM_UUID, NUL= L }; + const char *exp =3D domstate_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "domstate", "fc4", NULL }; - const char *exp =3D domstate_fc4; - return testCompareOutputLit(exp, NULL, argv); + const char *const argv[] =3D { VIRSH_CUSTOM, "domstate", "fc4", NULL }; + const char *exp =3D domstate_fc4; + return testCompareOutputLit(exp, NULL, argv); } =20 struct testInfo { diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index 1138e34..ce415e8 100644 --- a/tests/vshtabletest.c +++ b/tests/vshtabletest.c @@ -116,7 +116,6 @@ testVshTableRowAppend(const void *opaque ATTRIBUTE_UNUS= ED) static int testUnicode(const void *opaque ATTRIBUTE_UNUSED) { - int ret =3D 0; char *act =3D NULL; =20 @@ -149,7 +148,6 @@ testUnicode(const void *opaque ATTRIBUTE_UNUSED) static int testUnicodeArabic(const void *opaque ATTRIBUTE_UNUSED) { - int ret =3D 0; char *act =3D NULL; =20 @@ -193,7 +191,6 @@ testUnicodeArabic(const void *opaque ATTRIBUTE_UNUSED) static int testUnicodeZeroWidthChar(const void *opaque ATTRIBUTE_UNUSED) { - int ret =3D 0; vshTablePtr table =3D NULL; const char *exp =3D diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index 3e4d1d1..959a7ea 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -22,32 +22,32 @@ static virDomainXMLOptionPtr xmlopt; static int testCompareFiles(const char *xml, const char *sexpr) { - char *gotsexpr =3D NULL; - int ret =3D -1; - virDomainDefPtr def =3D NULL; + char *gotsexpr =3D NULL; + int ret =3D -1; + virDomainDefPtr def =3D NULL; =20 - if (!(def =3D virDomainDefParseFile(xml, caps, xmlopt, NULL, + if (!(def =3D virDomainDefParseFile(xml, caps, xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE))) goto fail; =20 - if (!virDomainDefCheckABIStability(def, def, xmlopt)) { + if (!virDomainDefCheckABIStability(def, def, xmlopt)) { fprintf(stderr, "ABI stability check failed on %s", xml); goto fail; - } + } =20 - if (!(gotsexpr =3D xenFormatSxpr(NULL, def))) + if (!(gotsexpr =3D xenFormatSxpr(NULL, def))) goto fail; =20 - if (virTestCompareToFile(gotsexpr, sexpr) < 0) + if (virTestCompareToFile(gotsexpr, sexpr) < 0) goto fail; =20 - ret =3D 0; + ret =3D 0; =20 fail: - VIR_FREE(gotsexpr); - virDomainDefFree(def); + VIR_FREE(gotsexpr); + virDomainDefFree(def); =20 - return ret; + return ret; } =20 struct testInfo { --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list