#include <unistd.h>
#endif
-Trie::Trie(TrieCharTransform *aTransform) : head(0) , transform(aTransform)
+Trie::Trie(TrieCharTransform *aTransform) : head(0), transform(aTransform)
{}
Trie::~Trie()
return 1;
}
- if (aTrie.findPrefix("User-AgentFoo" , 13) != (void *)1) {
+ if (aTrie.findPrefix("User-AgentFoo", 13) != (void *)1) {
std::cerr << "Could not find User prefix" << std::endl;
return 1;
}
- if (aTrie.findPrefix("user-agentFoo" , 13) == (void *)1) {
+ if (aTrie.findPrefix("user-agentFoo", 13) == (void *)1) {
std::cerr << "found user prefix" << std::endl;
return 1;
}
return 1;
}
- if (aTrie.findPrefix("User-AgentFoo" , 13) != (void *)1) {
+ if (aTrie.findPrefix("User-AgentFoo", 13) != (void *)1) {
std::cerr << "Could not find User prefix" << std::endl;
return 1;
}
- if (aTrie.findPrefix("user-agentFoo" , 13) != (void *)1) {
+ if (aTrie.findPrefix("user-agentFoo", 13) != (void *)1) {
std::cerr << "Could not find user prefix" << std::endl;
return 1;
}
debug("ntlm_unpack_auth: Domain '%s' (len=%d).\n", domain, rv.l);
}
if (rv.l >= size) {
- debug("ntlm_unpack_auth: Domain length %d too big for %d byte packet.\n", rv.l , size);
+ debug("ntlm_unpack_auth: Domain length %d too big for %d byte packet.\n", rv.l, size);
return NTLM_ERR_BLOB;
}
{"ERRbadcmd",22,"Unknown command."},
{"ERRdata",23,"Data error (CRC)."},
{"ERRbadreq",24,"Bad request structure length."},
- {"ERRseek",25 ,"Seek error."},
+ {"ERRseek",25,"Seek error."},
{"ERRbadmedia",26,"Unknown media type."},
{"ERRbadsector",27,"Sector not found."},
{"ERRnopaper",28,"Printer out of paper."},
RegisterMaker("dst_as", [](TypeName name)->ACL* { return new ACLStrategised<Ip::Address>(new ACLASN, new ACLDestinationASNStrategy, name); });
RegisterMaker("browser", [](TypeName name)->ACL* { return new ACLStrategised<char const *>(new ACLRegexData, new ACLRequestHeaderStrategy<Http::HdrType::USER_AGENT>, name); });
RegisterMaker("dstdomain", [](TypeName name)->ACL* { return new ACLStrategised<char const *>(new ACLDomainData, new ACLDestinationDomainStrategy, name); });
- RegisterMaker("dstdom_regex", [](TypeName name)->ACL* { return new ACLStrategised<char const *>(new ACLRegexData, new ACLDestinationDomainStrategy , name); });
+ RegisterMaker("dstdom_regex", [](TypeName name)->ACL* { return new ACLStrategised<char const *>(new ACLRegexData, new ACLDestinationDomainStrategy, name); });
RegisterMaker("dst", [](TypeName)->ACL* { return new ACLDestinationIP; }); // XXX: Add name parameter to ctor
RegisterMaker("hier_code", [](TypeName name)->ACL* { return new ACLStrategised<hier_code>(new ACLHierCodeData, new ACLHierCodeStrategy, name); });
RegisterMaker("rep_header", [](TypeName name)->ACL* { return new ACLStrategised<HttpHeader*>(new ACLHTTPHeaderData, new ACLHTTPRepHeaderStrategy, name); });
#if _SQUID_WINDOWS_
fd = aio_open(path.termedBuf(), flags);
#else
- fd = file_open(path.termedBuf() , flags);
+ fd = file_open(path.termedBuf(), flags);
#endif
ioRequestor = callback;
BlockingFile::open(int flags, mode_t, RefCount<IORequestor> callback)
{
/* Simulate async calls */
- fd = file_open(path_ , flags);
+ fd = file_open(path_, flags);
ioRequestor = callback;
if (fd < 0) {
return new DiskdFile (path, this);
}
-DiskdIOStrategy::DiskdIOStrategy() : magic1(64), magic2(72), away(0) , smsgid(-1), rmsgid(-1), wfd(-1) , instanceID(newInstance())
+DiskdIOStrategy::DiskdIOStrategy() : magic1(64), magic2(72), away(0), smsgid(-1), rmsgid(-1), wfd(-1), instanceID(newInstance())
{}
bool
assert(fd < 0);
/* Simulate async calls */
- fd = file_open(path_ , flags);
+ fd = file_open(path_, flags);
ioRequestor = callback;
if (fd < 0) {
C const *theInstance;
};
-template <class InputIterator , class Visitor>
+template <class InputIterator, class Visitor>
Visitor& for_each(InputIterator from, InputIterator to, Visitor& visitor)
{
while (!(from == to)) {
if (isSet(flag) && flag != HttpHdrCcType::CC_OTHER) {
/* print option name for all options */
- p->appendf((pcount ? ", %s": "%s") , CcAttrs[flag].name);
+ p->appendf((pcount ? ", %s": "%s"), CcAttrs[flag].name);
/* for all options having values, "=value" after the name */
switch (flag) {
/* ========================================================================= */
-LeakFinderPtr::LeakFinderPtr(void *p , const char *f, const int l) :
+LeakFinderPtr::LeakFinderPtr(void *p, const char *f, const int l) :
file(f),
line(l),
when(squid_curtime)
void
SBufStatsAction::RegisterWithCacheManager()
{
- Mgr::RegisterAction("sbuf", "String-Buffer statistics", &SBufStatsAction::Create, 0 , 1);
+ Mgr::RegisterAction("sbuf", "String-Buffer statistics", &SBufStatsAction::Create, 0, 1);
}
int errors;
ByteCounter kbytes_in;
ByteCounter kbytes_out;
- } all , http, ftp, other;
+ } all, http, ftp, other;
} server;
struct {
ACLRandom::ACLRandom(char const *theClass) : data(0.0), class_(theClass)
{
- memset(pattern, 0 , sizeof(pattern));
+ memset(pattern, 0, sizeof(pattern));
}
ACLRandom::ACLRandom(ACLRandom const & old) : data(old.data), class_(old.class_)
} else if (configurationLineWord == plus_i) {
flags &= ~REG_ICASE;
} else {
- if (!compileRE(curlist, configurationLineWord.c_str() , flags))
+ if (!compileRE(curlist, configurationLineWord.c_str(), flags))
debugs(28, DBG_CRITICAL, "ERROR: Skipping regular expression. "
"Compile failed: '" << configurationLineWord << "'");
}
#define error(X...) \
fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
fprintf(stderr,X); \
-
+
#define warn(X...) \
fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
fprintf(stderr,X); \
-
+
#else /* __GNUC__ */
/* non-GCC compilers can't do the above macro define yet. */
#endif
if (code) {
- k5_error("Error while initialising credentials from keytab" ,code);
+ k5_error("Error while initialising credentials from keytab",code);
safe_free(principal_name);
if (principal)
krb5_free_principal(kparam.context, principal);
}
code = krb5_cc_initialize(kparam.context, kparam.cc[ccindex], principal);
if (code) {
- k5_error("Error while initialising memory caches" ,code);
+ k5_error("Error while initialising memory caches",code);
safe_free(principal_name);
if (principal)
krb5_free_principal(kparam.context, principal);
}
code = krb5_cc_store_cred(kparam.context, kparam.cc[ccindex], creds);
if (code) {
- k5_error("Error while storing credentials" ,code);
+ k5_error("Error while storing credentials",code);
if (principal)
krb5_free_principal(kparam.context, principal);
safe_free(principal_name);
}
if (code && code != KRB5_KT_END) {
- k5_error("Error while scanning keytab" ,code);
+ k5_error("Error while scanning keytab",code);
retval = 1;
goto cleanup;
}
code = krb5_kt_end_seq_get(kparam.context, keytab, &cursor);
if (code) {
- k5_error("Error while ending keytab scan" ,code);
+ k5_error("Error while ending keytab scan",code);
retval = 1;
goto cleanup;
}
*/
code = krb5_unparse_name(kparam.context, principal_list[i], &principal_name);
if (code) {
- k5_error("Error while unparsing principal name" ,code);
+ k5_error("Error while unparsing principal name",code);
goto loop_end;
}
debug((char *) "%s| %s: DEBUG: Keytab entry has principal: %s\n", LogTime(), PROGRAM, principal_name);
code = krb5_get_in_tkt_with_keytab(kparam.context, 0, NULL, NULL, NULL, keytab, NULL, creds, 0);
#endif
if (code) {
- k5_error("Error while initialising credentials from keytab" ,code);
+ k5_error("Error while initialising credentials from keytab",code);
goto loop_end;
}
code = krb5_cc_initialize(kparam.context, kparam.cc[ccindex], principal_list[i]);
if (code) {
- k5_error("Error while initialising memory caches" ,code);
+ k5_error("Error while initialising memory caches",code);
goto loop_end;
}
code = krb5_cc_store_cred(kparam.context, kparam.cc[ccindex], creds);
if (code) {
- k5_error("Error while storing credentials" ,code);
+ k5_error("Error while storing credentials",code);
goto loop_end;
}
if (creds->server)
code = krb5_parse_name(kparam.context, service, &creds->server);
xfree(service);
if (code) {
- k5_error("Error while initialising TGT credentials" ,code);
+ k5_error("Error while initialising TGT credentials",code);
goto loop_end;
}
code = krb5_get_credentials(kparam.context, 0, kparam.cc[ccindex], creds, &tgt_creds);
if (code) {
- k5_error("Error while getting tgt" ,code);
+ k5_error("Error while getting tgt",code);
goto loop_end;
} else {
debug((char *) "%s| %s: DEBUG: Found trusted principal name: %s\n", LogTime(), PROGRAM, principal_name);
*/
code = krb5_unparse_name(kparam.context, principal, &principal_name);
if (code) {
- k5_error("Error while unparsing principal name" ,code);
+ k5_error("Error while unparsing principal name",code);
retval = 1;
goto cleanup;
}
#define ATTRIBUTE_AD "memberof"
size_t get_attributes(LDAP * ld, LDAPMessage * res,
- const char *attribute /* IN */ , char ***out_val /* OUT (caller frees) */ );
+ const char *attribute /* IN */, char ***out_val /* OUT (caller frees) */ );
size_t get_bin_attributes(LDAP * ld, LDAPMessage * res,
- const char *attribute /* IN */ , char ***out_val,
+ const char *attribute /* IN */, char ***out_val,
int **out_len /* OUT (caller frees) */ );
int search_group_tree(struct main_args *margs, LDAP * ld, char *bindp,
char *ldap_group, char *group, int depth);
/* If directory then open database environment. This prevents sync problems
between different processes. Otherwise fallback to single file */
db_env_create(&db_env, 0);
- if (db_env->open(db_env, db_path, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK , 0666)) {
+ if (db_env->open(db_env, db_path, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK, 0666)) {
fprintf(stderr, "FATAL: %s: Failed to open database environment in '%s'\n", program_name, db_path);
db_env->close(db_env, 0);
exit(EXIT_FAILURE);
/* Adaptation::Ecap::ServiceRep */
Adaptation::Ecap::ServiceRep::ServiceRep(const ServiceConfigPointer &cfg):
-/*AsyncJob("Adaptation::Ecap::ServiceRep"),*/ Adaptation::Service(cfg),
+ /*AsyncJob("Adaptation::Ecap::ServiceRep"),*/ Adaptation::Service(cfg),
isDetached(false)
{
}
}
ESIElement::Pointer
-esiLiteral::makeUsable(esiTreeParentPtr , ESIVarState &newVarState) const
+esiLiteral::makeUsable(esiTreeParentPtr, ESIVarState &newVarState) const
{
debugs(86, 5, "esiLiteral::makeUsable: Creating usable literal");
esiLiteral * result = new esiLiteral (*this);
out = sb.c_str();
} else if (doMsec) {
if (fmt->widthMax < 0) {
- sb.appendf("%0*ld", fmt->widthMin , tvToMsec(outtv));
+ sb.appendf("%0*ld", fmt->widthMin, tvToMsec(outtv));
} else {
int precision = fmt->widthMax;
sb.appendf("%0*" PRId64 ".%0*" PRId64 "", fmt->zero && (fmt->widthMin - precision - 1 >= 0) ? fmt->widthMin - precision - 1 : 0, static_cast<int64_t>(outtv.tv_sec * 1000 + outtv.tv_usec / 1000), precision, static_cast<int64_t>((outtv.tv_usec % 1000 )* (1000 / fmt->divisor)));
continue ; /* A short-cut */
}
- for (caught = 0 , bit= 7 ; !caught && (bit <= 7); --bit) {
+ for (caught = 0, bit= 7 ; !caught && (bit <= 7); --bit) {
caught = ((ipbyte & 0x80) == 0x00); /* Found a '0' at 'bit' ? */
if (!caught)
mtCollapsedForwardingNotification,
mtCacheMgrRequest, mtCacheMgrResponse
#if SQUID_SNMP
- ,
- mtSnmpRequest, mtSnmpResponse
+,
+mtSnmpRequest, mtSnmpResponse
#endif
} MessageType;
case 'v':
/** \par v
* Display squid version and build information. Then exit. */
- printf("Squid Cache: Version %s\n" ,version_string);
+ printf("Squid Cache: Version %s\n",version_string);
printf("Service Name: " SQUIDSBUFPH "\n", SQUIDSBUFPRINT(service_name));
if (strlen(SQUID_BUILD_INFO))
printf("%s\n",SQUID_BUILD_INFO);
}
MemPoolChunked::MemPoolChunked(const char *aLabel, size_t aSize) :
- MemImplementingAllocator(aLabel, aSize) , chunk_size(0),
+ MemImplementingAllocator(aLabel, aSize), chunk_size(0),
chunk_capacity(0), chunkCount(0), freeCache(0), nextFreeChunk(0),
Chunks(0), allChunks(Splay<MemChunk *>())
{
/* Get stats for Totals report line */
memPoolGetGlobalStats(&mp_total);
- MemPoolStats *sortme = (MemPoolStats *) xcalloc(mp_total.tot_pools_alloc ,sizeof(*sortme));
+ MemPoolStats *sortme = (MemPoolStats *) xcalloc(mp_total.tot_pools_alloc,sizeof(*sortme));
int npools = 0;
/* main table */
", lastPossible=" << (void*) lastPossible );
tmp = static_cast<char *>(memchr(start, needleBegin, lastPossible-start));
if (tmp == NULL) {
- debugs(24, 8 , "First byte not found");
+ debugs(24, 8, "First byte not found");
return npos;
}
// lastPossible guarrantees no out-of-bounds with memcmp()
int no = name[current->len] ;
int i;
// Note: This works because the Config.peers keeps its index according to its position.
- for ( i=0 ; peers && (i < no) ; peers = peers->next , ++i ) ;
+ for ( i=0 ; peers && (i < no) ; peers = peers->next, ++i ) ;
if (peers) {
debugs(49, 6, "snmp peer_Inst: Encode peer #" << i);
const char *e = label + len -1;
while (e != label && xisdigit(*e)) --e;
if (e != label) ++e;
- return strtol(e, 0 , 10);
+ return strtol(e, 0, 10);
}
bool
int
mem_hdr::appendToNode(mem_node *aNode, const char *data, int maxLength)
{
- size_t result = writeAvailable (aNode, aNode->nodeBuffer.offset + aNode->nodeBuffer.length ,maxLength, data);
+ size_t result = writeAvailable (aNode, aNode->nodeBuffer.offset + aNode->nodeBuffer.length,maxLength, data);
return result;
}
if (sz >= 0 && !error)
bSz = sz;
- StoreIOBuffer result(bSz, 0 ,copyInto.data);
+ StoreIOBuffer result(bSz, 0,copyInto.data);
if (sz < 0 || error)
result.flags.error = 1;
#define STUB_API "ETag.cc"
#include "tests/STUB.h"
-int etagParseInit(ETag * , const char *) STUB_RETVAL(0)
+int etagParseInit(ETag *, const char *) STUB_RETVAL(0)
bool etagIsStrongEqual(const ETag &, const ETag &) STUB_RETVAL(false)
bool etagIsWeakEqual(const ETag &, const ETag &) STUB_RETVAL(false)
CPPUNIT_ASSERT( !anIPA.isNoAddr() );
CPPUNIT_ASSERT( !anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
CPPUNIT_ASSERT( anIPA.isIPv6() );
}
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp(&inval, &outval, sizeof(struct in_addr)) == 0 );
}
CPPUNIT_ASSERT( !anIPA.isIPv4() );
CPPUNIT_ASSERT( anIPA.isIPv6() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp( &inval, &outval, sizeof(struct in6_addr)) == 0 );
}
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
CPPUNIT_ASSERT( anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 80, anIPA.port() );
anIPA.getSockAddr(outsock);
CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in)) == 0 );
}
CPPUNIT_ASSERT( !anIPA.isIPv4() );
CPPUNIT_ASSERT( anIPA.isIPv6() );
CPPUNIT_ASSERT( anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 80, anIPA.port() );
anIPA.getSockAddr(outsock);
CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in6)) == 0 );
}
CPPUNIT_ASSERT( outIPA.isIPv4() );
CPPUNIT_ASSERT( !outIPA.isIPv6() );
CPPUNIT_ASSERT( outIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , outIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 80, outIPA.port() );
outIPA.getSockAddr(outsock);
CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in)) == 0 );
}
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
}
CPPUNIT_ASSERT( !anIPA.isNoAddr() );
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
CPPUNIT_ASSERT( !bnIPA.isIPv4() );
CPPUNIT_ASSERT( bnIPA.isIPv6() );
CPPUNIT_ASSERT( !bnIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , bnIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, bnIPA.port() );
bnIPA.getInAddr(outval6);
CPPUNIT_ASSERT( memcmp( &expectv6, &outval6, sizeof(struct in6_addr)) == 0 );
CPPUNIT_ASSERT( !cnIPA.isIPv4() );
CPPUNIT_ASSERT( cnIPA.isIPv6() );
CPPUNIT_ASSERT( !cnIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , cnIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, cnIPA.port() );
cnIPA.getInAddr(outval6);
CPPUNIT_ASSERT( memcmp( &expectv6, &outval6, sizeof(struct in6_addr)) == 0 );
}
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
anIPA.setEmpty();
CPPUNIT_ASSERT( !anIPA.isIPv4() );
CPPUNIT_ASSERT( anIPA.isIPv6() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
}
void
/* Test Basic CIDR Routine */
anIPA.setAnyAddr();
- CPPUNIT_ASSERT_EQUAL( 0 ,anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 0,anIPA.cidr() );
anIPA.setNoAddr();
- CPPUNIT_ASSERT_EQUAL( 128 , anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 128, anIPA.cidr() );
/* Test Numeric ApplyCIDR */
anIPA.setNoAddr();
anIPA.setNoAddr();
CPPUNIT_ASSERT( anIPA.applyMask(31,AF_INET) );
- CPPUNIT_ASSERT_EQUAL( 127 , anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 127, anIPA.cidr() );
anIPA.setNoAddr();
CPPUNIT_ASSERT( anIPA.applyMask(127,AF_INET6) );
- CPPUNIT_ASSERT_EQUAL( 127 , anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 127, anIPA.cidr() );
anIPA.setNoAddr();
anIPA.applyMask(80,AF_INET6);
- CPPUNIT_ASSERT_EQUAL( 80 , anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 80, anIPA.cidr() );
/* BUG Check: test values by display. */
CPPUNIT_ASSERT( anIPA.toStr(buf,MAX_IPSTRLEN) != NULL );
/* Test Network Bitmask from Ip::Address */
anIPA.setNoAddr();
maskIPA = "255.255.240.0";
- CPPUNIT_ASSERT_EQUAL( 20 , maskIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 20, maskIPA.cidr() );
anIPA.applyMask(maskIPA);
- CPPUNIT_ASSERT_EQUAL( 20 , anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 20, anIPA.cidr() );
/* BUG Check: test values memory after masking. */
struct in_addr btest;
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
anIPA.getInAddr(btest);
- CPPUNIT_ASSERT_EQUAL( (uint32_t)htonl(0xFFFFF000) , btest.s_addr );
+ CPPUNIT_ASSERT_EQUAL( (uint32_t)htonl(0xFFFFF000), btest.s_addr );
/* BUG Check failing test. Masked values for display. */
CPPUNIT_ASSERT( memcmp("255.255.240.0",anIPA.toStr(buf,MAX_IPSTRLEN), 13) == 0 );
CPPUNIT_ASSERT( !maskIPA.isNoAddr() );
anIPA.applyMask(maskIPA);
CPPUNIT_ASSERT( !anIPA.isNoAddr() );
- CPPUNIT_ASSERT_EQUAL( 44 , anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 44, anIPA.cidr() );
anIPA.setNoAddr();
maskIPA.setNoAddr();
CPPUNIT_ASSERT( !maskIPA.isNoAddr() );
CPPUNIT_ASSERT( maskIPA.isIPv4() );
CPPUNIT_ASSERT( !maskIPA.isIPv6() );
- CPPUNIT_ASSERT_EQUAL( 20 , anIPA.cidr() );
+ CPPUNIT_ASSERT_EQUAL( 20, anIPA.cidr() );
}
void
CPPUNIT_ASSERT( !anIPA.isNoAddr() );
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
CPPUNIT_ASSERT( !anIPA.isNoAddr() );
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
CPPUNIT_ASSERT( !anIPA.isNoAddr() );
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
CPPUNIT_ASSERT( !anIPA.isNoAddr() );
CPPUNIT_ASSERT( anIPA.isIPv4() );
CPPUNIT_ASSERT( !anIPA.isIPv6() );
- CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() );
+ CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() );
CPPUNIT_ASSERT( !anIPA.isSockAddr() );
anIPA.getInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
CPPUNIT_TEST( testAppendStdString );
CPPUNIT_TEST( testAppendf );
CPPUNIT_TEST( testSubscriptOp );
- CPPUNIT_TEST_EXCEPTION( testSubscriptOpFail , OutOfBoundsException );
+ CPPUNIT_TEST_EXCEPTION( testSubscriptOpFail, OutOfBoundsException );
CPPUNIT_TEST( testComparisons );
CPPUNIT_TEST( testConsume );
CPPUNIT_TEST( testRawContent );
#if _SQUID_WINDOWS_
- while ((reply=recv(s, buf , sizeof(buf), 0)) > 0)
+ while ((reply=recv(s, buf, sizeof(buf), 0)) > 0)
fwrite(buf, 1, reply, fp);
rewind(fp);