Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx> --- tests/commandhelper.c | 5 +++-- tests/qemuargv2xmltest.c | 3 ++- tests/shunloadhelper.c | 5 +++-- tests/testutils.c | 15 +++++++++----- tests/testutilslxc.c | 3 ++- tests/testutilsqemu.c | 3 ++- tests/testutilsxen.c | 3 ++- tests/virshtest.c | 54 ++++++++++++++++++++++++++++++++---------------- tests/virusbtest.c | 3 ++- tests/xencapstest.c | 33 +++++++++++++++++++---------- 10 files changed, 84 insertions(+), 43 deletions(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 296fbbb..32b8512 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -1,7 +1,7 @@ /* * commandhelper.c: Auxiliary program for commandtest * - * Copyright (C) 2010-2013 Red Hat, Inc. + * Copyright (C) 2010-2014 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,7 +37,8 @@ # define VIR_FROM_THIS VIR_FROM_NONE -static int envsort(const void *a, const void *b) { +static int envsort(const void *a, const void *b) +{ const char *const*astrptr = a; const char *const*bstrptr = b; const char *astr = *astrptr; diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 4923c2b..9eb3c49 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -36,7 +36,8 @@ static int blankProblemElements(char *data) static int testCompareXMLToArgvFiles(const char *xml, const char *cmdfile, - bool expect_warning) { + bool expect_warning) +{ char *expectxml = NULL; char *actualxml = NULL; char *cmd = NULL; diff --git a/tests/shunloadhelper.c b/tests/shunloadhelper.c index f2afbe8..128adce 100644 --- a/tests/shunloadhelper.c +++ b/tests/shunloadhelper.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Red Hat, Inc. + * Copyright (C) 2011, 2014 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,8 @@ static void shunloadError(void *userData ATTRIBUTE_UNUSED, int shunloadStart(void); -int shunloadStart(void) { +int shunloadStart(void) +{ virConnectPtr conn; virSetErrorFunc(NULL, shunloadError); diff --git a/tests/testutils.c b/tests/testutils.c index e21e2f4..179c72a 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -362,7 +362,8 @@ virtTestLoadFile(const char *file, char **buf) #ifndef WIN32 static void virtTestCaptureProgramExecChild(const char *const argv[], - int pipefd) { + int pipefd) +{ size_t i; int open_max; int stdinfd = -1; @@ -629,7 +630,8 @@ virtTestLogContentAndReset(void) static unsigned int -virTestGetFlag(const char *name) { +virTestGetFlag(const char *name) +{ char *flagStr; unsigned int flag; @@ -643,21 +645,24 @@ virTestGetFlag(const char *name) { } unsigned int -virTestGetDebug(void) { +virTestGetDebug(void) +{ if (testDebug == -1) testDebug = virTestGetFlag("VIR_TEST_DEBUG"); return testDebug; } unsigned int -virTestGetVerbose(void) { +virTestGetVerbose(void) +{ if (testVerbose == -1) testVerbose = virTestGetFlag("VIR_TEST_VERBOSE"); return testVerbose || virTestGetDebug(); } unsigned int -virTestGetExpensive(void) { +virTestGetExpensive(void) +{ if (testExpensive == -1) testExpensive = virTestGetFlag("VIR_TEST_EXPENSIVE"); return testExpensive; diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c index 1bc6feb..a1574d3 100644 --- a/tests/testutilslxc.c +++ b/tests/testutilslxc.c @@ -8,7 +8,8 @@ # include "domain_conf.h" -virCapsPtr testLXCCapsInit(void) { +virCapsPtr testLXCCapsInit(void) +{ virCapsPtr caps; virCapsGuestPtr guest; diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 726501c..f7810f6 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -203,7 +203,8 @@ error: return -1; } -virCapsPtr testQemuCapsInit(void) { +virCapsPtr testQemuCapsInit(void) +{ virCapsPtr caps; virCapsGuestPtr guest; virCapsGuestMachinePtr *machines = NULL; diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index 1b5ee79..f3216e9 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -7,7 +7,8 @@ #include "domain_conf.h" -virCapsPtr testXenCapsInit(void) { +virCapsPtr testXenCapsInit(void) +{ struct utsname utsname; virCapsPtr caps; virCapsGuestPtr guest; diff --git a/tests/virshtest.c b/tests/virshtest.c index 3da5fa4..f7edc02 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -42,7 +42,8 @@ static const char *domname_fc4 = "fc4\n\n"; static const char *domstate_fc4 = "running\n\n"; static int testFilterLine(char *buffer, - const char *toRemove) { + const char *toRemove) +{ char *start; char *end; @@ -93,7 +94,8 @@ static char *custom_uri; "--connect", \ custom_uri -static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED) { +static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_DEFAULT, "list", NULL }; const char *exp = "\ Id Name State\n\ @@ -103,7 +105,8 @@ static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED) { return testCompareOutputLit(exp, NULL, argv); } -static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) { +static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "list", NULL }; const char *exp = "\ Id Name State\n\ @@ -114,7 +117,8 @@ static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) { return testCompareOutputLit(exp, NULL, argv); } -static int testCompareNodeinfoDefault(const void *data ATTRIBUTE_UNUSED) { +static int testCompareNodeinfoDefault(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_DEFAULT, "nodeinfo", NULL }; const char *exp = "\ CPU model: i686\n\ @@ -129,7 +133,8 @@ Memory size: 3145728 KiB\n\ return testCompareOutputLit(exp, NULL, argv); } -static int testCompareNodeinfoCustom(const void *data ATTRIBUTE_UNUSED) { +static int testCompareNodeinfoCustom(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "nodeinfo", @@ -148,73 +153,85 @@ Memory size: 8192000 KiB\n\ return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDominfoByID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDominfoByID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "dominfo", "2", NULL }; const char *exp = dominfo_fc4; return testCompareOutputLit(exp, "\nCPU time:", argv); } -static int testCompareDominfoByUUID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDominfoByUUID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "dominfo", DOM_UUID, NULL }; const char *exp = dominfo_fc4; return testCompareOutputLit(exp, "\nCPU time:", argv); } -static int testCompareDominfoByName(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDominfoByName(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "dominfo", "fc4", NULL }; const char *exp = dominfo_fc4; return testCompareOutputLit(exp, "\nCPU time:", argv); } -static int testCompareDomuuidByID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomuuidByID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domuuid", "2", NULL }; const char *exp = domuuid_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomuuidByName(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomuuidByName(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domuuid", "fc4", NULL }; const char *exp = domuuid_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomidByName(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomidByName(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domid", "fc4", NULL }; const char *exp = domid_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomidByUUID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomidByUUID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domid", DOM_UUID, NULL }; const char *exp = domid_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomnameByID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomnameByID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domname", "2", NULL }; const char *exp = domname_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomnameByUUID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomnameByUUID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domname", DOM_UUID, NULL }; const char *exp = domname_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomstateByID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomstateByID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domstate", "2", NULL }; const char *exp = domstate_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomstateByUUID(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomstateByUUID(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domstate", DOM_UUID, NULL }; const char *exp = domstate_fc4; return testCompareOutputLit(exp, NULL, argv); } -static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) { +static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) +{ const char *const argv[] = { VIRSH_CUSTOM, "domstate", "fc4", NULL }; const char *exp = domstate_fc4; return testCompareOutputLit(exp, NULL, argv); @@ -225,7 +242,8 @@ struct testInfo { const char *result; }; -static int testCompareEcho(const void *data) { +static int testCompareEcho(const void *data) +{ const struct testInfo *info = data; return testCompareOutputLit(info->result, NULL, info->argv); } diff --git a/tests/virusbtest.c b/tests/virusbtest.c index bb849b5..b66c7d0 100644 --- a/tests/virusbtest.c +++ b/tests/virusbtest.c @@ -137,7 +137,8 @@ cleanup: static int testCheckNdevs(const char* occasion, size_t got, - size_t expected) { + size_t expected) +{ if (got != expected) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s: got %zu devices, expected %zu", diff --git a/tests/xencapstest.c b/tests/xencapstest.c index 74423a1..176850b 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -69,21 +69,24 @@ testCompareFiles(virArch hostmachine, const char *xml_rel, return ret; } -static int testXeni686(const void *data ATTRIBUTE_UNUSED) { +static int testXeni686(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_I686, "xencapsdata/xen-i686.xml", "xencapsdata/xen-i686.cpuinfo", "xencapsdata/xen-i686.caps"); } -static int testXeni686PAE(const void *data ATTRIBUTE_UNUSED) { +static int testXeni686PAE(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_I686, "xencapsdata/xen-i686-pae.xml", "xencapsdata/xen-i686-pae.cpuinfo", "xencapsdata/xen-i686-pae.caps"); } -static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) { +static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_I686, "xencapsdata/xen-i686-pae-hvm.xml", "xencapsdata/xen-i686-pae-hvm.cpuinfo", @@ -93,7 +96,8 @@ static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) { /* No PAE + HVM is non-sensical - all VMX capable CPUs have PAE */ /* -static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED) { +static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_I686, "xencapsdata/xen-i686-hvm.xml", "xencapsdata/xen-i686.cpuinfo", @@ -101,46 +105,53 @@ static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED) { } */ -static int testXenx86_64(const void *data ATTRIBUTE_UNUSED) { +static int testXenx86_64(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_X86_64, "xencapsdata/xen-x86_64.xml", "xencapsdata/xen-x86_64.cpuinfo", "xencapsdata/xen-x86_64.caps"); } -static int testXenx86_64HVM(const void *data ATTRIBUTE_UNUSED) { +static int testXenx86_64HVM(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_X86_64, "xencapsdata/xen-x86_64-hvm.xml", "xencapsdata/xen-x86_64-hvm.cpuinfo", "xencapsdata/xen-x86_64-hvm.caps"); } -static int testXenia64(const void *data ATTRIBUTE_UNUSED) { +static int testXenia64(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_ITANIUM, "xencapsdata/xen-ia64.xml", "xencapsdata/xen-ia64.cpuinfo", "xencapsdata/xen-ia64.caps"); } -static int testXenia64BE(const void *data ATTRIBUTE_UNUSED) { +static int testXenia64BE(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_ITANIUM, "xencapsdata/xen-ia64-be.xml", "xencapsdata/xen-ia64-be.cpuinfo", "xencapsdata/xen-ia64-be.caps"); } -static int testXenia64HVM(const void *data ATTRIBUTE_UNUSED) { +static int testXenia64HVM(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_ITANIUM, "xencapsdata/xen-ia64-hvm.xml", "xencapsdata/xen-ia64-hvm.cpuinfo", "xencapsdata/xen-ia64-hvm.caps"); } -static int testXenia64BEHVM(const void *data ATTRIBUTE_UNUSED) { +static int testXenia64BEHVM(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_ITANIUM, "xencapsdata/xen-ia64-be-hvm.xml", "xencapsdata/xen-ia64-be-hvm.cpuinfo", "xencapsdata/xen-ia64-be-hvm.caps"); } -static int testXenppc64(const void *data ATTRIBUTE_UNUSED) { +static int testXenppc64(const void *data ATTRIBUTE_UNUSED) +{ return testCompareFiles(VIR_ARCH_PPC64, "xencapsdata/xen-ppc64.xml", "xencapsdata/xen-ppc64.cpuinfo", -- 1.9.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list