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 \
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 \
mem.cc \
mem_node.cc \
MemBuf.cc \
+ MemObject.cc \
Packer.cc \
Parsing.cc \
RemovalPolicy.cc \
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 \
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 = \
tests/stub_store_rebuild.cc \
tests/stub_store_stats.cc \
tests/stub_tools.cc \
- tests/stub_UdsOp.cc \
time.cc \
url.cc \
URLScheme.cc \
$(SSLLIB) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
-tests_testRock_LDFLAGS = $(LIBADD_DL)
+tests_testRock_LDFLAGS = $(INCLUDES) $(LIBADD_DL)
tests_testRock_DEPENDENCIES = \
$(SWAP_TEST_DS)
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 = \
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) \
#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 */
#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
-/*
- * $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)
-/*
- * $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)
-/*
- * $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)
#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
-/*
- * $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),
#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);
*var = xstrdup((char *) token);
}
+#endif
-void
-parse_wordlist(wordlist ** list)
+void parse_wordlist(wordlist ** list) STUB
+#if 0
{
char *token;
char *t = strtok(NULL, "");
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; }
-/*
- * 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) {}
/* 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
*
*/
-#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
-/*
- * $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)
-/*
- * $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
-/*
- * $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
- */
-/*
- * $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)
#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
-/*
- * $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)
// 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)
-/*
- * $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)
-/*
- * $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)
/*
* 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
-/*
- * $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)
-/*
- * $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)
-/*
- * $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
-/*
- * $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);
}
#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
{}
void
-
TestStore::init()
{}
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();
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 !!
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
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()
{