From nobody Mon Feb 9 04:14:01 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 1536828999835921.9965679347606; Thu, 13 Sep 2018 01:56:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 290D62C9710; Thu, 13 Sep 2018 08:56:37 +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 E79A2308BDA1; Thu, 13 Sep 2018 08:56:36 +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 A198B4A464; Thu, 13 Sep 2018 08:56:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8D8tZM1002788 for ; Thu, 13 Sep 2018 04:55:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id E92F93091323; Thu, 13 Sep 2018 08:55:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DEDB3309132E for ; Thu, 13 Sep 2018 08:55:33 +0000 (UTC) Received: from m97134.mail.qiye.163.com (m97134.mail.qiye.163.com [220.181.97.134]) by mx1.redhat.com (Postfix) with ESMTP id 1233C310E999 for ; Thu, 13 Sep 2018 08:55:31 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp5 (Coremail) with SMTP id huCowACHxWL+JZpbTfvyAQ--.224S5; Thu, 13 Sep 2018 16:55:29 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Thu, 13 Sep 2018 16:55:21 +0800 Message-Id: <20180913085524.3520-4-shi_lei@massclouds.com> In-Reply-To: <20180913085524.3520-1-shi_lei@massclouds.com> References: <20180913085524.3520-1-shi_lei@massclouds.com> X-CM-TRANSID: huCowACHxWL+JZpbTfvyAQ--.224S5 X-Coremail-Antispam: 1Uf129KBjvJXoW3urW7try7Cw1DZFyDCFWfXwb_yoWkuw17pF Z8AF1vyrW8tr4rZr1DKr4kWa4Y9rySkFy2yw4jvw4Iv3Z8W34UWw4rWF1ruw13AFWUua4a va10qFykCF45XFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRQdbUUUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbiEQHAT1nxsGCobwAAsg 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.42]); Thu, 13 Sep 2018 08:55:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 13 Sep 2018 08:55:32 +0000 (UTC) for IP:'220.181.97.134' DOMAIN:'m97134.mail.qiye.163.com' HELO:'m97134.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.134 m97134.mail.qiye.163.com 220.181.97.134 m97134.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 3/6] tests: fix incorrect indentation in function body by checking first line 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 13 Sep 2018 08:56:37 +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 | 44 +++++++------- tests/virnettlshelpers.c | 18 +++--- tests/virshtest.c | 128 +++++++++++++++++++-------------------- tests/xml2sexprtest.c | 36 +++++------ 5 files changed, 114 insertions(+), 114 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..9ff4ab3 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) - goto fail; + if (virTestLoadFile(sexpr, &sexprData) < 0) + goto fail; =20 - if (!(def =3D xenParseSxprString(sexprData, - NULL, -1, caps, xmlopt))) - goto fail; + if (!(def =3D xenParseSxprString(sexprData, + NULL, -1, caps, xmlopt))) + goto fail; =20 - if (!virDomainDefCheckABIStability(def, def, xmlopt)) { - fprintf(stderr, "ABI stability check failed on %s", xml); - goto fail; - } + if (!virDomainDefCheckABIStability(def, def, xmlopt)) { + fprintf(stderr, "ABI stability check failed on %s", xml); + goto fail; + } =20 - if (!(gotxml =3D virDomainDefFormat(def, caps, 0))) - goto fail; + if (!(gotxml =3D virDomainDefFormat(def, caps, 0))) + goto fail; =20 - if (virTestCompareToFile(gotxml, xml) < 0) - goto fail; + 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/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..078c6bf 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; - - if (!(start =3D strstr(buffer, toRemove))) - return -1; - - if (!(end =3D strstr(start+1, "\n"))) { - *start =3D '\0'; - } else { - memmove(start, end, strlen(end)+1); - } - return 0; + char *start; + char *end; + + if (!(start =3D strstr(buffer, toRemove))) + return -1; + + if (!(end =3D strstr(start+1, "\n"))) { + *start =3D '\0'; + } else { + memmove(start, end, strlen(end)+1); + } + 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/xml2sexprtest.c b/tests/xml2sexprtest.c index 3e4d1d1..98092d8 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, - VIR_DOMAIN_DEF_PARSE_INACTIVE))) - goto fail; + if (!(def =3D virDomainDefParseFile(xml, caps, xmlopt, NULL, + VIR_DOMAIN_DEF_PARSE_INACTIVE))) + goto fail; =20 - if (!virDomainDefCheckABIStability(def, def, xmlopt)) { - fprintf(stderr, "ABI stability check failed on %s", xml); - goto fail; - } + if (!virDomainDefCheckABIStability(def, def, xmlopt)) { + fprintf(stderr, "ABI stability check failed on %s", xml); + goto fail; + } =20 - if (!(gotsexpr =3D xenFormatSxpr(NULL, def))) - goto fail; + if (!(gotsexpr =3D xenFormatSxpr(NULL, def))) + goto fail; =20 - if (virTestCompareToFile(gotsexpr, sexpr) < 0) - goto fail; + 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