From: Simon Wilkinson Date: Wed, 10 Oct 2012 13:45:03 +0000 (+0100) Subject: tests: Reformat loopback tests X-Git-Tag: upstream/1.8.0_pre1^2~1933 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f0a57e9de6f361ea8ab357252dbd86d516a7cb83;p=packages%2Fo%2Fopenafs.git tests: Reformat loopback tests Reformat the loopback tests to match our house style - 4 spaces for first indent, a tab for the second, and so on, opening brace of a function on a newline, spaces around assignments, and so on. Change-Id: I54f168ca143e7ff46c9d82289331b8314849f848 Reviewed-on: http://gerrit.openafs.org/8229 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/tests/common/network.c b/tests/common/network.c index 145ce9583..5611003c8 100644 --- a/tests/common/network.c +++ b/tests/common/network.c @@ -9,32 +9,36 @@ #include #include "common.h" -/*! Check if the current machine's hostname resolves to the loopback +/*! + * Check if the current machine's hostname resolves to the loopback * network. */ int -afstest_IsLoopbackNetworkDefault(void) { - char hostname[MAXHOSTCHARS]; - afs_uint32 addr; - struct hostent *host; +afstest_IsLoopbackNetworkDefault(void) +{ + char hostname[MAXHOSTCHARS]; + afs_uint32 addr; + struct hostent *host; - gethostname(hostname, sizeof(hostname)); - host = gethostbyname(hostname); - memcpy(&addr, host->h_addr, sizeof(addr)); + gethostname(hostname, sizeof(hostname)); + host = gethostbyname(hostname); + memcpy(&addr, host->h_addr, sizeof(addr)); - return(rx_IsLoopbackAddr(ntohl(addr))); + return(rx_IsLoopbackAddr(ntohl(addr))); } -/*! Skips all TAP tests if the current machine's hostname resolves to the +/*! + * Skips all TAP tests if the current machine's hostname resolves to the * loopback network. */ int -afstest_SkipTestsIfLoopbackNetIsDefault(void) { - int retval=0; - retval=afstest_IsLoopbackNetworkDefault(); - if(retval==1) { - skip_all("Default IP address is on the loopback network!\n"); - } - - return retval; +afstest_SkipTestsIfLoopbackNetIsDefault(void) +{ + int retval; + + retval = afstest_IsLoopbackNetworkDefault(); + if (retval == 1) { + skip_all("Default IP address is on the loopback network!\n"); + } + return retval; }