From f0a57e9de6f361ea8ab357252dbd86d516a7cb83 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 10 Oct 2012 14:45:03 +0100 Subject: [PATCH] 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 --- tests/common/network.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/tests/common/network.c b/tests/common/network.c index 145ce95..5611003 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; } -- 1.9.4