Require spaces around equality comparisons

Commit a1cbe4b5 added a check for spaces around assignments and this
patch extends it to checks for spaces around '=='.  One exception is
virAssertCmpInt where comma after '==' is acceptable (since it is a
macro and '==' is its argument).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2014-03-17 10:38:38 +01:00
parent 123a881d97
commit cc9c62fef9
55 changed files with 91 additions and 88 deletions

View File

@ -145,9 +145,12 @@ foreach my $file (@ARGV) {
last;
}
# Require spaces around assignment '=' and compounds
while ($data =~ /[^!<>&|\-+*\/%\^'= ]=[^=]/ ||
$data =~ /[^!<>&|\-+*\/%\^'=]=[^= \\\n]/) {
# Require spaces around assignment '=', compounds and '=='
# with the exception of virAssertCmpInt()
while ($data =~ /[^!<>&|\-+*\/%\^'= ]=\+[^=]/ ||
$data =~ /[^!<>&|\-+*\/%\^'=]=[^= \\\n]/ ||
$data =~ /[\S]==/ ||
($data =~ /==[^\s,]/ && $data !~ /[\s]virAssertCmpInt\(/)) {
print "$file:$.: $line";
$ret = 1;
last;

View File

@ -9209,7 +9209,7 @@ error:
* Not all hypervisors will support sending signals to
* arbitrary processes or process groups. If this API is
* implemented the minimum requirement is to be able to
* use @pid_value==1 (i.e. kill init). No other value is
* use @pid_value == 1 (i.e. kill init). No other value is
* required to be supported.
*
* If the @signum is VIR_DOMAIN_PROCESS_SIGNAL_NOP then this

View File

@ -1,7 +1,7 @@
/*
* lock_driver_sanlock.c: A lock driver for Sanlock
*
* 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
@ -912,7 +912,7 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
/* We only initialize 'sock' if we are in the real
* child process and we need it to be inherited
*
* If sock==-1, then sanlock auto-open/closes a
* If sock == -1, then sanlock auto-open/closes a
* temporary sock
*/
if (priv->vm_pid == getpid()) {

View File

@ -649,7 +649,7 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
switch (disk->bus) {
case VIR_DOMAIN_DISK_BUS_IDE:
if (disk->device== VIR_DOMAIN_DISK_DEVICE_DISK)
if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
ret = virAsprintf(&dev_name, "ide%d-hd%d", busid, devid);
else
ret = virAsprintf(&dev_name, "ide%d-cd%d", busid, devid);
@ -2479,7 +2479,7 @@ qemuValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
_("Primary video card must have PCI address 0:0:2.0"));
goto cleanup;
}
/* If TYPE==PCI, then qemuCollectPCIAddress() function
/* If TYPE == PCI, then qemuCollectPCIAddress() function
* has already reserved the address, so we must skip */
}
} else if (addrs->nbuses && !qemuDeviceVideoUsable) {
@ -2649,7 +2649,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
_("Primary video card must have PCI address 0:0:1.0"));
goto cleanup;
}
/* If TYPE==PCI, then qemuCollectPCIAddress() function
/* If TYPE == PCI, then qemuCollectPCIAddress() function
* has already reserved the address, so we must skip */
}
} else if (addrs->nbuses && !qemuDeviceVideoUsable) {

View File

@ -1,7 +1,7 @@
/*
* virnetclient.c: generic network RPC client
*
* Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006-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
@ -1438,7 +1438,7 @@ virNetClientIOEventLoopPassTheBuck(virNetClientPtr client,
* to someone else.
*
* Returns 1 if the call was queued and will be completed later (only
* for nonBlock==true), 0 if the call was completed and -1 on error.
* for nonBlock == true), 0 if the call was completed and -1 on error.
*/
static int virNetClientIOEventLoop(virNetClientPtr client,
virNetClientCallPtr thiscall)
@ -1688,7 +1688,7 @@ static void virNetClientIOUpdateCallback(virNetClientPtr client,
* NB(7) Don't Panic!
*
* Returns 1 if the call was queued and will be completed later (only
* for nonBlock==true), 0 if the call was completed and -1 on error.
* for nonBlock == true), 0 if the call was completed and -1 on error.
*/
static int virNetClientIO(virNetClientPtr client,
virNetClientCallPtr thiscall)
@ -1926,7 +1926,7 @@ virNetClientQueueNonBlocking(virNetClientPtr client,
/*
* Returns 1 if the call was queued and will be completed later (only
* for nonBlock==true), 0 if the call was completed and -1 on error.
* for nonBlock == true), 0 if the call was completed and -1 on error.
*/
static int virNetClientSendInternal(virNetClientPtr client,
virNetMessagePtr msg,
@ -2019,7 +2019,7 @@ int virNetClientSendNoReply(virNetClientPtr client,
* this method returns 1.
*
* Returns 1 if the message was queued and will be completed later (only
* for nonBlock==true), 0 if the message was completed and -1 on error.
* for nonBlock == true), 0 if the message was completed and -1 on error.
*/
int virNetClientSendNonBlock(virNetClientPtr client,
virNetMessagePtr msg)

View File

@ -415,9 +415,9 @@ virCgroupCopyPlacement(virCgroupPtr group,
return -1;
} else {
/*
* parent=="/" + path="" => "/"
* parent=="/libvirt.service" + path=="" => "/libvirt.service"
* parent=="/libvirt.service" + path=="foo" => "/libvirt.service/foo"
* parent == "/" + path="" => "/"
* parent == "/libvirt.service" + path == "" => "/libvirt.service"
* parent == "/libvirt.service" + path == "foo" => "/libvirt.service/foo"
*/
if (virAsprintf(&group->controllers[i].placement,
"%s%s%s",
@ -516,9 +516,9 @@ virCgroupDetectPlacement(virCgroupPtr group,
}
/*
* selfpath=="/" + path="" -> "/"
* selfpath=="/libvirt.service" + path="" -> "/libvirt.service"
* selfpath=="/libvirt.service" + path="foo" -> "/libvirt.service/foo"
* selfpath == "/" + path="" -> "/"
* selfpath == "/libvirt.service" + path == "" -> "/libvirt.service"
* selfpath == "/libvirt.service" + path == "foo" -> "/libvirt.service/foo"
*/
if (typelen == len && STREQLEN(typestr, tmp, len) &&
group->controllers[i].mountPoint != NULL &&

View File

@ -1,6 +1,7 @@
/*
* virthreadpool.c: a generic thread pool implementation
*
* Copyright (C) 2014 Red Hat, Inc.
* Copyright (C) 2010 Hu Tao
* Copyright (C) 2010 Daniel P. Berrange
*
@ -151,7 +152,7 @@ out:
pool->nPrioWorkers--;
else
pool->nWorkers--;
if (pool->nWorkers == 0 && pool->nPrioWorkers==0)
if (pool->nWorkers == 0 && pool->nPrioWorkers == 0)
virCondSignal(&pool->quit_cond);
virMutexUnlock(&pool->mutex);
}

View File

@ -1259,7 +1259,7 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id) {
nsresult rc;
/* Internal vbox IDs start from 0, the public libvirt ID
* starts from 1, so refuse id==0, and adjust the rest*/
* starts from 1, so refuse id == 0, and adjust the rest*/
if (id == 0) {
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching id %d"), id);

View File

@ -1,6 +1,6 @@
/*
* xenapi_driver.c: Xen API driver.
* Copyright (C) 2011-2013 Red Hat, Inc.
* Copyright (C) 2011-2014 Red Hat, Inc.
* Copyright (C) 2009, 2010 Citrix Ltd.
*
* This library is free software; you can redistribute it and/or
@ -1850,7 +1850,7 @@ xenapiDomainSetAutostart(virDomainPtr dom, int autostart)
}
vm = vms->contents[0];
xen_vm_remove_from_other_config(session, vm, (char *)"auto_poweron");
if (autostart==1)
if (autostart == 1)
value = (char *)"true";
else
value = (char *)"false";

View File

@ -1188,7 +1188,7 @@ cleanup:
virMutexDestroy(&test->lock);
VIR_FREE(test);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -233,7 +233,7 @@ cleanup:
virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -94,7 +94,7 @@ mymain(void)
DO_TEST("ipv6-static-multi");
DO_TEST("ipv6-static");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012-2013 Red Hat, Inc.
* Copyright (C) 2012-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
@ -231,7 +231,7 @@ cleanup:
VIR_FREE(filename);
VIR_FREE(filedata);
VIR_FREE(params);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -148,7 +148,7 @@ mymain(void)
virObjectUnref(caps);
virObjectUnref(xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -150,7 +150,7 @@ mymain(void)
DO_TEST("dhcp6-nat-network", dhcpv6);
DO_TEST("dhcp6host-routed-network", dhcpv6);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -120,7 +120,7 @@ mymain(void)
DO_TEST("hostdev");
DO_TEST_FULL("hostdev-pf", VIR_NETWORK_XML_INACTIVE);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -89,7 +89,7 @@ mymain(void)
DO_TEST("usb_device_1d6b_1_0000_00_1d_0_if0");
DO_TEST("usb_device_1d6b_1_0000_00_1d_0");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -265,7 +265,7 @@ mymain(void)
DO_TEST_CPU_STATS("24cpu", 24);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -160,7 +160,7 @@ mymain(void)
DO_TEST("ipset-test", false);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -271,7 +271,7 @@ mymain(void)
virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1359,7 +1359,7 @@ mymain(void)
virObjectUnref(driver.xmlopt);
VIR_FREE(map);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/qemuxml2argvmock.so")

View File

@ -337,7 +337,7 @@ mymain(void)
virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -268,7 +268,7 @@ mymain(void)
virObjectUnref(driver.xmlopt);
VIR_FREE(map);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -194,7 +194,7 @@ mymain(void)
virObjectUnref(caps);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,7 +1,7 @@
/*
* sockettest.c: Testing for src/util/network.c APIs
*
* Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright (C) 2010-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
@ -336,7 +336,7 @@ mymain(void)
DO_TEST_IS_NUMERIC("::ffff", true);
DO_TEST_IS_NUMERIC("examplehost", false);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -205,7 +205,7 @@ mymain(void)
DO_TEST("/dev/xvda1", 51713);
DO_TEST("/dev/xvda15", 51727);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -105,7 +105,7 @@ mymain(void)
DO_TEST("pool-gluster");
DO_TEST("pool-gluster-sub");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -297,7 +297,7 @@ mymain(void)
"pool-dir", "vol-qcow2-nobacking",
"logical-from-qcow2", 0, FMT_COMPAT);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -123,7 +123,7 @@ mymain(void)
DO_TEST("pool-sheepdog", "vol-sheepdog");
DO_TEST("pool-gluster", "vol-gluster-dir");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Red Hat, Inc.
* Copyright (C) 2012, 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
@ -133,7 +133,7 @@ mymain(void)
virAuthConfigFree(config);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -219,7 +219,7 @@ mymain(void)
DO_TEST("Auto-indentation", testBufAutoIndent, 0);
DO_TEST("Trim", testBufTrim, 0);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -820,7 +820,7 @@ mymain(void)
VIR_FREE(fakesysfsdir);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/vircgroupmock.so")

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2013, 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
@ -387,7 +387,7 @@ mymain(void)
ret = -1;
if (virtTestRun("Test message dict ", testMessageDict, NULL) < 0)
ret = -1;
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Red Hat, Inc.
* Copyright (C) 2012, 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
@ -102,7 +102,7 @@ mymain(void)
TEST("libxl", NULL);
#endif
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -457,7 +457,7 @@ mymain(void)
VIR_FREE(fakesysfsdir);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virpcimock.so")

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2013, 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
@ -238,7 +238,7 @@ mymain(void)
if (virtTestRun("System identity (fake SELinux disabled) ", testIdentityGetSystem, NULL) < 0)
ret = -1;
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
#if WITH_SELINUX

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011, 2012 Red Hat, Inc.
* Copyright (C) 2011, 2012, 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
@ -116,7 +116,7 @@ mymain(void)
if (virtTestRun("Test parse", testParse, NULL) < 0)
ret = -1;
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -170,7 +170,7 @@ mymain(void)
DO_TEST("unload", testKModUnload, false, RMMOD " vfio-pci\n");
DO_TEST("blklist", testKModLoad, true, MODPROBE " -b vfio-pci\n");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011, 2013 Red Hat, Inc.
* Copyright (C) 2011, 2013, 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
@ -366,7 +366,7 @@ mymain(void)
if (virtTestRun("Lockspace res full path", testLockSpaceResourceLockPath, NULL) < 0)
ret = -1;
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -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
@ -542,7 +542,7 @@ mymain(void)
if (virtTestRun("Message Payload Stream Encode", testMessagePayloadStreamEncode, NULL) < 0)
ret = -1;
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -610,7 +610,7 @@ mymain(void)
#endif
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2013 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
@ -625,7 +625,7 @@ mymain(void)
testTLSCleanup(KEYFILE);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2012 Red Hat, Inc.
* Copyright (C) 2011-2012, 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
@ -478,7 +478,7 @@ mymain(void)
testTLSCleanup(KEYFILE);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2013, 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
@ -449,7 +449,7 @@ mymain(void)
VIR_FREE(fakesysfsdir);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virpcimock.so")

View File

@ -261,7 +261,7 @@ mymain(void)
if (virtTestRun("Test IPv4-only alloc reuse", testAllocReuse, NULL) < 0)
ret = -1;
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/libvirportallocatormock.so")

View File

@ -398,7 +398,7 @@ mymain(void)
# undef DO_TEST
VIR_FREE(custom_uri);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012-2013 Red Hat, Inc.
* Copyright (C) 2012-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
@ -425,7 +425,6 @@ mymain(void)
if (virtTestRun("virStringSortCompare", testStringSortCompare, NULL) < 0)
ret = -1;
#define TEST_SEARCH(s, r, x, n, m, e) \
do { \
struct stringSearchData data = { \
@ -492,7 +491,7 @@ mymain(void)
TEST_REPLACE("fooooofoooo", "foo", "barwizzeek", "barwizzeekooobarwizzeekoo");
TEST_REPLACE("fooooofoooo", "foooo", "foo", "fooofoo");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2013, 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
@ -273,7 +273,7 @@ mymain(void)
TEST_SCOPE("demo", "/machine/eng-dept/testing!stuff",
"machine-eng\\x2ddept-testing\\x21stuff-lxc\\x2ddemo.scope");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virsystemdmock.so")

View File

@ -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
@ -117,7 +117,7 @@ mymain(void)
TEST_FIELDS(2147483648000ull, 2038, 1, 19, 3, 14, 8);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Red Hat, Inc.
* Copyright (C) 2012, 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
@ -220,7 +220,7 @@ mymain(void)
#endif
TEST_PARAMS("=bogus&foo=one", "foo=one", params6);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -214,7 +214,7 @@ mymain(void)
ret = -1;
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1,7 +1,7 @@
/*
* xmconfigtest.c: Test backend for xm_internal config file handling
*
* Copyright (C) 2007, 2010-2011 Red Hat, Inc.
* Copyright (C) 2007, 2010-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
@ -261,7 +261,7 @@ mymain(void)
virObjectUnref(caps);
virObjectUnref(xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -185,7 +185,7 @@ mymain(void)
virObjectUnref(caps);
virObjectUnref(xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIRT_TEST_MAIN(mymain)

View File

@ -1203,7 +1203,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
vshPrint(ctl, "%-15s %d\n", _("Id:"), id);
vshPrint(ctl, "%-15s %s\n", _("Name:"), virDomainGetName(dom));
if (virDomainGetUUIDString(dom, &uuid[0])==0)
if (virDomainGetUUIDString(dom, &uuid[0]) == 0)
vshPrint(ctl, "%-15s %s\n", _("UUID:"), uuid);
if ((str = virDomainGetOSType(dom))) {

View File

@ -1504,7 +1504,7 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
vshPrint(ctl, "%-15s %s\n", _("Name:"), virStoragePoolGetName(pool));
if (virStoragePoolGetUUIDString(pool, &uuid[0])==0)
if (virStoragePoolGetUUIDString(pool, &uuid[0]) == 0)
vshPrint(ctl, "%-15s %s\n", _("UUID:"), uuid);
if (virStoragePoolGetInfo(pool, &info) == 0) {