From: Amos Jeffries Date: Thu, 3 Mar 2011 06:00:02 +0000 (+1300) Subject: Add some stubs and undo some problematic make optimizations X-Git-Tag: take08~55^2~124^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96e9c799d793b401a9aee746e42294e8d8c2805d;p=thirdparty%2Fsquid.git Add some stubs and undo some problematic make optimizations --- diff --git a/src/Makefile.am b/src/Makefile.am index 1a5eb4993b..a85b43551a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1295,16 +1295,20 @@ tests_testCacheManager_DEPENDENCIES = \ tests_testDiskIO_SOURCES = \ $(SWAP_TEST_SOURCES) \ + ipc.cc \ tests/testDiskIO.cc \ tests/testDiskIO.h \ tests/testMain.cc \ tests/stub_cache_manager.cc \ + tests/stub_client_db.cc \ tests/stub_HelperChildConfig.cc \ + tests/stub_pconn.cc \ tests/stub_Port.cc \ tests/stub_TypedMsgHdr.cc \ tests/stub_UdsOp.cc nodist_tests_testDiskIO_SOURCES= \ - $(SWAP_TEST_GEN_SOURCES) \ + $(TESTSOURCES) \ + $(DISKIO_GEN_SOURCE) \ SquidMath.cc \ SquidMath.h \ swap_log_op.cc @@ -1312,12 +1316,24 @@ tests_testDiskIO_LDADD = \ SquidConfig.o \ CommCalls.o \ DnsLookupDetails.o \ - $(COMMON_LIBS) \ + auth/libacls.la \ + ident/libident.la \ + acl/libacls.la \ + eui/libeui.la \ + acl/libstate.la \ + auth/libauth.la \ + libsquid.la \ + fs/libfs.la \ + ipc/libipc.la \ + mgr/libmgr.la \ $(REPL_OBJS) \ $(DISK_LIBS) \ $(DISK_OS_LIBS) \ acl/libapi.la \ comm/libcomm.la \ + ip/libip.la \ + ipc/libipc.la \ + base/libbase.la \ $(top_builddir)/lib/libmisccontainers.la \ $(top_builddir)/lib/libmiscencoding.la \ $(top_builddir)/lib/libmiscutil.la \ @@ -2165,10 +2181,6 @@ SWAP_TEST_SOURCES = \ $(UNLINKDSOURCE) \ $(WIN32_SOURCE) -SWAP_TEST_GEN_SOURCES = \ - $(TESTSOURCES) \ - $(DISKIO_GEN_SOURCE) - SWAP_TEST_DS =\ repl_modules.o \ $(DISK_LIBS) \ @@ -2181,24 +2193,38 @@ tests_testUfs_SOURCES = \ tests/testMain.cc \ tests/testUfs.h \ tests/stub_cache_manager.cc \ + tests/stub_comm.cc \ tests/stub_HelperChildConfig.cc \ + tests/stub_pconn.cc \ tests/stub_Port.cc \ tests/stub_TypedMsgHdr.cc \ tests/stub_UdsOp.cc \ $(SWAP_TEST_SOURCES) nodist_tests_testUfs_SOURCES = \ - $(SWAP_TEST_GEN_SOURCES) \ + $(TESTSOURCES) \ + $(DISKIO_GEN_SOURCE) \ SquidMath.cc \ SquidMath.h \ swap_log_op.cc tests_testUfs_LDADD = \ CommCalls.o \ DnsLookupDetails.o \ - $(COMMON_LIBS) \ $(REPL_OBJS) \ $(DISK_LIBS) \ $(DISK_OS_LIBS) \ + auth/libacls.la \ + ident/libident.la \ + acl/libacls.la \ + eui/libeui.la \ + acl/libstate.la \ + auth/libauth.la \ acl/libapi.la \ + libsquid.la \ + base/libbase.la \ + ip/libip.la \ + fs/libfs.la \ + ipc/libipc.la \ + mgr/libmgr.la \ $(top_builddir)/lib/libmisccontainers.la \ $(top_builddir)/lib/libmiscencoding.la \ $(top_builddir)/lib/libmiscutil.la \ @@ -2223,7 +2249,8 @@ nodist_tests_testCoss_SOURCES = \ swap_log_op.cc \ SquidMath.cc \ SquidMath.h \ - $(SWAP_TEST_GEN_SOURCES) + $(TESTSOURCES) \ + $(DISKIO_GEN_SOURCE) tests_testCoss_LDADD = \ libsquid.la \ $(REGEXLIB) \ @@ -2249,7 +2276,8 @@ tests_testNull_SOURCES = \ tests/testNull.h \ $(SWAP_TEST_SOURCES) nodist_tests_testNull_SOURCES = \ - $(SWAP_TEST_GEN_SOURCES) + $(TESTSOURCES) \ + $(DISKIO_GEN_SOURCE) tests_testNull_LDADD = \ $(REGEXLIB) \ $(COMMON_LIBS) \ diff --git a/src/tests/stub_client_db.cc b/src/tests/stub_client_db.cc new file mode 100644 index 0000000000..7c74942032 --- /dev/null +++ b/src/tests/stub_client_db.cc @@ -0,0 +1,68 @@ +#include "config.h" +/* 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, protocol_t, 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; +} + +#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; +} +#endif + +void +clientOpenListenSockets(void) +{ + fatal("client_db.cc required"); +} + +void +clientHttpConnectionsClose(void) +{ + fatal("client_db.cc required"); +} diff --git a/src/tests/stub_pconn.cc b/src/tests/stub_pconn.cc new file mode 100644 index 0000000000..6d3fe3917d --- /dev/null +++ b/src/tests/stub_pconn.cc @@ -0,0 +1,125 @@ +/* + * 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::dumpHist(StoreEntry *e) const +{ + fatal("pconn.cc required"); +} + +void +PconnPool::dumpHash(StoreEntry *e) const +{ + fatal("pconn.cc required"); +} + +void +PconnPool::unlinkList(IdleConnList *list) const +{ + 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"); +} diff --git a/src/tests/stub_tools.cc b/src/tests/stub_tools.cc index 95537ed940..875f634829 100644 --- a/src/tests/stub_tools.cc +++ b/src/tests/stub_tools.cc @@ -44,8 +44,7 @@ percent(int a, int b) void death(int sig) { - fprintf(stderr, "Not implemented"); - exit(1); + fatal("tools.cc required"); } void* @@ -54,3 +53,15 @@ xmemset(void* dst, int val, size_t sz) assert(dst); return memset(dst, val, sz); } + +void +logsFlush(void) +{ + fatal("tools.cc required"); +} + +void +no_suid(void) +{ + fatal("tools.cc required"); +}