------------------------------------------------------------ revno: 11964 revision-id: squid3@treenet.co.nz-20120107101540-r30l1lo0lglmndhs parent: squid3@treenet.co.nz-20120105141204-wm58j1qdf5zuz6zz committer: Amos Jeffries branch nick: trunk timestamp: Sat 2012-01-07 03:15:40 -0700 message: Cleanup: update most of the existing stub files to use the STUB.h framework There are still several sections to be done. Including adding library API stubs. However these are the ones which can be done immediately without breaking or re-writing existing unit tests. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20120107101540-r30l1lo0lglmndhs # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 1d1620411a0509b9adf2d7054f9caab71bfcebf0 # timestamp: 2012-01-07 10:59:06 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20120105141204-\ # wm58j1qdf5zuz6zz # # Begin patch === modified file 'src/Makefile.am' --- src/Makefile.am 2012-01-03 02:19:30 +0000 +++ src/Makefile.am 2012-01-07 10:15:40 +0000 @@ -1091,6 +1091,7 @@ tests/stub_StatHist.cc \ tests/stub_store.cc \ tests/stub_store_stats.cc \ + tests/stub_tools.cc \ tests/testHttpReply.cc \ tests/testHttpReply.h \ tests/testMain.cc \ @@ -2186,6 +2187,7 @@ tests/stub_debug.cc \ tests/stub_event.cc \ tests/stub_HelperChildConfig.cc \ + tests/stub_tools.cc \ tests/testHttpParser.cc \ tests/testHttpParser.h \ tests/testMain.cc \ @@ -2426,6 +2428,7 @@ mem.cc \ mem_node.cc \ MemBuf.cc \ + MemObject.cc \ Packer.cc \ Parsing.cc \ RemovalPolicy.cc \ @@ -2470,7 +2473,6 @@ tests/stub_HttpReply.cc \ tests/stub_HttpRequest.cc \ tests/stub_libcomm.cc \ - tests/stub_MemObject.cc \ tests/stub_MemStore.cc \ tests/stub_mime.cc \ tests/stub_Port.cc \ @@ -2548,6 +2550,7 @@ tests/stub_cache_manager.cc \ tests/stub_debug.cc \ tests/stub_HelperChildConfig.cc \ + tests/stub_tools.cc \ time.cc \ wordlist.cc nodist_tests_testString_SOURCES = \ @@ -2811,7 +2814,6 @@ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ tests/stub_tools.cc \ - tests/stub_UdsOp.cc \ time.cc \ url.cc \ URLScheme.cc \ @@ -2852,7 +2854,7 @@ $(SSLLIB) \ $(COMPAT_LIB) \ $(XTRA_LIBS) -tests_testRock_LDFLAGS = $(LIBADD_DL) +tests_testRock_LDFLAGS = $(INCLUDES) $(LIBADD_DL) tests_testRock_DEPENDENCIES = \ $(SWAP_TEST_DS) @@ -3330,6 +3332,7 @@ tests/stub_cache_manager.cc \ tests/stub_debug.cc \ tests/stub_HelperChildConfig.cc \ + tests/stub_tools.cc \ time.cc \ wordlist.cc nodist_tests_testConfigParser_SOURCES = \ === modified file 'src/ip/Makefile.am' --- src/ip/Makefile.am 2010-11-01 05:44:28 +0000 +++ src/ip/Makefile.am 2012-01-07 10:15:40 +0000 @@ -24,8 +24,8 @@ testAddress.h nodist_testIpAddress_SOURCES= \ $(top_srcdir)/src/tests/stub_debug.cc \ - $(top_srcdir)/src/tests/testMain.cc \ - $(top_srcdir)/test-suite/test_tools.cc + $(top_srcdir)/src/tests/stub_tools.cc \ + $(top_srcdir)/src/tests/testMain.cc testIpAddress_LDADD= \ libip.la \ $(XTRA_LIBS) \ === modified file 'src/tests/STUB.h' --- src/tests/STUB.h 2011-09-10 00:12:21 +0000 +++ src/tests/STUB.h 2012-01-07 10:15:40 +0000 @@ -1,5 +1,4 @@ #ifndef STUB -#include "fatal.h" /** \group STUB * @@ -17,27 +16,35 @@ * #define STUB_API "foo/libexample.la" * #include "tests/STUB.h" */ +#include + +// Internal Special: the STUB framework requires this function +#define stub_fatal(m) { std::cerr<<"FATAL: "<<(m)<<" for use of "<<__FUNCTION__<<"\n"; exit(1); } /// macro to stub a void function. -#define STUB { fatal(STUB_API " required"); } +#define STUB { stub_fatal(STUB_API " required"); } + +/// macro to stub a void function without a fatal message +/// Intended for registration pattern APIs where the function result does not matter to the test +#define STUB_NOP { std::cerr<<"SKIP: "<hdr_sz : 0); - - /* We don't separate out mime headers yet, so ensure that the first - * write is at offset 0 - where they start - */ - assert (data_hdr.endOffset() || writeBuffer.offset == 0); - - assert (data_hdr.write (writeBuffer)); - callback (callbackData, writeBuffer); - PROF_stop(MemObject_write); -} - -void -MemObject::replaceHttpReply(HttpReply *newrep) -{ - fatal ("Not implemented"); -} - -int64_t -MemObject::lowestMemReaderOffset() const -{ - fatal ("Not implemented"); - return 0; -} - -void -MemObject::kickReads() -{ - fatal ("Not implemented"); -} - -int64_t -MemObject::objectBytesOnDisk() const -{ - fatal ("MemObject.cc required."); - return 0; -} - -bool -MemObject::isContiguous() const -{ - fatal ("MemObject.cc required."); - return false; -} - -int64_t -MemObject::expectedReplySize() const -{ - fatal ("MemObject.cc required."); - return 0; -} - -void -MemObject::resetUrls(char const*, char const*) -{ - fatal ("MemObject.cc required."); -} - -void -MemObject::markEndOfReplyHeaders() -{ - fatal ("MemObject.cc required."); -} - -size_t -MemObject::inUseCount() -{ - fatal ("MemObject.cc required."); - return 0; -} +void MemObject::unlinkRequest() STUB +void MemObject::write(StoreIOBuffer writeBuffer, STMCB *callback, void *callbackData) STUB +void MemObject::replaceHttpReply(HttpReply *newrep) STUB +int64_t MemObject::lowestMemReaderOffset() const STUB_RETVAL(0) +void MemObject::kickReads() STUB +int64_t MemObject::objectBytesOnDisk() const STUB_RETVAL(0) +bool MemObject::isContiguous() const STUB_RETVAL(false) +int64_t MemObject::expectedReplySize() const STUB_RETVAL(0) +void MemObject::resetUrls(char const*, char const*) STUB +void MemObject::markEndOfReplyHeaders() STUB +size_t MemObject::inUseCount() STUB_RETVAL(0) === modified file 'src/tests/stub_UdsOp.cc' --- src/tests/stub_UdsOp.cc 2010-10-28 18:52:59 +0000 +++ src/tests/stub_UdsOp.cc 2012-01-07 10:15:40 +0000 @@ -1,7 +1,7 @@ #include "config.h" #include "ipc/UdsOp.h" -void Ipc::SendMessage(const String& toAddress, const TypedMsgHdr& message) -{ - fatal ("Not implemented"); -} +#define STUB_API "UdsOp.cc" +#include "tests/STUB.h" + +void Ipc::SendMessage(const String& toAddress, const TypedMsgHdr& message) STUB === modified file 'src/tests/stub_access_log.cc' --- src/tests/stub_access_log.cc 2009-01-21 03:47:47 +0000 +++ src/tests/stub_access_log.cc 2012-01-07 10:15:40 +0000 @@ -1,45 +1,10 @@ -/* - * $Id$ - * - * DEBUG: section 28 Access Control - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - #include "squid.h" #include "HierarchyLogEntry.h" +#define STUB_API "access.log.cc" +#include "tests/STUB.h" -HierarchyLogEntry::HierarchyLogEntry() -{ - fatal("Not implemented."); -} +HierarchyLogEntry::HierarchyLogEntry() STUB ping_data::ping_data() : n_sent(0), === modified file 'src/tests/stub_cache_cf.cc' --- src/tests/stub_cache_cf.cc 2011-08-30 15:04:30 +0000 +++ src/tests/stub_cache_cf.cc 2012-01-07 10:15:40 +0000 @@ -36,28 +36,14 @@ #include "ConfigParser.h" #include "wordlist.h" -void -self_destruct(void) -{ - /* fatalf("Bungled %s line %d: %s", - cfg_filename, config_lineno, config_input_line);*/ - fatalf("bungled line"); -} - -void -parse_int(int *var) -{ - fatal("not implemented 1"); -} - -void -parse_onoff(int *var) -{ - fatal("not implemented 2"); -} - -void -parse_eol(char *volatile *var) +#define STUB_API "cache_cf.cc" +#include "tests/STUB.h" + +void self_destruct(void) STUB +void parse_int(int *var) STUB +void parse_onoff(int *var) STUB +void parse_eol(char *volatile *var) STUB +#if 0 { unsigned char *token = (unsigned char *) strtok(NULL, null_string); safe_free(*var); @@ -73,9 +59,10 @@ *var = xstrdup((char *) token); } +#endif -void -parse_wordlist(wordlist ** list) +void parse_wordlist(wordlist ** list) STUB +#if 0 { char *token; char *t = strtok(NULL, ""); @@ -83,45 +70,11 @@ while ((token = strwordtok(NULL, &t))) wordlistAdd(list, token); } - -void -requirePathnameExists(const char *name, const char *path) -{ - /* tee-hee. ignore this for testing */ -} - -void -parse_time_t(time_t * var) -{ - fatal("not implemented 6"); -} - -char * -strtokFile(void) -{ - fatal("not implemented 9"); - return NULL; -} - -void -ConfigParser::ParseUShort(unsigned short *var) -{ - fatal("not implemented 10"); -} - -void -dump_acl_access(StoreEntry * entry, const char *name, acl_access * head) -{ - fatal("not implemented 11"); -} - -YesNoNone::operator void*() const -{ - /* ignore this for testing */ - return NULL; -} - -/* - * DO NOT MODIFY: - * arch-tag: 9bbc3b5f-8d7b-4fdc-af59-0b524a785307 - */ +#endif + +void requirePathnameExists(const char *name, const char *path) STUB_NOP +void parse_time_t(time_t * var) STUB +char * strtokFile(void) STUB_RETVAL(NULL) +void ConfigParser::ParseUShort(unsigned short *var) STUB +void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head) STUB +YesNoNone::operator void*() const { STUB_NOP; return NULL; } === modified file 'src/tests/stub_cache_manager.cc' --- src/tests/stub_cache_manager.cc 2010-12-08 12:45:50 +0000 +++ src/tests/stub_cache_manager.cc 2012-01-07 10:15:40 +0000 @@ -1,68 +1,16 @@ -/* - * AUTHOR: Francesco Chemolli - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - #include "squid.h" #include "CacheManager.h" #include "mgr/Registration.h" -Mgr::Action::Pointer -CacheManager::createNamedAction(char const* action) -{ - fatal("Not implemented"); - return NULL; -} - -void -CacheManager::Start(const Comm::ConnectionPointer &conn, HttpRequest * request, StoreEntry * entry) -{ - return; -} - +#define STUB_API "cache_manager.cc" +#include "tests/STUB.h" + +Mgr::Action::Pointer CacheManager::createNamedAction(char const* action) STUB_RETVAL(NULL) +void CacheManager::Start(const Comm::ConnectionPointer &conn, HttpRequest * request, StoreEntry * entry) { +std::cerr << HERE << "\n"; +STUB +} CacheManager* CacheManager::instance=0; - -CacheManager* -CacheManager::GetInstance() -{ - fatal("Not implemented"); - return instance; -} - -void -Mgr::RegisterAction(char const*, char const*, OBJH, int, int) -{ -} - -void -Mgr::RegisterAction(char const * action, char const * desc, - Mgr::ClassActionCreationHandler *handler, - int pw_req_flag, int atomic) -{ -} +CacheManager* CacheManager::GetInstance() STUB_RETVAL(instance) +void Mgr::RegisterAction(char const*, char const*, OBJH, int, int) {} +void Mgr::RegisterAction(char const *, char const *, Mgr::ClassActionCreationHandler *, int, int) {} === modified file 'src/tests/stub_client_db.cc' --- src/tests/stub_client_db.cc 2011-05-13 08:13:01 +0000 +++ src/tests/stub_client_db.cc 2012-01-07 10:15:40 +0000 @@ -2,67 +2,18 @@ /* because the clientdb API is defined in protos.h still */ #include "protos.h" -void -clientdbInit(void) -{ - fatal("client_db.cc required"); -} - -void -clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t) -{ - fatal("client_db.cc required"); -} - -int -clientdbCutoffDenied(const Ip::Address &) -{ - fatal("client_db.cc required"); - return -1; -} - -void -clientdbDump(StoreEntry *) -{ - fatal("client_db.cc required"); -} - -void -clientdbFreeMemory(void) -{ - fatal("client_db.cc required"); -} - -int -clientdbEstablished(const Ip::Address &, int) -{ - fatal("client_db.cc required"); - return -1; -} - +#define STUB_API "client_db.cc" +#include "tests/STUB.h" + +void clientdbInit(void) STUB +void clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t) STUB +int clientdbCutoffDenied(const Ip::Address &) STUB_RETVAL(-1) +void clientdbDump(StoreEntry *) STUB +void clientdbFreeMemory(void) STUB +int clientdbEstablished(const Ip::Address &, int) STUB_RETVAL(-1) #if USE_DELAY_POOLS -void -clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark) -{ - fatal("client_db.cc required"); -} - -ClientInfo * -clientdbGetInfo(const Ip::Address &addr) -{ - fatal("client_db.cc required"); - return NULL; -} +void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark) STUB +ClientInfo *clientdbGetInfo(const Ip::Address &addr) STUB_RETVAL(NULL) #endif - -void -clientOpenListenSockets(void) -{ - fatal("client_db.cc required"); -} - -void -clientHttpConnectionsClose(void) -{ - fatal("client_db.cc required"); -} +void clientOpenListenSockets(void) STUB +void clientHttpConnectionsClose(void) STUB === modified file 'src/tests/stub_comm.cc' --- src/tests/stub_comm.cc 2011-12-17 03:42:43 +0000 +++ src/tests/stub_comm.cc 2012-01-07 10:15:40 +0000 @@ -32,140 +32,36 @@ * */ -#include "squid.h" +#include "config.h" #include "comm.h" #include "comm/Connection.h" #include "comm/Loops.h" -#include "CommRead.h" #include "fde.h" -DeferredReadManager::~DeferredReadManager() -{ - /* no networked tests yet */ -} - -DeferredRead::DeferredRead (DeferrableRead *, void *, CommRead const &) -{ - fatal ("Not implemented"); -} - -void -DeferredReadManager::delayRead(DeferredRead const &aRead) -{ - fatal ("Not implemented"); -} - -void -DeferredReadManager::kickReads(int const count) -{ - fatal ("Not implemented"); -} - -void -comm_read(const Comm::ConnectionPointer &conn, char *buf, int size, IOCB *handler, void *handler_data) -{ - fatal ("Not implemented"); -} - -void -comm_read(const Comm::ConnectionPointer &conn, char*, int, AsyncCall::Pointer &callback) -{ - fatal ("Not implemented"); -} +#define STUB_API "comm.cc" +#include "tests/STUB.h" + +void comm_read(const Comm::ConnectionPointer &conn, char *buf, int size, IOCB *handler, void *handler_data) STUB +void comm_read(const Comm::ConnectionPointer &conn, char*, int, AsyncCall::Pointer &callback) STUB /* should be in stub_CommRead */ #include "CommRead.h" -CommRead::CommRead(const Comm::ConnectionPointer &, char *buf, int len, AsyncCall::Pointer &callback) -{ - fatal ("Not implemented"); -} - -CommRead::CommRead () -{ - fatal ("Not implemented"); -} - -void -commSetCloseOnExec(int fd) -{ - /* for tests... ignore */ -} - -#if 0 -void -Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout) -{ - /* all test code runs synchronously at the moment */ -} - -void -Comm::QuickPollRequired() -{ - /* for tests ... ignore */ -} -#endif - -int -ignoreErrno(int ierrno) -{ - fatal ("Not implemented"); - return -1; -} - -void -commUnsetFdTimeout(int fd) -{ - fatal ("Not implemented"); -} - -int -commSetNonBlocking(int fd) -{ - fatal ("Not implemented"); - return COMM_ERROR; -} - -int -commUnsetNonBlocking(int fd) -{ - fatal ("Not implemented"); - return -1; -} - -void -comm_init(void) -{ - fd_table =(fde *) xcalloc(Squid_MaxFD, sizeof(fde)); - - /* Keep a few file descriptors free so that we don't run out of FD's - * after accepting a client but before it opens a socket or a file. - * Since Squid_MaxFD can be as high as several thousand, don't waste them */ - RESERVED_FD = min(100, Squid_MaxFD / 4); -} - -/* MinGW needs also a stub of _comm_close() */ -void -_comm_close(int fd, char const *file, int line) -{ - fatal ("Not implemented"); -} - -int -commSetTimeout(int fd, int timeout, AsyncCall::Pointer& callback) -{ - fatal ("Not implemented"); - return -1; -} - -int -comm_open_uds(int sock_type, int proto, struct sockaddr_un* addr, int flags) -{ - fatal ("Not implemented"); - return -1; -} - -void -comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func) -{ - fatal ("Not implemented"); -} +CommRead::CommRead(const Comm::ConnectionPointer &, char *buf, int len, AsyncCall::Pointer &callback) STUB +CommRead::CommRead() STUB +DeferredReadManager::~DeferredReadManager() STUB +DeferredRead::DeferredRead(DeferrableRead *, void *, CommRead const &) STUB +void DeferredReadManager::delayRead(DeferredRead const &aRead) STUB +void DeferredReadManager::kickReads(int const count) STUB + +void commSetCloseOnExec(int fd) STUB_NOP +int ignoreErrno(int ierrno) STUB_RETVAL(-1) + +void commUnsetFdTimeout(int fd) STUB +int commSetNonBlocking(int fd) STUB_RETVAL(COMM_ERROR) +int commUnsetNonBlocking(int fd) STUB_RETVAL(-1) + +// MinGW needs also a stub of _comm_close() +void _comm_close(int fd, char const *file, int line) STUB +int commSetTimeout(int fd, int timeout, AsyncCall::Pointer& callback) STUB_RETVAL(-1) +int comm_open_uds(int sock_type, int proto, struct sockaddr_un* addr, int flags) STUB_RETVAL(-1) +void comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func) STUB === modified file 'src/tests/stub_errorpage.cc' --- src/tests/stub_errorpage.cc 2011-06-17 18:57:21 +0000 +++ src/tests/stub_errorpage.cc 2012-01-07 10:15:40 +0000 @@ -1,80 +1,12 @@ -/* - * $Id$ - * - * DEBUG: section 28 Access Control - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - #include "config.h" #include "errorpage.h" -err_type -errorReservePageId(const char *page_name) -{ - fatal("Not implemented"); - return err_type(); -} - -void -errorAppendEntry(StoreEntry * entry, ErrorState * err) -{ - fatal("Not implemented"); -} - -bool -strHdrAcptLangGetItem(const String &hdr, char *lang, int langLen, size_t &pos) -{ - fatal("Not implemented"); - return false; -} - -bool -TemplateFile::loadDefault() -{ - fatal("Not implemented"); - return false; -} - -TemplateFile::TemplateFile(char const*) -{ - fatal("Not implemented"); -} - -bool -TemplateFile::loadFor(HttpRequest*) -{ - fatal("Not implemented"); - return false; -} - -/* - * DO NOT MODIFY: - * arch-tag: e4c72cfd-0b31-4497-90e6-0e3cda3b92b4 - */ +#define STUB_API "errorpage.cc" +#include "tests/STUB.h" + +err_type errorReservePageId(const char *page_name) STUB_RETVAL(err_type()) +void errorAppendEntry(StoreEntry * entry, ErrorState * err) STUB +bool strHdrAcptLangGetItem(const String &hdr, char *lang, int langLen, size_t &pos) STUB_RETVAL(false) +bool TemplateFile::loadDefault() STUB_RETVAL(false) +TemplateFile::TemplateFile(char const*) STUB +bool TemplateFile::loadFor(HttpRequest*) STUB_RETVAL(false) === modified file 'src/tests/stub_fd.cc' --- src/tests/stub_fd.cc 2009-12-31 02:35:01 +0000 +++ src/tests/stub_fd.cc 2012-01-07 10:15:40 +0000 @@ -1,67 +1,11 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - #include "config.h" #include "fde.h" -int -fdNFree(void) -{ - fatal ("Not Implemented"); - return -1; -} - -void -fd_open(int fd, unsigned int type, const char *desc) -{ - fatal ("Not Implemented"); -} - -void -fd_close(int fd) -{ - fatal ("Not Implemented"); -} - -void -fd_bytes(int fd, int len, unsigned int type) -{ - fatal ("Not Implemented"); -} - -void -fd_note(int fd, const char *s) -{ - fatal ("Not Implemented"); -} +#define STUB_API "fd.cc" +#include "tests/STUB.h" + +int fdNFree(void) STUB_RETVAL(-1) +void fd_open(int fd, unsigned int type, const char *desc) STUB +void fd_close(int fd) STUB +void fd_bytes(int fd, int len, unsigned int type) STUB +void fd_note(int fd, const char *s) STUB === modified file 'src/tests/stub_helper.cc' --- src/tests/stub_helper.cc 2009-12-16 03:46:59 +0000 +++ src/tests/stub_helper.cc 2012-01-07 10:15:40 +0000 @@ -1,118 +1,21 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "squid.h" +#include "config.h" #include "helper.h" -void -helperSubmit(helper * hlp, const char *buf, HLPCB * callback, void *data) -{ - fatal("Not implemented"); -} - -void -helperStatefulSubmit(statefulhelper * hlp, const char *buf, HLPSCB * callback, void *data, helper_stateful_server * lastserver) -{ - fatal("Not implemented"); -} - -helper::~helper() -{ - fatal("Not implemented"); -} - +#define STUB_API "helper.cc" +#include "tests/STUB.h" + +void helperSubmit(helper * hlp, const char *buf, HLPCB * callback, void *data) STUB +void helperStatefulSubmit(statefulhelper * hlp, const char *buf, HLPSCB * callback, void *data, helper_stateful_server * lastserver) STUB +helper::~helper() STUB CBDATA_CLASS_INIT(helper); -void -helperStats(StoreEntry * sentry, helper * hlp, const char *label) -{ - fatal("Not implemented"); -} - -void -helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp, const char *label) -{ - fatal("Not implemented"); -} - -void -helperShutdown(helper * hlp) -{ - fatal("Not implemented"); -} - -void -helperStatefulShutdown(statefulhelper * hlp) -{ - fatal("Not implemented"); -} - -void -helperOpenServers(helper * hlp) -{ - debugs(84,4,"Not implemented"); -} - -void -helperStatefulOpenServers(statefulhelper * hlp) -{ - debugs(84,4,"Not implemented"); -} - -void * -helperStatefulServerGetData(helper_stateful_server * srv) -{ - fatal("Not implemented"); - return NULL; -} - -helper_stateful_server * -helperStatefulDefer(statefulhelper * hlp) -{ - fatal("Not implemented"); - return NULL; -} - -void -helperStatefulReleaseServer(helper_stateful_server * srv) -{ - fatal("Not implemented"); -} - +void helperStats(StoreEntry * sentry, helper * hlp, const char *label) STUB +void helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp, const char *label) STUB +void helperShutdown(helper * hlp) STUB +void helperStatefulShutdown(statefulhelper * hlp) STUB +void helperOpenServers(helper * hlp) STUB +void helperStatefulOpenServers(statefulhelper * hlp) STUB +void *helperStatefulServerGetData(helper_stateful_server * srv) STUB_RETVAL(NULL) +helper_stateful_server *helperStatefulDefer(statefulhelper * hlp) STUB_RETVAL(NULL) +void helperStatefulReleaseServer(helper_stateful_server * srv) STUB CBDATA_CLASS_INIT(statefulhelper); - -/* - * DO NOT MODIFY: - * arch-tag: 0b5fe2ac-1652-4b77-8788-85ded78ad3bb - */ === modified file 'src/tests/stub_http.cc' --- src/tests/stub_http.cc 2009-01-21 03:47:47 +0000 +++ src/tests/stub_http.cc 2012-01-07 10:15:40 +0000 @@ -1,42 +1,6 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - #include "squid.h" -const char * -httpMakeVaryMark(HttpRequest * request, HttpReply const * reply) -{ - fatal ("Not implemented"); - return NULL; -} +#define STUB_API "http.cc" +#include "tests/STUB.h" + +const char * httpMakeVaryMark(HttpRequest * request, HttpReply const * reply) STUB_RETVAL(NULL) === modified file 'src/tests/stub_icp.cc' --- src/tests/stub_icp.cc 2011-07-16 15:21:48 +0000 +++ src/tests/stub_icp.cc 2012-01-07 10:15:40 +0000 @@ -3,9 +3,8 @@ #include "ICP.h" #include "icp_opcode.h" -#define STUB { fatal("icp_*.cc required."); } -#define STUB_RETVAL(x) { fatal("icp_*.cc required."); return (x); } -//#define STUB_RETREF(x) { fatal("icp_*.cc required."); static x v; return v; } +#define STUB_API "icp_*.cc" +#include "tests/STUB.h" #ifdef __cplusplus _icp_common_t::_icp_common_t() STUB === modified file 'src/tests/stub_internal.cc' --- src/tests/stub_internal.cc 2009-01-21 03:47:47 +0000 +++ src/tests/stub_internal.cc 2012-01-07 10:15:40 +0000 @@ -1,42 +1,7 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "squid.h" - -char * -internalLocalUri(const char *dir, const char *name) -{ - fatal ("Not implemented"); - return NULL; -} +#include "config.h" +#include "protos.h" + +#define STUB_API "internal.cc" +#include "tests/STUB.h" + +char * internalLocalUri(const char *dir, const char *name) STUB_RETVAL(NULL) === modified file 'src/tests/stub_ipc.cc' --- src/tests/stub_ipc.cc 2011-05-13 08:13:01 +0000 +++ src/tests/stub_ipc.cc 2012-01-07 10:15:40 +0000 @@ -2,9 +2,7 @@ // because ipcCreate is defined in protos.h still #include "protos.h" -pid_t -ipcCreate(int type, const char *prog, const char *const args[], const char *name, Ip::Address &local_addr, int *rfd, int *wfd, void **hIpc) -{ - fatal("ipc.cc required."); - return -1; -} +#define STUB_API "ipc.cc" +#include "tests/STUB.h" + +pid_t ipcCreate(int, const char *, const char *const [], const char *, Ip::Address &, int *, int *, void **) STUB_RETVAL(-1) === modified file 'src/tests/stub_mem_node.cc' --- src/tests/stub_mem_node.cc 2009-01-21 03:47:47 +0000 +++ src/tests/stub_mem_node.cc 2012-01-07 10:15:40 +0000 @@ -1,48 +1,8 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "squid.h" +#include "config.h" #include "mem_node.h" -mem_node::mem_node(int64_t offset):nodeBuffer(0,offset,data) -{ - fatal ("Not implemented"); -} +#define STUB_API "mem_node.cc" +#include "tests/STUB.h" -size_t -mem_node::InUseCount() -{ - fatal ("Not implemented"); - return 0; -} +mem_node::mem_node(int64_t offset):nodeBuffer(0,offset,data) STUB +size_t mem_node::InUseCount() STUB_RETVAL(0) === modified file 'src/tests/stub_mime.cc' --- src/tests/stub_mime.cc 2009-01-21 03:47:47 +0000 +++ src/tests/stub_mime.cc 2012-01-07 10:15:40 +0000 @@ -1,42 +1,7 @@ -/* - * $Id$ - * - * DEBUG: section 28 Access Control - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "squid.h" - -size_t -headersEnd(const char *mime, size_t l) -{ - fatal("Not implemented"); - return 0; -} +#include "config.h" +#include "protos.h" + +#define STUB_API "mime.cc" +#include "tests/STUB.h" + +size_t headersEnd(const char *mime, size_t l) STUB_RETVAL(0) === modified file 'src/tests/stub_pconn.cc' --- src/tests/stub_pconn.cc 2011-06-04 12:48:45 +0000 +++ src/tests/stub_pconn.cc 2012-01-07 10:15:40 +0000 @@ -1,131 +1,31 @@ /* * STUB file for the pconn.cc API - * Functions here are inactive. */ #include "config.h" #include "pconn.h" #include "comm/Connection.h" -IdleConnList::IdleConnList(const char *key, PconnPool *parent) -{ - fatal("pconn.cc required"); -} - -IdleConnList::~IdleConnList() -{ - fatal("pconn.cc required"); -} - -void -IdleConnList::push(const Comm::ConnectionPointer &conn) -{ - fatal("pconn.cc required"); -} - -Comm::ConnectionPointer -IdleConnList::findUseable(const Comm::ConnectionPointer &key) -{ - fatal("pconn.cc required"); - return Comm::ConnectionPointer(); -} - -void -IdleConnList::clearHandlers(const Comm::ConnectionPointer &conn) -{ - fatal("pconn.cc required"); -} - -PconnPool::PconnPool(const char *) -{ - fatal("pconn.cc required"); -} - -PconnPool::~PconnPool() -{ - fatal("pconn.cc required"); -} - -void -PconnPool::moduleInit() -{ - fatal("pconn.cc required"); -} - -void -PconnPool::push(const Comm::ConnectionPointer &serverConn, const char *domain) -{ - fatal("pconn.cc required"); -} - -Comm::ConnectionPointer -PconnPool::pop(const Comm::ConnectionPointer &destLink, const char *domain, bool retriable) -{ - fatal("pconn.cc required"); - return Comm::ConnectionPointer(); -} - -void -PconnPool::count(int uses) -{ - fatal("pconn.cc required"); -} - -void -PconnPool::noteUses(int) -{ - fatal("pconn.cc required"); -} - -void -PconnPool::dumpHist(StoreEntry *e) const -{ - fatal("pconn.cc required"); -} - -void -PconnPool::dumpHash(StoreEntry *e) const -{ - fatal("pconn.cc required"); -} - -void -PconnPool::unlinkList(IdleConnList *list) -{ - fatal("pconn.cc required"); -} - -PconnModule * -PconnModule::GetInstance() -{ - fatal("pconn.cc required"); - return NULL; -} - -void -PconnModule::DumpWrapper(StoreEntry *e) -{ - fatal("pconn.cc required"); -} - -PconnModule::PconnModule() -{ - fatal("pconn.cc required"); -} - -void -PconnModule::registerWithCacheManager(void) -{ - fatal("pconn.cc required"); -} - -void -PconnModule::add(PconnPool *) -{ - fatal("pconn.cc required"); -} - -void -PconnModule::dump(StoreEntry *) -{ - fatal("pconn.cc required"); -} +#define STUB_API "pconn.cc" +#include "tests/STUB.h" + +IdleConnList::IdleConnList(const char *key, PconnPool *parent) STUB +IdleConnList::~IdleConnList() STUB +void IdleConnList::push(const Comm::ConnectionPointer &conn) STUB +Comm::ConnectionPointer IdleConnList::findUseable(const Comm::ConnectionPointer &key) STUB_RETVAL(Comm::ConnectionPointer()) +void IdleConnList::clearHandlers(const Comm::ConnectionPointer &conn) STUB +PconnPool::PconnPool(const char *) STUB +PconnPool::~PconnPool() STUB +void PconnPool::moduleInit() STUB +void PconnPool::push(const Comm::ConnectionPointer &serverConn, const char *domain) STUB +Comm::ConnectionPointer PconnPool::pop(const Comm::ConnectionPointer &destLink, const char *domain, bool retriable) STUB_RETVAL(Comm::ConnectionPointer()) +void PconnPool::count(int uses) STUB +void PconnPool::noteUses(int) STUB +void PconnPool::dumpHist(StoreEntry *e) const STUB +void PconnPool::dumpHash(StoreEntry *e) const STUB +void PconnPool::unlinkList(IdleConnList *list) STUB +PconnModule * PconnModule::GetInstance() STUB_RETVAL(NULL) +void PconnModule::DumpWrapper(StoreEntry *e) STUB +PconnModule::PconnModule() STUB +void PconnModule::registerWithCacheManager(void) STUB +void PconnModule::add(PconnPool *) STUB +void PconnModule::dump(StoreEntry *) STUB === modified file 'src/tests/stub_stmem.cc' --- src/tests/stub_stmem.cc 2009-01-21 03:47:47 +0000 +++ src/tests/stub_stmem.cc 2012-01-07 10:15:40 +0000 @@ -1,49 +1,9 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "squid.h" +#include "config.h" #include "stmem.h" -mem_hdr::mem_hdr() -{} - -mem_hdr::~mem_hdr() -{} - -size_t -mem_hdr::size() const -{ - fatal ("Not implemented"); - return 0; -} +#define STUB_API "stmem.cc" +#include "tests/STUB.h" + +mem_hdr::mem_hdr() STUB +mem_hdr::~mem_hdr() STUB +size_t mem_hdr::size() const STUB_RETVAL(0) === modified file 'src/tests/stub_store_client.cc' --- src/tests/stub_store_client.cc 2009-01-21 03:47:47 +0000 +++ src/tests/stub_store_client.cc 2012-01-07 10:15:40 +0000 @@ -1,53 +1,20 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - #include "squid.h" #include "StoreClient.h" #include "Store.h" -int -storePendingNClients(const StoreEntry * e) +#define STUB_API "store_client.cc" +#include "tests/STUB.h" + +int storePendingNClients(const StoreEntry * e) { /* no clients in the tests so far */ return 0; } -/* Garh, too many stub files */ - -void -StoreEntry::invokeHandlers() -{} +void StoreEntry::invokeHandlers() +{ + /* do nothing for tests */ +} void storeLog(int tag, const StoreEntry * e) @@ -55,54 +22,11 @@ /* do nothing for tests - we don't need the log */ } -void -storeLogOpen(void) -{ - fatal ("Not implemented"); -} - -void -storeDigestInit(void) -{ - fatal ("Not implemented"); -} - -void -storeRebuildStart(void) -{ - fatal ("Not implemented"); -} - -#include "Store.h" -const char * -storeEntryFlags(const StoreEntry *) -{ - fatal ("Not implemented"); - return NULL; -} - -void -storeReplSetup(void) -{ - fatal ("Not implemented"); -} - -bool -store_client::memReaderHasLowerOffset(int64_t anOffset) const -{ - fatal ("Not implemented"); - return false; -} - -void -store_client::dumpStats(MemBuf * output, int clientNumber) const -{ - fatal ("Not implemented"); -} - -int -store_client::getType() const -{ - return type; -} - +void storeLogOpen(void) STUB +void storeDigestInit(void) STUB +void storeRebuildStart(void) STUB +const char *storeEntryFlags(const StoreEntry *) STUB_RETVAL(NULL) +void storeReplSetup(void) STUB +bool store_client::memReaderHasLowerOffset(int64_t anOffset) const STUB_RETVAL(false) +void store_client::dumpStats(MemBuf * output, int clientNumber) const STUB +int store_client::getType() const STUB_RETVAL(0) === modified file 'src/tests/stub_store_swapout.cc' --- src/tests/stub_store_swapout.cc 2011-05-24 22:26:21 +0000 +++ src/tests/stub_store_swapout.cc 2012-01-07 10:15:40 +0000 @@ -1,65 +1,15 @@ -/* - * $Id$ - * - * DEBUG: section 84 Helper process maintenance - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "squid.h" - -/* wrong stub file... */ -void -storeUnlink(StoreEntry * e) -{ - fatal ("Not implemented"); -} - +#include "config.h" #include "StoreMeta.h" -char * -storeSwapMetaPack(tlv * tlv_list, int *length) -{ - fatal ("Not implemented"); - return NULL; -} - -tlv * -storeSwapMetaBuild(StoreEntry * e) -{ - fatal ("Not implemented"); - return NULL; -} - -void -storeSwapTLVFree(tlv * n) -{ - fatal ("Not implemented"); -} - +#define STUB_API "store_swapout.cc" +#include "tests/STUB.h" + +#include + +/* XXX: wrong stub file... */ +void storeUnlink(StoreEntry * e) STUB + + +char *storeSwapMetaPack(tlv * tlv_list, int *length) STUB_RETVAL(NULL) +tlv *storeSwapMetaBuild(StoreEntry * e) STUB_RETVAL(NULL) +void storeSwapTLVFree(tlv * n) STUB === modified file 'src/tests/stub_tools.cc' --- src/tests/stub_tools.cc 2011-10-14 15:53:02 +0000 +++ src/tests/stub_tools.cc 2012-01-07 10:15:40 +0000 @@ -1,77 +1,41 @@ -/* - * $Id$ - * - * AUTHOR: Robert Collins - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - #include "config.h" +// tool functions still defined in protos.h - TODO extract #include "protos.h" -int -percent(int a, int b) -{ - return b ? ((int) (100.0 * a / b + 0.5)) : 0; -} - -/* MinGW needs also a stub of death() */ -void -death(int sig) -{ - fatal("tools.cc required"); -} - -void* -xmemset(void* dst, int val, size_t sz) -{ - assert(dst); - return memset(dst, val, sz); -} - -bool -IamWorkerProcess() -{ - fprintf(stderr, "Not implemented"); - return true; -} - -bool -IamDiskProcess() -{ - fprintf(stderr, "Not implemented"); - return false; -} +#define STUB_API "tools.cc" +#include "tests/STUB.h" + +int DebugSignal = -1; +void releaseServerSockets(void) STUB +char * dead_msg(void) STUB_RETVAL(NULL) +void mail_warranty(void) STUB +void dumpMallocStats(void) STUB +void squid_getrusage(struct rusage *r) STUB +double rusage_cputime(struct rusage *r) STUB_RETVAL(0) +int rusage_maxrss(struct rusage *r) STUB_RETVAL(0) +int rusage_pagefaults(struct rusage *r) STUB_RETVAL(0) +void PrintRusage(void) STUB +void death(int sig) STUB +void BroadcastSignalIfAny(int& sig) STUB +void sigusr2_handle(int sig) STUB +void fatal(const char *message) STUB +void fatal_common(const char *message) STUB +void fatalf(const char *fmt,...) STUB +void fatalvf(const char *fmt, va_list args) STUB +void fatal_dump(const char *message) STUB +void debug_trap(const char *message) STUB +void sig_child(int sig) STUB +void sig_shutdown(int sig) STUB +const char * getMyHostname(void) STUB_RETVAL(NULL) +const char * uniqueHostname(void) STUB_RETVAL(NULL) +void leave_suid(void) STUB +void enter_suid(void) STUB +void no_suid(void) STUB bool IamMasterProcess() { - fprintf(stderr, "Not implemented"); + //std::cerr << STUB_API << " IamMasterProcess() Not implemented\n"; // Since most tests run as a single process, this is the best default. // TODO: If some test case uses multiple processes and cares about // its role, we may need to parameterize or remove this stub. @@ -79,27 +43,55 @@ } bool +IamWorkerProcess() +{ + //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n"; + return true; +} + +bool +IamDiskProcess() +{ + std::cerr << STUB_API << " IamDiskProcess() Not implemented\n"; + return false; +} + +bool InDaemonMode() { - fprintf(stderr, "Not implemented"); + std::cerr << STUB_API << " InDaemonMode() Not implemented\n"; return false; } bool UsingSmp() { - fprintf(stderr, "Not implemented"); + std::cerr << STUB_API << " UsingSnmp() Not implemented\n"; return false; } -void -logsFlush(void) -{ - fatal("tools.cc required"); -} +bool IamCoordinatorProcess() STUB_RETVAL(false) +bool IamPrimaryProcess() STUB_RETVAL(false) +int NumberOfKids() STUB_RETVAL(0) +String ProcessRoles() STUB_RETVAL(String()) +void writePidFile(void) STUB +pid_t readPidFile(void) STUB_RETVAL(0) +void setMaxFD(void) STUB +void setSystemLimits(void) STUB +void squid_signal(int sig, SIGHDLR * func, int flags) STUB +void logsFlush(void) STUB +void kb_incr(kb_t * k, size_t v) STUB +void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm) STUB +void parseEtcHosts(void) STUB +int getMyPort(void) STUB_RETVAL(0) +void setUmask(mode_t mask) STUB +void strwordquote(MemBuf * mb, const char *str) STUB +void keepCapabilities(void) STUB +void restoreCapabilities(int keep) STUB -void -no_suid(void) +void* +xmemset(void* dst, int val, size_t sz) { - fatal("tools.cc required"); + assert(dst); + return memset(dst, val, sz); } === modified file 'src/tests/stub_wordlist.cc' --- src/tests/stub_wordlist.cc 2011-09-22 02:14:15 +0000 +++ src/tests/stub_wordlist.cc 2012-01-07 10:15:40 +0000 @@ -4,8 +4,8 @@ #define STUB_API "wordlist.cc" #include "tests/STUB.h" -const char *wordlistAdd(wordlist **, const char *) STUB_RETVAL(NULL); -void wordlistAddWl(wordlist **, wordlist *) STUB; -void wordlistJoin(wordlist **, wordlist **) STUB; -wordlist *wordlistDup(const wordlist *) STUB_RETVAL(NULL); -void wordlistDestroy(wordlist **) STUB; +const char *wordlistAdd(wordlist **, const char *) STUB_RETVAL(NULL) +void wordlistAddWl(wordlist **, wordlist *) STUB +void wordlistJoin(wordlist **, wordlist **) STUB +wordlist *wordlistDup(const wordlist *) STUB_RETVAL(NULL) +void wordlistDestroy(wordlist **) STUB === modified file 'src/tests/testStore.cc' --- src/tests/testStore.cc 2011-10-14 16:21:48 +0000 +++ src/tests/testStore.cc 2012-01-07 10:15:40 +0000 @@ -23,7 +23,6 @@ {} void - TestStore::init() {} === modified file 'src/tests/testStore.h' --- src/tests/testStore.h 2011-10-14 16:21:48 +0000 +++ src/tests/testStore.h 2012-01-07 10:15:40 +0000 @@ -45,11 +45,9 @@ virtual int callback(); - virtual StoreEntry* get - (const cache_key*); + virtual StoreEntry* get(const cache_key*); - virtual void get - (String, void (*)(StoreEntry*, void*), void*); + virtual void get(String, void (*)(StoreEntry*, void*), void*); virtual void init(); === modified file 'test-suite/Makefile.am' --- test-suite/Makefile.am 2010-11-01 05:44:28 +0000 +++ test-suite/Makefile.am 2012-01-07 10:15:40 +0000 @@ -53,12 +53,15 @@ tcp_banger2_LDADD = $(top_builddir)/lib/libmiscutil.la -DEBUG_SOURCE = test_tools.cc stub_debug.cc +DEBUG_SOURCE = test_tools.cc stub_debug.cc stub_tools.cc stub_debug.cc: $(top_srcdir)/src/tests/stub_debug.cc cp $(top_srcdir)/src/tests/stub_debug.cc . -CLEANFILES += stub_debug.cc +stub_tools.cc: $(top_srcdir)/src/tests/stub_tools.cc + cp $(top_srcdir)/src/tests/stub_tools.cc . + +CLEANFILES += stub_debug.cc stub_tools.cc ## XXX: somewhat broken. Its meant to test our debugs() implementation. ## but it has never been linked to the actual src/debug.cc implementation !! @@ -73,8 +76,10 @@ mem_node_test_LDADD = $(top_builddir)/src/mem_node.o $(LDADD) mem_hdr_test_SOURCES = mem_hdr_test.cc $(DEBUG_SOURCE) -mem_hdr_test_LDADD = $(top_builddir)/src/stmem.o \ - $(top_builddir)/src/mem_node.o $(LDADD) +mem_hdr_test_LDADD = \ + $(top_builddir)/src/stmem.o \ + $(top_builddir)/src/mem_node.o \ + $(LDADD) MemPoolTest_SOURCES = MemPoolTest.cc === modified file 'test-suite/test_tools.cc' --- test-suite/test_tools.cc 2010-11-01 05:44:28 +0000 +++ test-suite/test_tools.cc 2012-01-07 10:15:40 +0000 @@ -14,45 +14,6 @@ exit (1); } -void -fatal_dump(const char *message) -{ - fprintf(stderr, "Fatal: %s",message); - exit (1); -} - -void -fatal(const char *message) -{ - fprintf(stderr, "Fatal: %s", message); - exit (1); -} - -/* used by fatalf */ -static void -fatalvf(const char *fmt, va_list args) -{ - static char fatal_str[BUFSIZ]; - vsnprintf(fatal_str, sizeof(fatal_str), fmt, args); - fatal(fatal_str); -} - -/* printf-style interface for fatal */ -void -fatalf(const char *fmt,...) -{ - va_list args; - va_start(args, fmt); - fatalvf(fmt, args); - va_end(args); -} - -void -debug_trap(const char *message) -{ - fatal(message); -} - dlink_node * dlinkNodeNew() {