]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: update most of the existing stub files to use the STUB.h framework
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jan 2012 10:15:40 +0000 (03:15 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jan 2012 10:15:40 +0000 (03:15 -0700)
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.

32 files changed:
src/Makefile.am
src/ip/Makefile.am
src/tests/STUB.h
src/tests/stub_CommIO.cc
src/tests/stub_HttpReply.cc
src/tests/stub_HttpRequest.cc
src/tests/stub_MemObject.cc
src/tests/stub_UdsOp.cc
src/tests/stub_access_log.cc
src/tests/stub_cache_cf.cc
src/tests/stub_cache_manager.cc
src/tests/stub_client_db.cc
src/tests/stub_comm.cc
src/tests/stub_errorpage.cc
src/tests/stub_fd.cc
src/tests/stub_helper.cc
src/tests/stub_http.cc
src/tests/stub_icp.cc
src/tests/stub_internal.cc
src/tests/stub_ipc.cc
src/tests/stub_mem_node.cc
src/tests/stub_mime.cc
src/tests/stub_pconn.cc
src/tests/stub_stmem.cc
src/tests/stub_store_client.cc
src/tests/stub_store_swapout.cc
src/tests/stub_tools.cc
src/tests/stub_wordlist.cc
src/tests/testStore.cc
src/tests/testStore.h
test-suite/Makefile.am
test-suite/test_tools.cc

index 9e8e299ccc109c3a970b74e8c0c02590c119fdcf..0a2b397eb2298dd1cd3759e73ecb7acc10806bc5 100644 (file)
@@ -1091,6 +1091,7 @@ tests_testHttpReply_SOURCES=\
        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_testHttpParser_SOURCES = \
        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 @@ tests_testStore_SOURCES= \
        mem.cc \
        mem_node.cc \
        MemBuf.cc \
+       MemObject.cc \
        Packer.cc \
        Parsing.cc \
        RemovalPolicy.cc \
@@ -2470,7 +2473,6 @@ tests_testStore_SOURCES= \
        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_testString_SOURCES = \
        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_testRock_SOURCES = \
        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 @@ tests_testRock_LDADD = \
        $(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_testConfigParser_SOURCES = \
        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 = \
index 17b8823e191466d95fae5ede50e2b7ea72cda00b..52dcd010283414eb4388c387969d22ed715dacda 100644 (file)
@@ -24,8 +24,8 @@ testIpAddress_SOURCES= \
        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) \
index c669c765ce4008d8669cf82e3bc412f6919400c3..67c433b9c707df1aa477906de86764332fd75d69 100644 (file)
@@ -1,5 +1,4 @@
 #ifndef STUB
-#include "fatal.h"
 
 /** \group STUB
  *
  *   #define STUB_API "foo/libexample.la"
  *   #include "tests/STUB.h"
  */
+#include <iostream>
+
+// 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: "<<STUB_API<<" "<<__FUNCTION__<<" (not implemented).\n"; }
 
 /** macro to stub a function with return value.
  *  Aborts unit tests requiring its definition with a message about the missing linkage
  */
-#define STUB_RETVAL(x) { fatal(STUB_API " required"); return x; }
+#define STUB_RETVAL(x) { stub_fatal(STUB_API " required"); return x; }
 
 /** macro to stub a function which returns a reference to dynamic
  *  Aborts unit tests requiring its definition with a message about the missing linkage
  *  This macro uses 'new x' to construct a stack vailable for the reference, may leak.
  *  \param x may be the type to define or a constructor call with parameter values
  */
-#define STUB_RETREF(x) { fatal(STUB_API " required"); return new x; }
+#define STUB_RETREF(x) { stub_fatal(STUB_API " required"); return new x; }
 
 /** macro to stub a function which returns a reference to static
  *  Aborts unit tests requiring its definition with a message about the missing linkage
  *  This macro uses static variable definition to avoid leaks.
  *  \param x  the type name to define
  */
-#define STUB_RETSTATREF(x) { fatal(STUB_API " required"); static x v; return v; }
+#define STUB_RETSTATREF(x) { stub_fatal(STUB_API " required"); static x v; return v; }
 
 #endif /* STUB */
index dfb38ec9543341cc5e6b6a3bb281bfcf925fa49b..ca46e9a5f83971d9b590fad048cd7e4950a60395 100644 (file)
@@ -1,37 +1,16 @@
 #include "squid.h"
 #include "CommIO.h"
 
+#define STUB_API "CommIO.cc"
+#include "tests/STUB.h"
+
 bool CommIO::Initialised = false;
 bool CommIO::DoneSignalled = false;
 int CommIO::DoneFD = -1;
 int CommIO::DoneReadFD = -1;
 
-void
-CommIO::ResetNotifications()
-{
-    fatal("Not Implemented");
-}
-
-void
-CommIO::Initialise()
-{
-    fatal("Not Implemented");
-}
-
-void
-CommIO::NotifyIOClose()
-{
-    fatal("Not Implemented");
-}
-
-void
-CommIO::NULLFDHandler(int, void *)
-{
-    fatal("Not Implemented");
-}
-
-void
-CommIO::FlushPipe()
-{
-    fatal("Not Implemented");
-}
+void CommIO::ResetNotifications() STUB
+void CommIO::Initialise() STUB
+void CommIO::NotifyIOClose() STUB
+void CommIO::NULLFDHandler(int, void *) STUB
+void CommIO::FlushPipe() STUB
index 3bc7b88da9accd7a6d9072d167de1d2863c2eabb..30e7bc67dd12388f393dfbb4ee2ae29b76911789 100644 (file)
-/*
- * $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 "HttpReply.h"
 
-HttpReply::HttpReply() : HttpMsg(hoReply)
-{
-    fatal ("Not implemented.");
-}
-
-HttpReply::~HttpReply()
-{
-    fatal ("Not implemented.");
-}
-
-void
-HttpReply::setHeaders(http_status status, const char *reason,
-                      const char *ctype, int64_t clen, time_t lmt, time_t expires_)
-{
-    fatal ("Not implemented");
-}
+#define STUB_API "HttpReply.cc"
+#include "tests/STUB.h"
 
-void
-HttpReply::packHeadersInto(Packer * p) const
-{
-    fatal ("Not implemented");
-}
-
-void HttpReply::reset()
-{
-    fatal ("Not implemented");
-}
-
-void
-httpBodyPackInto(const HttpBody * body, Packer * p)
-{
-    fatal ("Not implemented");
-}
-
-bool
-HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error)
-{
-    fatal ("Not implemented");
-    return false;
-}
-
-int
-HttpReply::httpMsgParseError()
-{
-    fatal ("Not implemented");
-    return 0;
-}
-
-bool
-HttpReply::expectingBody(const HttpRequestMethod&, int64_t&) const
-{
-    fatal ("Not implemented");
-    return false;
-}
-
-void
-HttpReply::packFirstLineInto(Packer * p, bool) const
-{
-    fatal ("Not implemented");
-}
-
-bool
-HttpReply::parseFirstLine(const char *start, const char *end)
-{
-    fatal ("Not implemented");
-    return false;
-}
-
-void
-HttpReply::hdrCacheInit()
-{
-    fatal ("Not implemented");
-}
-
-HttpReply *
-HttpReply::clone() const
-{
-    fatal("Not implemented");
-    return NULL;
-}
-
-bool
-HttpReply::inheritProperties(const HttpMsg *aMsg)
-{
-    fatal("Not implemented");
-    return false;
-}
-
-int64_t
-HttpReply::bodySize(const HttpRequestMethod&) const
+HttpReply::HttpReply() : HttpMsg(hoReply)
 {
-    fatal("Not implemented");
-    return 0;
-}
+// XXX: required by testStore
+// STUB
+}
+HttpReply::~HttpReply() STUB
+void HttpReply::setHeaders(http_status status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires_) STUB
+void HttpReply::packHeadersInto(Packer * p) const STUB
+void HttpReply::reset() STUB
+void httpBodyPackInto(const HttpBody * body, Packer * p) STUB
+bool HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) STUB_RETVAL(false)
+int HttpReply::httpMsgParseError() STUB_RETVAL(0)
+bool HttpReply::expectingBody(const HttpRequestMethod&, int64_t&) const STUB_RETVAL(false)
+void HttpReply::packFirstLineInto(Packer * p, bool) const STUB
+bool HttpReply::parseFirstLine(const char *start, const char *end) STUB_RETVAL(false)
+void HttpReply::hdrCacheInit() STUB
+HttpReply * HttpReply::clone() const STUB_RETVAL(NULL)
+bool HttpReply::inheritProperties(const HttpMsg *aMsg) STUB_RETVAL(false)
+int64_t HttpReply::bodySize(const HttpRequestMethod&) const STUB_RETVAL(0)
index cc16b0cf764bebd72336f9c4a4403f0d928e00c9..e8d0aed36d90b98fa9c93e085c89781db9646850 100644 (file)
-/*
- * $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 "config.h"
 #include "HttpRequest.h"
 
-
-HttpRequest::HttpRequest() : HttpMsg(hoRequest)
-{
-    fatal("Not implemented");
-}
-
-HttpRequest::HttpRequest(const HttpRequestMethod& method, AnyP::ProtocolType protocol, const char *aUrlpath) : HttpMsg(hoRequest)
-{
-    fatal("Not implemented");
-}
-
-HttpRequest::~HttpRequest()
-{}
-
-void
-HttpRequest::packFirstLineInto(Packer * p, bool full_uri) const
-{
-    fatal("Not implemented");
-}
-
-bool
-HttpRequest::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error)
-{
-    fatal("Not implemented");
-    return false;
-}
-
-void
-HttpRequest::hdrCacheInit()
-{
-    fatal("Not implemented");
-}
-
-void
-HttpRequest::reset()
-{
-    fatal("Not implemented");
-}
-
-bool
-HttpRequest::expectingBody(const HttpRequestMethod& unused, int64_t&) const
-{
-    fatal("Not implemented");
-    return false;
-}
-
-void
-HttpRequest::initHTTP(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aUrlpath)
-{
-    fatal("Not implemented");
-}
-
-bool
-HttpRequest::parseFirstLine(const char *start, const char *end)
-{
-    fatal("Not implemented");
-    return false;
-}
-
-HttpRequest *
-HttpRequest::clone() const
-{
-    fatal("Not implemented");
-    return NULL;
-}
-
-bool
-HttpRequest::inheritProperties(const HttpMsg *aMsg)
-{
-    fatal("Not implemented");
-    return false;
-}
-
-int64_t
-HttpRequest::getRangeOffsetLimit()
-{
-    fatal("Not implemented");
-    return 0;
-}
-
-/*
- * DO NOT MODIFY:
- * arch-tag: dd894aa8-63cc-4543-92d9-1079a18bee11
- */
+#define STUB_API "HttpRequest.cc"
+#include "tests/STUB.h"
+
+HttpRequest::HttpRequest() : HttpMsg(hoRequest) STUB
+HttpRequest::HttpRequest(const HttpRequestMethod& method, AnyP::ProtocolType protocol, const char *aUrlpath) : HttpMsg(hoRequest) STUB
+HttpRequest::~HttpRequest() STUB
+void HttpRequest::packFirstLineInto(Packer * p, bool full_uri) const STUB
+bool HttpRequest::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) STUB_RETVAL(false)
+void HttpRequest::hdrCacheInit() STUB
+void HttpRequest::reset() STUB
+bool HttpRequest::expectingBody(const HttpRequestMethod& unused, int64_t&) const STUB_RETVAL(false)
+void HttpRequest::initHTTP(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aUrlpath) STUB
+bool HttpRequest::parseFirstLine(const char *start, const char *end) STUB_RETVAL(false)
+HttpRequest * HttpRequest::clone() const STUB_RETVAL(NULL)
+bool HttpRequest::inheritProperties(const HttpMsg *aMsg) STUB_RETVAL(false)
+int64_t HttpRequest::getRangeOffsetLimit() STUB_RETVAL(0)
index 6e4c929d042c4b3a1330b7a2cee08ce423e7cc05..5b2d7dff3028bb9ae8d3c3e4574a0ada8f041193 100644 (file)
@@ -1,38 +1,4 @@
-/*
- * $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 "comm/Connection.h"
 #include "MemObject.h"
 #include "HttpReply.h"
 #include "DelayPools.h"
 #endif
 
+#define STUB_API "MemObject.cc"
+#include "tests/STUB.h"
+
 RemovalPolicy * mem_policy = NULL;
 
 int64_t
 MemObject::endOffset() const
 {
+    // XXX: required by testStore
     return data_hdr.endOffset();
 }
 
-void
-MemObject::trimSwappable()
-{
-    fatal ("Not implemented");
-}
-
-void
-MemObject::trimUnSwappable()
-{
-    fatal ("Not implemented");
-}
-
-int64_t
-MemObject::policyLowestOffsetToKeep(bool swap) const
-{
-    fatal ("Not implemented");
-    return -1;
-}
-
-MemObject::MemObject (char const *, char const *)
-{}
-
-HttpReply const *
-MemObject::getReply() const
+void MemObject::trimSwappable() STUB
+void MemObject::trimUnSwappable() STUB
+int64_t MemObject::policyLowestOffsetToKeep(bool swap) const STUB_RETVAL(-1)
+MemObject::MemObject(char const *, char const *) {} // NOP due to Store
+HttpReply const * MemObject::getReply() const
 {
+    // XXX: required by testStore
     return NULL;
 }
-
-void
-MemObject::reset()
-{
-    fatal ("Not implemented");
-}
-
-void
-MemObject::delayRead(DeferredRead const &aRead)
-{
-    fatal ("Not implemented");
-}
-
-bool
-MemObject::readAheadPolicyCanRead() const
-{
-    fatal ("Not implemented");
-    return false;
-}
-
-void
-MemObject::setNoDelay(bool const newValue)
-{
-    fatal ("Not implemented");
-}
-
-MemObject::~MemObject()
-{
-    fatal ("Not implemented");
-}
-
-int
-MemObject::mostBytesWanted(int max) const
-{
-    fatal ("Not implemented");
-    return -1;
-}
-
+void MemObject::reset() STUB
+void MemObject::delayRead(DeferredRead const &aRead) STUB
+bool MemObject::readAheadPolicyCanRead() const STUB_RETVAL(false)
+void MemObject::setNoDelay(bool const newValue) STUB
+MemObject::~MemObject() STUB
+int MemObject::mostBytesWanted(int max) const STUB_RETVAL(-1)
 #if USE_DELAY_POOLS
-DelayId
-MemObject::mostBytesAllowed() const
-{
-    DelayId result;
-    fatal ("Not implemented");
-    return result;
-}
+DelayId MemObject::mostBytesAllowed() const STUB_RETVAL(DelayId())
 #endif
-
-void
-MemObject::unlinkRequest()
-{
-    fatal ("Not implemented");
-}
-
-void
-MemObject::write(StoreIOBuffer writeBuffer, STMCB *callback, void *callbackData)
-{
-    PROF_start(MemObject_write);
-    debugs(19, 6, "memWrite: offset " << writeBuffer.offset << " len " << writeBuffer.length);
-
-    /* the offset is into the content, not the headers */
-    writeBuffer.offset += (_reply ? _reply->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)
index 7e19dd02007c01a9f400d247178388079d22c54b..f78dc820cb4912cd03452d090c88a4bdc562db5c 100644 (file)
@@ -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
index ff80596c8a5bbc19905701295c690612830d2c02..2c8afff80f4f4c76a9024347ca127906386fe5eb 100644 (file)
@@ -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),
index 39b59995a02dae57033f83b53622605b3d870cc0..31a91ca52cbf49ddd94077b184d17cfbddc93062 100644 (file)
 #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 @@ parse_eol(char *volatile *var)
 
     *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 @@ parse_wordlist(wordlist ** list)
     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; }
index 07a7bd211a32ca7e1469ebd8657f3ac499a31e25..b286d67dc95f7ef2239b0f8fa3c8a72e79550be0 100644 (file)
@@ -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;
-}
+#define STUB_API "cache_manager.cc"
+#include "tests/STUB.h"
 
-void
-CacheManager::Start(const Comm::ConnectionPointer &conn, HttpRequest * request, StoreEntry * entry)
-{
-    return;
+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) {}
index c2359e84f23524d85d242c29a1a1b75b3aa7f4c5..9425c9e2ddbb69825e50415acf69f48656ed1816 100644 (file)
@@ -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
index 25b90c364f8aa5992d497bd85984226106942852..5c4747f75e552c6a3b5ead92eeaec43718c4a973 100644 (file)
  *
  */
 
-#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");
-}
+#define STUB_API "comm.cc"
+#include "tests/STUB.h"
 
-void
-comm_read(const Comm::ConnectionPointer &conn, char*, int, AsyncCall::Pointer &callback)
-{
-    fatal ("Not implemented");
-}
+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
index 2c8eb8164f95b43a2dce4d1c267935827996d5ac..831bdf3b16692482d82884571e33f1a5d38a5dec 100644 (file)
@@ -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;
-}
+#define STUB_API "errorpage.cc"
+#include "tests/STUB.h"
 
-/*
- * DO NOT MODIFY:
- * arch-tag: e4c72cfd-0b31-4497-90e6-0e3cda3b92b4
- */
+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)
index bace6c07bfce4f5db178784b12b83a2a2ce9ddf8..85e60a648c84f540900bc6b4de44207171a292d1 100644 (file)
@@ -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");
-}
+#define STUB_API "fd.cc"
+#include "tests/STUB.h"
 
-void
-fd_note(int fd, const char *s)
-{
-    fatal ("Not Implemented");
-}
+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
index b526262bb32aee050238e783a25e1ea0408148ca..f2a8de5a1d3197ca7b79922ef198fb555ed5d4f1 100644 (file)
-/*
- * $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
- */
index 7621c02f39e0ffc5b6f2b462da83ba217d673613..af699054ba16e0b45c7e940dabcf41e06e69d63f 100644 (file)
@@ -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)
index 5f4709fb0facca888a829280ba49d3d668c7631c..0de7f81a96a0b73602191272b8e96ca6bb621891 100644 (file)
@@ -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
index 3656736686a4208d15959773b9aa2b6ca2ce9576..45a9f3124d79b4cf9da6fdd4d5450d49590278be 100644 (file)
@@ -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 "config.h"
+#include "protos.h"
 
-#include "squid.h"
+#define STUB_API "internal.cc"
+#include "tests/STUB.h"
 
-char *
-internalLocalUri(const char *dir, const char *name)
-{
-    fatal ("Not implemented");
-    return NULL;
-}
+char * internalLocalUri(const char *dir, const char *name) STUB_RETVAL(NULL)
index 57b93b7a9f47644cc3a145df9d5a6548f25fb05d..1180582e93e3d33cae43d05992bf826d045a986b 100644 (file)
@@ -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)
index 62f974bde74051626f7720701d4f2934cd193f8d..3c24418051e6ad62a5a2544d9ec651e0129563cc 100644 (file)
@@ -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)
index 96b10a3d362ede85358e1ae023ee25d6ac6c1b8d..d2be1f0af56348080a3c667ebbdd18435e21434e 100644 (file)
@@ -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 "config.h"
+#include "protos.h"
 
-#include "squid.h"
+#define STUB_API "mime.cc"
+#include "tests/STUB.h"
 
-size_t
-headersEnd(const char *mime, size_t l)
-{
-    fatal("Not implemented");
-    return 0;
-}
+size_t headersEnd(const char *mime, size_t l) STUB_RETVAL(0)
index 0affac1bd4c35399818c5f709d3f99fb63f7130c..7446e10ad94182e44659b1305df7edf3bfb1a298 100644 (file)
 /*
  * 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
index 951fbf209a6520bbe424037ecb828b46e4cb9c8d..4ddf12f1622430639f350441ade4a46f3e3dc80d 100644 (file)
@@ -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()
-{}
+#define STUB_API "stmem.cc"
+#include "tests/STUB.h"
 
-size_t
-mem_hdr::size() const
-{
-    fatal ("Not implemented");
-    return 0;
-}
+mem_hdr::mem_hdr() STUB
+mem_hdr::~mem_hdr() STUB
+size_t mem_hdr::size() const STUB_RETVAL(0)
index 90ed8e57cbc37854ed3bac5297f0d57f0ccb5033..c90f04277ca261969f0d9b509c32b5bca6affa7c 100644 (file)
-/*
- * $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
-storeLog(int tag, const StoreEntry * e)
-{
-    /* 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)
+void StoreEntry::invokeHandlers()
 {
-    fatal ("Not implemented");
-}
-
-bool
-store_client::memReaderHasLowerOffset(int64_t anOffset) const
-{
-    fatal ("Not implemented");
-    return false;
+    /* do nothing for tests */
 }
 
 void
-store_client::dumpStats(MemBuf * output, int clientNumber) const
-{
-    fatal ("Not implemented");
-}
-
-int
-store_client::getType() const
+storeLog(int tag, const StoreEntry * e)
 {
-    return type;
+    /* do nothing for tests - we don't need the log */
 }
 
+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)
index b430995cf401b74a878c619af76bcf1cd3078f75..78806fd61511f4053a9c814b915da20f85224442 100644 (file)
@@ -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;
-}
+#define STUB_API "store_swapout.cc"
+#include "tests/STUB.h"
+
+#include <iostream>
 
-tlv *
-storeSwapMetaBuild(StoreEntry * e)
-{
-    fatal ("Not implemented");
-    return NULL;
-}
+/* XXX: wrong stub file... */
+void storeUnlink(StoreEntry * e) STUB
 
-void
-storeSwapTLVFree(tlv * n)
-{
-    fatal ("Not implemented");
-}
 
+char *storeSwapMetaPack(tlv * tlv_list, int *length) STUB_RETVAL(NULL)
+tlv *storeSwapMetaBuild(StoreEntry * e) STUB_RETVAL(NULL)
+void storeSwapTLVFree(tlv * n) STUB
index 27afd55be756c64189cfbac47e516162fe20fb1a..fc9526927ea6d272ab0d445ae067f6657aff5d06 100644 (file)
-/*
- * $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;
-}
+#define STUB_API "tools.cc"
+#include "tests/STUB.h"
 
-/* MinGW needs also a stub of death() */
-void
-death(int sig)
-{
-    fatal("tools.cc required");
-}
+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
 
-void*
-xmemset(void* dst, int val, size_t sz)
+bool
+IamMasterProcess()
 {
-    assert(dst);
-    return memset(dst, val, sz);
+    //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.
+    return true;
 }
 
 bool
 IamWorkerProcess()
 {
-    fprintf(stderr, "Not implemented");
+    //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n";
     return true;
 }
 
 bool
 IamDiskProcess()
 {
-    fprintf(stderr, "Not implemented");
+    std::cerr << STUB_API << " IamDiskProcess() Not implemented\n";
     return false;
 }
 
-bool
-IamMasterProcess()
-{
-    fprintf(stderr, "Not implemented");
-    // 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.
-    return true;
-}
-
 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);
 }
index 434b105f8c0b976c39e5f065ce0cdc48c5f93bbc..3ec920a685a43e821c7b76bd23811c00fc9d2e51 100644 (file)
@@ -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
index 0e80a6192a0e94fe831655ae43d2d56b125336db..0c4989d25a814a669fb015108e6a2955c27aac80 100644 (file)
@@ -23,7 +23,6 @@ TestStore::get(String, void (*)(StoreEntry*, void*), void*)
 {}
 
 void
-
 TestStore::init()
 {}
 
index 32c60330ae60e4d9e6a9e971e656efc99d9016e6..cd09fd0f3b878bf159eabcdece32304d781bf26f 100644 (file)
@@ -45,11 +45,9 @@ public:
 
     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();
 
index cedd9833ef59654fed5bfed5efb032bc6633ca28..e47b659e2c2e2d5ac5dadbca3b0daaacd5f1c51d 100644 (file)
@@ -53,12 +53,15 @@ check_PROGRAMS += debug \
 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_SOURCES = mem_node_test.cc
 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
 
index 1f76733a1a0619faa5db867aa53df1648fa2c4ee..235ab3c796495aa4f00377ca6606fd7342d54996 100644 (file)
@@ -14,45 +14,6 @@ xassert(const char *msg, const char *file, int line)
     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()
 {