Use K&R style for curly braces in src/test/test_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2014-03-18 09:17:30 +01:00
parent 58d467116b
commit a9ed417f3a

View File

@ -319,7 +319,8 @@ testBuildXMLConfig(void)
static virCapsPtr static virCapsPtr
testBuildCapabilities(virConnectPtr conn) { testBuildCapabilities(virConnectPtr conn)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
virCapsPtr caps; virCapsPtr caps;
virCapsGuestPtr guest; virCapsGuestPtr guest;
@ -504,7 +505,8 @@ testDomObjFromDomain(virDomainPtr domain)
} }
static char * static char *
testDomainGenerateIfname(virDomainDefPtr domdef) { testDomainGenerateIfname(virDomainDefPtr domdef)
{
int maxif = 1024; int maxif = 1024;
int ifctr; int ifctr;
size_t i; size_t i;
@ -851,7 +853,8 @@ error:
static char *testBuildFilename(const char *relativeTo, static char *testBuildFilename(const char *relativeTo,
const char *filename) { const char *filename)
{
char *offset; char *offset;
int baseLen; int baseLen;
char *ret; char *ret;
@ -2495,7 +2498,8 @@ static char *testDomainGetOSType(virDomainPtr dom ATTRIBUTE_UNUSED) {
return ret; return ret;
} }
static unsigned long long testDomainGetMaxMemory(virDomainPtr domain) { static unsigned long long testDomainGetMaxMemory(virDomainPtr domain)
{
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
unsigned long long ret = 0; unsigned long long ret = 0;
@ -2898,7 +2902,8 @@ cleanup:
return ret; return ret;
} }
static int testConnectNumOfDefinedDomains(virConnectPtr conn) { static int testConnectNumOfDefinedDomains(virConnectPtr conn)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int count; int count;
@ -2911,7 +2916,8 @@ static int testConnectNumOfDefinedDomains(virConnectPtr conn) {
static int testConnectListDefinedDomains(virConnectPtr conn, static int testConnectListDefinedDomains(virConnectPtr conn,
char **const names, char **const names,
int maxnames) { int maxnames)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int n; int n;
@ -2926,7 +2932,8 @@ static int testConnectListDefinedDomains(virConnectPtr conn,
} }
static virDomainPtr testDomainDefineXML(virConnectPtr conn, static virDomainPtr testDomainDefineXML(virConnectPtr conn,
const char *xml) { const char *xml)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
virDomainPtr ret = NULL; virDomainPtr ret = NULL;
virDomainDefPtr def; virDomainDefPtr def;
@ -3040,7 +3047,8 @@ cleanup:
static int testNodeGetCellsFreeMemory(virConnectPtr conn, static int testNodeGetCellsFreeMemory(virConnectPtr conn,
unsigned long long *freemems, unsigned long long *freemems,
int startCell, int maxCells) { int startCell, int maxCells)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int cell; int cell;
size_t i; size_t i;
@ -3066,7 +3074,8 @@ cleanup:
} }
static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) { static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
{
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virObjectEventPtr event = NULL; virObjectEventPtr event = NULL;
@ -3108,7 +3117,8 @@ cleanup:
return ret; return ret;
} }
static int testDomainCreate(virDomainPtr domain) { static int testDomainCreate(virDomainPtr domain)
{
return testDomainCreateWithFlags(domain, 0); return testDomainCreateWithFlags(domain, 0);
} }
@ -3475,7 +3485,8 @@ static virDrvOpenStatus testNetworkOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
} }
static int testNetworkClose(virConnectPtr conn) { static int testNetworkClose(virConnectPtr conn)
{
conn->networkPrivateData = NULL; conn->networkPrivateData = NULL;
return 0; return 0;
} }
@ -3530,7 +3541,8 @@ cleanup:
} }
static int testConnectNumOfNetworks(virConnectPtr conn) { static int testConnectNumOfNetworks(virConnectPtr conn)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int numActive = 0; int numActive = 0;
size_t i; size_t i;
@ -3574,7 +3586,8 @@ error:
return -1; return -1;
} }
static int testConnectNumOfDefinedNetworks(virConnectPtr conn) { static int testConnectNumOfDefinedNetworks(virConnectPtr conn)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int numInactive = 0; int numInactive = 0;
size_t i; size_t i;
@ -3678,7 +3691,8 @@ cleanup:
} }
static virNetworkPtr testNetworkCreateXML(virConnectPtr conn, const char *xml) { static virNetworkPtr testNetworkCreateXML(virConnectPtr conn, const char *xml)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
virNetworkDefPtr def; virNetworkDefPtr def;
virNetworkObjPtr net = NULL; virNetworkObjPtr net = NULL;
@ -3744,7 +3758,8 @@ cleanup:
return ret; return ret;
} }
static int testNetworkUndefine(virNetworkPtr network) { static int testNetworkUndefine(virNetworkPtr network)
{
testConnPtr privconn = network->conn->privateData; testConnPtr privconn = network->conn->privateData;
virNetworkObjPtr privnet; virNetworkObjPtr privnet;
int ret = -1; int ret = -1;
@ -3831,7 +3846,8 @@ cleanup:
return ret; return ret;
} }
static int testNetworkCreate(virNetworkPtr network) { static int testNetworkCreate(virNetworkPtr network)
{
testConnPtr privconn = network->conn->privateData; testConnPtr privconn = network->conn->privateData;
virNetworkObjPtr privnet; virNetworkObjPtr privnet;
int ret = -1; int ret = -1;
@ -3867,7 +3883,8 @@ cleanup:
return ret; return ret;
} }
static int testNetworkDestroy(virNetworkPtr network) { static int testNetworkDestroy(virNetworkPtr network)
{
testConnPtr privconn = network->conn->privateData; testConnPtr privconn = network->conn->privateData;
virNetworkObjPtr privnet; virNetworkObjPtr privnet;
int ret = -1; int ret = -1;
@ -3960,7 +3977,8 @@ cleanup:
} }
static int testNetworkGetAutostart(virNetworkPtr network, static int testNetworkGetAutostart(virNetworkPtr network,
int *autostart) { int *autostart)
{
testConnPtr privconn = network->conn->privateData; testConnPtr privconn = network->conn->privateData;
virNetworkObjPtr privnet; virNetworkObjPtr privnet;
int ret = -1; int ret = -1;
@ -3985,7 +4003,8 @@ cleanup:
} }
static int testNetworkSetAutostart(virNetworkPtr network, static int testNetworkSetAutostart(virNetworkPtr network,
int autostart) { int autostart)
{
testConnPtr privconn = network->conn->privateData; testConnPtr privconn = network->conn->privateData;
virNetworkObjPtr privnet; virNetworkObjPtr privnet;
int ret = -1; int ret = -1;
@ -4443,7 +4462,8 @@ cleanup:
*/ */
static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr pool) { static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr pool)
{
pool->def->capacity = defaultPoolCap; pool->def->capacity = defaultPoolCap;
pool->def->allocation = defaultPoolAlloc; pool->def->allocation = defaultPoolAlloc;
@ -4465,7 +4485,8 @@ static virDrvOpenStatus testStorageOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
} }
static int testStorageClose(virConnectPtr conn) { static int testStorageClose(virConnectPtr conn)
{
conn->storagePrivateData = NULL; conn->storagePrivateData = NULL;
return 0; return 0;
} }
@ -4473,7 +4494,8 @@ static int testStorageClose(virConnectPtr conn) {
static virStoragePoolPtr static virStoragePoolPtr
testStoragePoolLookupByUUID(virConnectPtr conn, testStoragePoolLookupByUUID(virConnectPtr conn,
const unsigned char *uuid) { const unsigned char *uuid)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
virStoragePoolObjPtr pool; virStoragePoolObjPtr pool;
virStoragePoolPtr ret = NULL; virStoragePoolPtr ret = NULL;
@ -4498,7 +4520,8 @@ cleanup:
static virStoragePoolPtr static virStoragePoolPtr
testStoragePoolLookupByName(virConnectPtr conn, testStoragePoolLookupByName(virConnectPtr conn,
const char *name) { const char *name)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
virStoragePoolObjPtr pool; virStoragePoolObjPtr pool;
virStoragePoolPtr ret = NULL; virStoragePoolPtr ret = NULL;
@ -4522,12 +4545,14 @@ cleanup:
} }
static virStoragePoolPtr static virStoragePoolPtr
testStoragePoolLookupByVolume(virStorageVolPtr vol) { testStoragePoolLookupByVolume(virStorageVolPtr vol)
{
return testStoragePoolLookupByName(vol->conn, vol->pool); return testStoragePoolLookupByName(vol->conn, vol->pool);
} }
static int static int
testConnectNumOfStoragePools(virConnectPtr conn) { testConnectNumOfStoragePools(virConnectPtr conn)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int numActive = 0; int numActive = 0;
size_t i; size_t i;
@ -4544,7 +4569,8 @@ testConnectNumOfStoragePools(virConnectPtr conn) {
static int static int
testConnectListStoragePools(virConnectPtr conn, testConnectListStoragePools(virConnectPtr conn,
char **const names, char **const names,
int nnames) { int nnames)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int n = 0; int n = 0;
size_t i; size_t i;
@ -4572,7 +4598,8 @@ error:
} }
static int static int
testConnectNumOfDefinedStoragePools(virConnectPtr conn) { testConnectNumOfDefinedStoragePools(virConnectPtr conn)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int numInactive = 0; int numInactive = 0;
size_t i; size_t i;
@ -4592,7 +4619,8 @@ testConnectNumOfDefinedStoragePools(virConnectPtr conn) {
static int static int
testConnectListDefinedStoragePools(virConnectPtr conn, testConnectListDefinedStoragePools(virConnectPtr conn,
char **const names, char **const names,
int nnames) { int nnames)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
int n = 0; int n = 0;
size_t i; size_t i;
@ -4858,7 +4886,8 @@ cleanup:
} }
static int static int
testStoragePoolUndefine(virStoragePoolPtr pool) { testStoragePoolUndefine(virStoragePoolPtr pool)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
int ret = -1; int ret = -1;
@ -4923,7 +4952,8 @@ cleanup:
static int static int
testStoragePoolDestroy(virStoragePoolPtr pool) { testStoragePoolDestroy(virStoragePoolPtr pool)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
int ret = -1; int ret = -1;
@ -5030,7 +5060,8 @@ cleanup:
static int static int
testStoragePoolGetInfo(virStoragePoolPtr pool, testStoragePoolGetInfo(virStoragePoolPtr pool,
virStoragePoolInfoPtr info) { virStoragePoolInfoPtr info)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
int ret = -1; int ret = -1;
@ -5091,7 +5122,8 @@ cleanup:
static int static int
testStoragePoolGetAutostart(virStoragePoolPtr pool, testStoragePoolGetAutostart(virStoragePoolPtr pool,
int *autostart) { int *autostart)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
int ret = -1; int ret = -1;
@ -5121,7 +5153,8 @@ cleanup:
static int static int
testStoragePoolSetAutostart(virStoragePoolPtr pool, testStoragePoolSetAutostart(virStoragePoolPtr pool,
int autostart) { int autostart)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
int ret = -1; int ret = -1;
@ -5154,7 +5187,8 @@ cleanup:
static int static int
testStoragePoolNumOfVolumes(virStoragePoolPtr pool) { testStoragePoolNumOfVolumes(virStoragePoolPtr pool)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
int ret = -1; int ret = -1;
@ -5186,7 +5220,8 @@ cleanup:
static int static int
testStoragePoolListVolumes(virStoragePoolPtr pool, testStoragePoolListVolumes(virStoragePoolPtr pool,
char **const names, char **const names,
int maxnames) { int maxnames)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
size_t i = 0; size_t i = 0;
@ -5232,7 +5267,8 @@ testStoragePoolListVolumes(virStoragePoolPtr pool,
static int static int
testStoragePoolListAllVolumes(virStoragePoolPtr obj, testStoragePoolListAllVolumes(virStoragePoolPtr obj,
virStorageVolPtr **vols, virStorageVolPtr **vols,
unsigned int flags) { unsigned int flags)
{
testConnPtr privconn = obj->conn->privateData; testConnPtr privconn = obj->conn->privateData;
virStoragePoolObjPtr pool; virStoragePoolObjPtr pool;
size_t i; size_t i;
@ -5298,7 +5334,8 @@ testStoragePoolListAllVolumes(virStoragePoolPtr obj,
static virStorageVolPtr static virStorageVolPtr
testStorageVolLookupByName(virStoragePoolPtr pool, testStorageVolLookupByName(virStoragePoolPtr pool,
const char *name ATTRIBUTE_UNUSED) { const char *name ATTRIBUTE_UNUSED)
{
testConnPtr privconn = pool->conn->privateData; testConnPtr privconn = pool->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
virStorageVolDefPtr privvol; virStorageVolDefPtr privvol;
@ -5342,7 +5379,8 @@ cleanup:
static virStorageVolPtr static virStorageVolPtr
testStorageVolLookupByKey(virConnectPtr conn, testStorageVolLookupByKey(virConnectPtr conn,
const char *key) { const char *key)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
size_t i; size_t i;
virStorageVolPtr ret = NULL; virStorageVolPtr ret = NULL;
@ -5377,7 +5415,8 @@ testStorageVolLookupByKey(virConnectPtr conn,
static virStorageVolPtr static virStorageVolPtr
testStorageVolLookupByPath(virConnectPtr conn, testStorageVolLookupByPath(virConnectPtr conn,
const char *path) { const char *path)
{
testConnPtr privconn = conn->privateData; testConnPtr privconn = conn->privateData;
size_t i; size_t i;
virStorageVolPtr ret = NULL; virStorageVolPtr ret = NULL;
@ -5627,7 +5666,8 @@ cleanup:
} }
static int testStorageVolumeTypeForPool(int pooltype) { static int testStorageVolumeTypeForPool(int pooltype)
{
switch (pooltype) { switch (pooltype) {
case VIR_STORAGE_POOL_DIR: case VIR_STORAGE_POOL_DIR:
@ -5641,7 +5681,8 @@ static int testStorageVolumeTypeForPool(int pooltype) {
static int static int
testStorageVolGetInfo(virStorageVolPtr vol, testStorageVolGetInfo(virStorageVolPtr vol,
virStorageVolInfoPtr info) { virStorageVolInfoPtr info)
{
testConnPtr privconn = vol->conn->privateData; testConnPtr privconn = vol->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
virStorageVolDefPtr privvol; virStorageVolDefPtr privvol;
@ -5729,7 +5770,8 @@ cleanup:
} }
static char * static char *
testStorageVolGetPath(virStorageVolPtr vol) { testStorageVolGetPath(virStorageVolPtr vol)
{
testConnPtr privconn = vol->conn->privateData; testConnPtr privconn = vol->conn->privateData;
virStoragePoolObjPtr privpool; virStoragePoolObjPtr privpool;
virStorageVolDefPtr privvol; virStorageVolDefPtr privvol;
@ -5783,7 +5825,8 @@ static virDrvOpenStatus testNodeDeviceOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
} }
static int testNodeDeviceClose(virConnectPtr conn) { static int testNodeDeviceClose(virConnectPtr conn)
{
conn->nodeDevicePrivateData = NULL; conn->nodeDevicePrivateData = NULL;
return 0; return 0;
} }
@ -6252,7 +6295,8 @@ static virDrvOpenStatus testSecretOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
} }
static int testSecretClose(virConnectPtr conn) { static int testSecretClose(virConnectPtr conn)
{
conn->secretPrivateData = NULL; conn->secretPrivateData = NULL;
return 0; return 0;
} }
@ -6271,7 +6315,8 @@ static virDrvOpenStatus testNWFilterOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
} }
static int testNWFilterClose(virConnectPtr conn) { static int testNWFilterClose(virConnectPtr conn)
{
conn->nwfilterPrivateData = NULL; conn->nwfilterPrivateData = NULL;
return 0; return 0;
} }