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 committed 2014-03-18 11:29:44 +01:00
1 parent 123a881d97
commit cc9c62fef9
55 files changed
+91 -88

No files matched your search

+1 -1
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)
+1 -1
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)
+1 -1
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)
+2 -2
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)
+1 -1
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)
+1 -1
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)
+1 -1
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)
+1 -1
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)
+1 -1
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)
+1 -1
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)
+1 -1
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)
+1 -1
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")
+1 -1
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)
+1 -1
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)
+1 -1
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)
+2 -2
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)
+1 -1
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)
+1 -1
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)
+1 -1
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)
+1 -1
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)
+2 -2
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)
+1 -1
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)
+1 -1
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")
+2 -2
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)
+2 -2
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)
+1 -1
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")
+2 -2
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
+2 -2
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)
+1 -1
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;
}
+2 -2
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)
+2 -2
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)
+1 -1
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)
+2 -2
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)
+2 -2
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)
+2 -2
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")
+1 -1
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")
+1 -1
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)
+2 -3
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)
+2 -2
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")
+2 -2
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)
+2 -2
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)
+1 -1
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)
+2 -2
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)
+1 -1
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)