]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix make check and make distcheck.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Tue, 21 Jun 2011 23:44:03 +0000 (03:44 +0400)
committerDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Tue, 21 Jun 2011 23:44:03 +0000 (03:44 +0400)
Mostly makefile changes.  New stub code added and some unneeded
stub code removed.  Fixed for UFS and COSS tests related to
object destruction order.

18 files changed:
src/Makefile.am
src/ipc/Queue.h
src/tests/TestSwapDir.cc
src/tests/TestSwapDir.h
src/tests/stub_HttpReply.cc
src/tests/stub_HttpRequest.cc
src/tests/stub_MemObject.cc
src/tests/stub_MemStore.cc [new file with mode: 0644]
src/tests/stub_Port.cc
src/tests/stub_TypedMsgHdr.cc [deleted file]
src/tests/stub_cache_cf.cc
src/tests/stub_store.cc
src/tests/stub_store_rebuild.cc
src/tests/stub_tools.cc
src/tests/testCoss.cc
src/tests/testStore.cc
src/tests/testStore.h
src/tests/testUfs.cc

index 38693cf1caeeea344a59290f4c892dc52abced2d..c7e2da4b7170d0cdb180cdbb8310387e8943933c 100644 (file)
@@ -1048,6 +1048,7 @@ tests_testHttpReply_SOURCES=\
        SquidString.h \
        SquidTime.h \
        String.cc \
+       tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_debug.cc \
        tests/stub_HelperChildConfig.cc \
@@ -1056,7 +1057,8 @@ tests_testHttpReply_SOURCES=\
        tests/testHttpReply.cc \
        tests/testHttpReply.h \
        tests/testMain.cc \
-       time.cc
+       time.cc \
+       wordlist.cc
 nodist_tests_testHttpReply_SOURCES=\
        $(TESTSOURCES)
 tests_testHttpReply_LDFLAGS = $(LIBADD_DL)
@@ -1148,10 +1150,12 @@ tests_testACLMaxUserIP_SOURCES= \
        tests/stub_fd.cc \
        tests/stub_HttpRequest.cc \
        tests/stub_MemObject.cc \
+       tests/stub_MemStore.cc \
        tests/stub_mime.cc \
        tests/stub_store.cc \
        tests/stub_store_rebuild.cc \
        tests/stub_store_swapout.cc \
+       tests/stub_tools.cc \
        tests/stub_cache_manager.cc \
        tests/testACLMaxUserIP.cc \
        tests/testACLMaxUserIP.h \
@@ -1182,6 +1186,7 @@ tests_testACLMaxUserIP_LDADD= \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
+       $(DISK_OS_LIBS) \
        $(REGEXLIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SSLLIB) \
@@ -1363,6 +1368,7 @@ tests_testCacheManager_LDADD = \
        icmp/libicmp.la icmp/libicmp-core.la \
        log/liblog.la \
        $(REPL_OBJS) \
+       $(DISK_OS_LIBS) \
        $(ADAPTATION_LIBS) \
        $(ESI_LIBS) \
        $(SSL_LIBS) \
@@ -1452,12 +1458,12 @@ tests_testDiskIO_SOURCES = \
        tests/stub_HttpRequest.cc \
        tests/stub_http.cc \
        tests/stub_internal.cc \
+       tests/stub_MemStore.cc \
        tests/stub_mime.cc \
        tests/stub_Port.cc \
        tests/stub_store_client.cc \
        tests/stub_store_rebuild.cc \
        tests/stub_tools.cc \
-       tests/stub_TypedMsgHdr.cc \
        tests/stub_UdsOp.cc \
        tests/testDiskIO.cc \
        tests/testDiskIO.h \
@@ -1487,7 +1493,6 @@ tests_testDiskIO_LDADD = \
        eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
-       base/libbase.la \
        libsquid.la \
        ip/libip.la \
        fs/libfs.la \
@@ -1496,6 +1501,8 @@ tests_testDiskIO_LDADD = \
        $(DISK_OS_LIBS) \
        acl/libapi.la \
        mgr/libmgr.la \
+       ipc/libipc.la \
+       base/libbase.la \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
@@ -1639,7 +1646,7 @@ tests_testEvent_SOURCES = \
        time.cc \
        tools.cc \
        tunnel.cc \
-       SwapDir.cc MemStore.cc \
+       MemStore.cc \
        url.cc \
        URLScheme.cc \
        urn.cc \
@@ -1675,6 +1682,7 @@ tests_testEvent_LDADD = \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
+       $(DISK_OS_LIBS) \
        $(REGEXLIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
@@ -1814,7 +1822,7 @@ tests_testEventLoop_SOURCES = \
        time.cc \
        tools.cc \
        tunnel.cc \
-       SwapDir.cc MemStore.cc \
+       MemStore.cc \
        url.cc \
        URLScheme.cc \
        urn.cc \
@@ -1850,6 +1858,7 @@ tests_testEventLoop_LDADD = \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
+       $(DISK_OS_LIBS) \
        $(REGEXLIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
@@ -1981,6 +1990,7 @@ tests_test_http_range_SOURCES = \
        tests/test_http_range.cc \
        tests/stub_ipc_Forwarder.cc \
        tests/stub_main_cc.cc \
+       tests/stub_MemStore.cc \
        time.cc \
        tools.cc \
        tunnel.cc \
@@ -2193,6 +2203,7 @@ tests_testHttpRequest_LDADD = \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
+       $(DISK_OS_LIBS) \
        $(REGEXLIB) \
        $(SQUID_CPPUNIT_LIBS) \
        $(SQUID_CPPUNIT_LA) \
@@ -2274,13 +2285,13 @@ tests_testStore_SOURCES= \
        tests/stub_HttpReply.cc \
        tests/stub_HttpRequest.cc \
        tests/stub_MemObject.cc \
+       tests/stub_MemStore.cc \
        tests/stub_mime.cc \
        tests/stub_Port.cc \
        tests/stub_store_client.cc \
        tests/stub_store_rebuild.cc \
        tests/stub_store_swapout.cc \
        tests/stub_tools.cc \
-       tests/stub_TypedMsgHdr.cc \
        tests/stub_UdsOp.cc \
        tests/testMain.cc \
        tests/testStore.cc \
@@ -2318,8 +2329,8 @@ tests_testStore_LDADD= \
        libsquid.la \
        ip/libip.la \
        fs/libfs.la \
-       ipc/libipc.la \
        mgr/libmgr.la \
+       ipc/libipc.la \
        anyp/libanyp.la \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
@@ -2341,14 +2352,17 @@ tests_testStore_DEPENDENCIES = \
 tests_testString_SOURCES = \
        ClientInfo.h \
        mem.cc \
+       MemBuf.cc \
        String.cc \
        tests/testMain.cc \
        tests/testString.cc \
        tests/testString.h \
+       tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_debug.cc \
        tests/stub_HelperChildConfig.cc \
-       time.cc
+       time.cc \
+       wordlist.cc
 nodist_tests_testString_SOURCES = \
        $(TESTSOURCES)
 tests_testString_LDADD = \
@@ -2390,8 +2404,8 @@ tests_testUfs_SOURCES = \
        tests/testUfs.h \
        tests/stub_cache_manager.cc \
        tests/stub_HelperChildConfig.cc \
+       tests/stub_MemStore.cc \
        tests/stub_Port.cc \
-       tests/stub_TypedMsgHdr.cc \
        tests/stub_UdsOp.cc \
        tests/stub_internal.cc \
        tests/stub_CommIO.cc \
@@ -2490,16 +2504,16 @@ tests_testUfs_LDADD = \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
-       base/libbase.la \
        libsquid.la \
        ip/libip.la \
        fs/libfs.la \
-       ipc/libipc.la \
        mgr/libmgr.la \
        $(REPL_OBJS) \
        $(DISK_LIBS) \
        $(DISK_OS_LIBS) \
        acl/libapi.la \
+       ipc/libipc.la \
+       base/libbase.la \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
@@ -2513,26 +2527,92 @@ tests_testUfs_DEPENDENCIES = \
        $(SWAP_TEST_DS)
 
 tests_testRock_SOURCES = \
+       cbdata.cc \
+       ConfigOption.cc \
+       ConfigParser.cc \
+       disk.cc \
+       ETag.cc \
+       event.cc \
+       fd.cc \
+       HttpHdrCc.cc \
+       HttpHdrContRange.cc \
+       HttpHdrRange.cc \
+       HttpHdrSc.cc \
+       HttpHdrScTarget.cc \
+       HttpHeader.cc \
+       HttpHeaderTools.cc \
+       HttpMsg.cc \
+       HttpRequestMethod.cc \
+       int.cc \
+       mem.cc \
+       MemBuf.cc \
+       MemObject.cc \
+       mem_node.cc \
+       Packer.cc \
+       Parsing.cc \
+       StatHist.cc \
+       stmem.cc \
+       store.cc \
+       StoreIOState.cc \
+       StoreMeta.cc \
+       StoreMetaMD5.cc \
+       StoreMetaSTD.cc \
+       StoreMetaSTDLFS.cc \
+       StoreMetaURL.cc \
+       StoreMetaUnpacker.cc \
+       StoreMetaVary.cc \
+       store_dir.cc \
+       store_io.cc \
+       store_key_md5.cc \
+       store_swapmeta.cc \
+       store_swapout.cc \
+       String.cc \
+       SwapDir.cc \
        tests/testRock.cc \
        tests/testMain.cc \
        tests/testRock.h \
+       tests/stub_access_log.cc \
+       tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
+       tests/stub_comm.cc \
+       tests/stub_CommIO.cc \
+       tests/stub_debug.cc \
+       tests/stub_errorpage.cc \
        tests/stub_HelperChildConfig.cc \
+       tests/stub_http.cc \
+       tests/stub_HttpReply.cc \
+       tests/stub_HttpRequest.cc \
+       tests/stub_MemStore.cc \
+       tests/stub_mime.cc \
        tests/stub_Port.cc \
-       tests/stub_TypedMsgHdr.cc \
+       tests/stub_store_client.cc \
+       tests/stub_tools.cc \
        tests/stub_UdsOp.cc \
-       $(SWAP_TEST_SOURCES)
+       time.cc \
+       url.cc \
+       URLScheme.cc \
+       wordlist.cc
 nodist_tests_testRock_SOURCES = \
        swap_log_op.cc \
-       $(SWAP_TEST_GEN_SOURCES) \
        SquidMath.cc \
-       SquidMath.h
+       SquidMath.h \
+       $(TESTSOURCES)
 tests_testRock_LDADD = \
+       anyp/libanyp.la \
+       libsquid.la \
+       ip/libip.la \
+       $(AUTH_LIBS) \
        $(COMMON_LIBS) \
         $(REPL_OBJS) \
         $(DISK_LIBS) \
         $(DISK_OS_LIBS) \
+       acl/libacls.la \
         acl/libapi.la \
+       acl/libstate.la \
+       eui/libeui.la \
+       mgr/libmgr.la \
+       ipc/libipc.la \
+       base/libbase.la \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
@@ -2599,7 +2679,6 @@ tests_testCoss_SOURCES = \
        cbdata.cc \
        String.cc \
        tests/stub_comm.cc \
-       tests/stub_debug.cc \
        tests/stub_client_side_request.cc \
        tests/stub_http.cc \
        mem_node.cc \
@@ -2623,8 +2702,11 @@ tests_testCoss_SOURCES = \
        tests/stub_HttpRequest.cc \
        tests/stub_access_log.cc \
        refresh.cc \
+       tests/stub_MemStore.cc \
+       tests/stub_Port.cc \
        tests/stub_store_client.cc \
        tests/stub_tools.cc \
+       tests/stub_UdsOp.cc \
        tests/testStoreSupport.cc \
        tests/testStoreSupport.h \
        time.cc \
@@ -2639,6 +2721,7 @@ nodist_tests_testCoss_SOURCES = \
        $(TESTSOURCES) \
        $(DISKIO_GEN_SOURCE)
 tests_testCoss_LDADD = \
+       anyp/libanyp.la \
        libsquid.la \
        $(REGEXLIB) \
        $(AUTH_ACL_LIBS) \
@@ -2648,16 +2731,16 @@ tests_testCoss_LDADD = \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
-       base/libbase.la \
        libsquid.la \
        ip/libip.la \
        fs/libfs.la \
-       ipc/libipc.la \
        mgr/libmgr.la \
        $(REPL_OBJS) \
        $(DISK_LIBS) \
        $(DISK_OS_LIBS) \
        acl/libapi.la \
+       ipc/libipc.la \
+       base/libbase.la \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
@@ -2946,6 +3029,7 @@ tests_testURL_LDADD = \
        icmp/libicmp.la icmp/libicmp-core.la \
        comm/libcomm.la \
        log/liblog.la \
+       $(DISK_OS_LIBS) \
        $(REGEXLIB) \
        $(REPL_OBJS) \
        $(ADAPTATION_LIBS) \
index f87259c06483000476501c7e0c8465786d304962..7d5fdf2086b036bf8c03f6c0dd0feb6fa06514b3 100644 (file)
@@ -7,6 +7,7 @@
 #define SQUID_IPC_QUEUE_H
 
 #include "Array.h"
+#include "Debug.h"
 #include "base/InstanceId.h"
 #include "ipc/AtomicWord.h"
 #include "ipc/mem/Pointer.h"
index 85b3fdc1a3980ee6a2febe60c823ebf6ba7ef431..0394a8ca41d67ad9cdcdc608694c0d24be209a31 100644 (file)
@@ -9,6 +9,18 @@ TestSwapDir::maxSize() const
     return 3;
 }
 
+uint64_t
+TestSwapDir::currentSize() const
+{
+    return 2;
+}
+
+uint64_t
+TestSwapDir::currentCount() const
+{
+    return 2;
+}
+
 void
 TestSwapDir::stat(StoreEntry &) const
 {
index 35b049c41905816f534bfa60af5f9a4c2f98f31c..0908d1d336745e0640ef089471f4c872ff845d93 100644 (file)
@@ -13,7 +13,10 @@ public:
     bool statsCalled;
 
     virtual uint64_t maxSize() const;
+    virtual uint64_t currentSize() const;
+    virtual uint64_t currentCount() const;
     virtual void stat(StoreEntry &) const; /* output stats to the provided store entry */
+    virtual void swappedOut(const StoreEntry &e) {}
 
     virtual void reconfigure(int, char*);
     virtual void init();
index 87a048ffb652b1aa3ecc3a4a6d311a107deef264..3bc7b88da9accd7a6d9072d167de1d2863c2eabb 100644 (file)
@@ -122,3 +122,10 @@ HttpReply::inheritProperties(const HttpMsg *aMsg)
     fatal("Not implemented");
     return false;
 }
+
+int64_t
+HttpReply::bodySize(const HttpRequestMethod&) const
+{
+    fatal("Not implemented");
+    return 0;
+}
index 51b97f7805b77598d508f6381b63009f1957e0bd..cc16b0cf764bebd72336f9c4a4403f0d928e00c9 100644 (file)
@@ -108,6 +108,13 @@ HttpRequest::inheritProperties(const HttpMsg *aMsg)
     return false;
 }
 
+int64_t
+HttpRequest::getRangeOffsetLimit()
+{
+    fatal("Not implemented");
+    return 0;
+}
+
 /*
  * DO NOT MODIFY:
  * arch-tag: dd894aa8-63cc-4543-92d9-1079a18bee11
index c3dc01830858385e83e566c2347ae3c3d29c179c..c2620b45c5a68de6d027ced0b7ddd784a04dbf3d 100644 (file)
@@ -179,3 +179,22 @@ 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.");
+}
diff --git a/src/tests/stub_MemStore.cc b/src/tests/stub_MemStore.cc
new file mode 100644 (file)
index 0000000..67de39a
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * $Id$
+ *
+ * DEBUG: section 84    Helper process maintenance
+ *
+ */
+
+#include "config.h"
+#include "MemStore.h"
+
+#define STUB_API "MemStore.cc"
+#include "tests/STUB.h"
+
+MemStore::MemStore() STUB
+MemStore::~MemStore() STUB
+void MemStore::considerKeeping(StoreEntry &) STUB
+void MemStore::reference(StoreEntry &) STUB
+void MemStore::maintain() STUB
+void MemStore::cleanReadable(const sfileno) STUB
+void MemStore::get(String const, STOREGETCLIENT, void *) STUB
+void MemStore::init() STUB
+void MemStore::stat(StoreEntry &) const STUB
+
+int MemStore::callback()
+{
+    STUB
+    return 0;
+}
+
+StoreEntry *MemStore::get(const cache_key *)
+{
+    STUB
+    return NULL;
+}
+
+uint64_t MemStore::maxSize() const
+{
+    STUB
+    return 0;
+}
+
+uint64_t MemStore::minSize() const
+{
+    STUB
+    return 0;
+}
+
+uint64_t MemStore::currentSize() const
+{
+    STUB
+    return 0;
+}
+
+uint64_t MemStore::currentCount() const
+{
+    STUB
+    return 0;
+}
+
+int64_t MemStore::maxObjectSize() const
+{
+    STUB
+    return 0;
+}
+
+StoreSearch *MemStore::search(String const, HttpRequest *)
+{
+    STUB
+    return NULL;
+}
+
+bool MemStore::dereference(StoreEntry &)
+{
+    STUB
+    return false;
+}
index 478ce74443e4e88f9ebc0c5c3f0c7107d3217c37..4ac50e62592d97cd12e644a6e0b616301171a55e 100644 (file)
@@ -1,4 +1,14 @@
 #include "config.h"
 #include "ipc/Port.h"
 
+#define STUB_API "ipc/Port.cc"
+#include "tests/STUB.h"
+
 const char Ipc::coordinatorAddr[] = "";
+const char Ipc::strandAddrPfx[] = "";
+
+String Ipc::Port::MakeAddr(char const*, int)
+{
+    STUB
+    return "";
+}
diff --git a/src/tests/stub_TypedMsgHdr.cc b/src/tests/stub_TypedMsgHdr.cc
deleted file mode 100644 (file)
index 52fc5c9..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "config.h"
-#include "fatal.h"
-#include "ipc/TypedMsgHdr.h"
-
-Ipc::TypedMsgHdr::TypedMsgHdr()
-{
-    fatal("Not implemented");
-}
-
-void
-Ipc::TypedMsgHdr::getFixed(void *raw, size_t size) const
-{
-    fatal("Not implemented");
-}
-
-void
-Ipc::TypedMsgHdr::putFixed(const void *raw, size_t size)
-{
-    fatal("Not implemented");
-}
-
-void
-Ipc::TypedMsgHdr::getString(String &size) const
-{
-    fatal("Not implemented");
-}
-
-void
-Ipc::TypedMsgHdr::putString(const String & size)
-{
-    fatal("Not implemented");
-}
-
-void
-Ipc::TypedMsgHdr::checkType(int destType) const
-{
-    fatal("Not implemented");
-}
-
-void
-Ipc::TypedMsgHdr::setType(int aType)
-{
-    fatal("Not implemented");
-}
index 9c3e7fb7ca39ec9aa0051b429860ee12c136e66e..5407b32b91fbd83c7a0e0a11264f0372ec0c46a5 100644 (file)
@@ -115,6 +115,17 @@ dump_acl_access(StoreEntry * entry, const char *name, acl_access * head)
     fatal("not implemented 11");
 }
 
+YesNoNone::YesNoNone()
+{
+    /* ignore this for testing  */
+}
+
+YesNoNone::operator void*() const
+{
+    /* ignore this for testing  */
+    return NULL;
+}
+
 /*
  * DO NOT MODIFY:
  * arch-tag: 9bbc3b5f-8d7b-4fdc-af59-0b524a785307
index 8a186e4bffd9a488ee3e9157c7a2599a16772f7f..77c9f1006c6366bba18e99a5582d0d7ce1dc194b 100644 (file)
@@ -17,6 +17,7 @@ bool StoreEntry::checkDeferRead(int fd) const STUB_RETVAL(false)
 const char *StoreEntry::getMD5Text() const STUB_RETVAL(NULL)
 StoreEntry::StoreEntry() STUB
 StoreEntry::StoreEntry(const char *url, const char *log_url) STUB
+StoreEntry::~StoreEntry() STUB
 HttpReply const *StoreEntry::getReply() const STUB_RETVAL(NULL)
 void StoreEntry::write(StoreIOBuffer) STUB
 bool StoreEntry::isAccepting() const STUB_RETVAL(false)
@@ -104,6 +105,12 @@ void Store::diskFull() STUB
 void Store::sync() STUB
 void Store::unlink(StoreEntry &) STUB
 
+std::ostream &operator <<(std::ostream &os, const StoreEntry &)
+{
+    STUB
+    return os;
+}
+
 SQUIDCEXTERN size_t storeEntryInUse() STUB_RETVAL(0)
 SQUIDCEXTERN const char *storeEntryFlags(const StoreEntry *) STUB_RETVAL(NULL)
 void storeEntryReplaceObject(StoreEntry *, HttpReply *) STUB
index 983e00907d774f7c343f4550a8f330ee67368cbe..ba9ad4f6efc1f5fb363699bffad66ba4294b085e 100644 (file)
@@ -46,8 +46,7 @@ storeRebuildComplete(struct _store_rebuild_data *dc)
 {}
 
 bool
-storeRebuildLoadEntry(MemBuf &buf, StoreEntry &e, cache_key *key,
-    struct _store_rebuild_data &counts, uint64_t expectedSize)
+storeRebuildLoadEntry(int, int, MemBuf&, _store_rebuild_data&)
 {
     return false;
 }
@@ -58,3 +57,9 @@ storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key,
 {
    return false;
 }
+
+bool
+storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, struct _store_rebuild_data &, uint64_t)
+{
+    return false;
+}
index 95537ed940e827eb47187bf2acc69b02a58e6e4c..d9d20d61cb24381ca2558f9ecab2832eeec64223 100644 (file)
@@ -54,3 +54,31 @@ xmemset(void* dst, int val, size_t sz)
     assert(dst);
     return memset(dst, val, sz);
 }
+
+bool
+IamWorkerProcess()
+{
+    fprintf(stderr, "Not implemented");
+    return true;
+}
+
+bool
+IamDiskProcess()
+{
+    fprintf(stderr, "Not implemented");
+    return false;
+}
+
+bool
+IamMasterProcess()
+{
+    fprintf(stderr, "Not implemented");
+    return false;
+}
+
+bool
+UsingSmp()
+{
+    fprintf(stderr, "Not implemented");
+    return false;
+}
index 3e1b07a46d7b451d0b46b50b6e56368fb54cc82d..12964410661a0f997e2131a5e52a391aa3f8d9d3 100644 (file)
@@ -80,9 +80,7 @@ testCoss::testCossCreate()
     if (0 > system ("rm -rf " TESTDIR))
         throw std::runtime_error("Failed to clean test work directory");
 
-    StorePointer aRoot (new StoreController);
-
-    Store::Root(aRoot);
+    Store::Root(new StoreController);
 
     SwapDirPointer aStore (new CossSwapDir());
 
@@ -111,10 +109,10 @@ testCoss::testCossCreate()
 
     /* TODO: check the size */
 
-    free_cachedir(&Config.cacheSwap);
-
     Store::Root(NULL);
 
+    free_cachedir(&Config.cacheSwap);
+
     /* todo: here we should test a dirty rebuild */
 
     //    safe_free(Config.replPolicy->type);
@@ -146,9 +144,7 @@ testCoss::testCossSearch()
     if (0 > system ("rm -rf " TESTDIR))
         throw std::runtime_error("Failed to clean test work directory");
 
-    StorePointer aRoot (new StoreController);
-
-    Store::Root(aRoot);
+    Store::Root(new StoreController);
 
     SwapDirPointer aStore (new CossSwapDir());
 
@@ -257,10 +253,10 @@ testCoss::testCossSearch()
     CPPUNIT_ASSERT(search->isDone() == true);
     CPPUNIT_ASSERT(search->currentItem() == NULL);
 
-    free_cachedir(&Config.cacheSwap);
-
     Store::Root(NULL);
 
+    free_cachedir(&Config.cacheSwap);
+
     /* todo: here we should test a dirty rebuild */
 
     //TODO: do this once, or each time.    safe_free(Config.replPolicy->type);
@@ -280,8 +276,7 @@ testCoss::testDefaultEngine()
     if (0 > system ("rm -rf " TESTDIR))
         throw std::runtime_error("Failed to clean test work directory");
 
-    StorePointer aRoot (new StoreController);
-    Store::Root(aRoot);
+    Store::Root(new StoreController);
     SwapDirPointer aStore (new CossSwapDir());
     addSwapDir(aStore);
     commonInit();
@@ -294,8 +289,8 @@ testCoss::testDefaultEngine()
     safe_free(config_line);
     CPPUNIT_ASSERT(aStore->io != NULL);
 
-    free_cachedir(&Config.cacheSwap);
     Store::Root(NULL);
+    free_cachedir(&Config.cacheSwap);
     if (0 > system ("rm -rf " TESTDIR))
         throw std::runtime_error("Failed to clean test work directory");
 }
index 6e76cf159c29a36df0c5a39d1e31ae76c4fd5fbc..0382776fe67f75a92db8303ce79ae8cc0cd96e2b 100644 (file)
@@ -39,6 +39,24 @@ TestStore::minSize() const
     return 1;
 }
 
+uint64_t
+TestStore::currentSize() const
+{
+    return 2;
+}
+
+uint64_t
+TestStore::currentCount() const
+{
+    return 2;
+}
+
+int64_t
+TestStore::maxObjectSize() const
+{
+    return 1;
+}
+
 void
 TestStore::stat(StoreEntry &) const
 {
index a0c65fa47699d125c7d6b6fb4606f256b3d6dbfc..9a60e7534751e24b6644a71f96e1c2d2b5f86723 100644 (file)
@@ -59,6 +59,12 @@ public:
 
     virtual uint64_t minSize() const;
 
+    virtual uint64_t currentSize() const;
+
+    virtual uint64_t currentCount() const;
+
+    virtual int64_t maxObjectSize() const;
+
     virtual void stat(StoreEntry &) const; /* output stats to the provided store entry */
 
     virtual void reference(StoreEntry &) {}    /* Reference this object */
index 8b5b072853952581261965758c1095e6bbe323b8..654b22c5c44bd9f9216372ea318f7d38cc05c107 100644 (file)
@@ -87,9 +87,7 @@ testUfs::testUfsSearch()
     if (0 > system ("rm -rf " TESTDIR))
         throw std::runtime_error("Failed to clean test work directory");
 
-    StorePointer aRoot (new StoreController);
-
-    Store::Root(aRoot);
+    Store::Root(new StoreController);
 
     SwapDirPointer aStore (new UFSSwapDir("ufs", "Blocking"));
 
@@ -205,11 +203,12 @@ testUfs::testUfsSearch()
     CPPUNIT_ASSERT(search->isDone() == true);
     CPPUNIT_ASSERT(search->currentItem() == NULL);
 
+    Store::Root(NULL);
+
     free_cachedir(&Config.cacheSwap);
 
     /* todo: here we should test a dirty rebuild */
 
-    Store::Root(NULL);
     safe_free(Config.replPolicy->type);
     delete Config.replPolicy;
 
@@ -232,8 +231,7 @@ testUfs::testUfsDefaultEngine()
     // objects such as "StorePointer aRoot" from being called.
     CPPUNIT_ASSERT(!store_table); // or StoreHashIndex ctor will abort below
 
-    StorePointer aRoot (new StoreController);
-    Store::Root(aRoot);
+    Store::Root(new StoreController);
     SwapDirPointer aStore (new UFSSwapDir("ufs", "Blocking"));
     addSwapDir(aStore);
     commonInit();
@@ -249,8 +247,8 @@ testUfs::testUfsDefaultEngine()
     safe_free(config_line);
     CPPUNIT_ASSERT(aStore->IO->io != NULL);
 
-    free_cachedir(&Config.cacheSwap);
     Store::Root(NULL);
+    free_cachedir(&Config.cacheSwap);
     safe_free(Config.replPolicy->type);
     delete Config.replPolicy;