and making StoreEntry::hashDelete() more forgiving.
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
cbdata.cc \
client_db.h \
ClientInfo.h \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
$(DELAY_POOL_SOURCE) \
StrList.h \
StrList.cc \
tests/stub_SwapDir.cc \
+ Transients.cc \
log/access_log.h \
tests/stub_access_log.cc \
tests/stub_acl.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
StrList.h \
StrList.cc \
tests/stub_SwapDir.cc \
+ Transients.cc \
tests/test_http_range.cc \
tests/stub_external_acl.cc \
tests/stub_ipc_Forwarder.cc \
HttpParser.h \
MemBuf.cc \
MemBuf.h \
+ tests/stub_MemObject.cc \
Mem.h \
tests/stub_mem.cc \
String.cc \
cache_cf.h \
YesNoNone.h \
+ $(SBUF_SOURCE) \
+ tests/stub_SBufDetailedStats.cc \
tests/stub_cache_cf.cc \
tests/stub_cache_manager.cc \
+ tests/stub_comm.cc \
+ tests/stub_cbdata.cc \
tests/stub_debug.cc \
tests/stub_event.cc \
tests/stub_HelperChildConfig.cc \
+ tests/stub_stmem.cc \
tests/stub_store.cc \
+ tests/stub_store_stats.cc \
tools.h \
tests/stub_tools.cc \
tests/testHttpParser.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
tests/stub_CacheDigest.cc \
cbdata.cc \
ClientInfo.h \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
$(DELAY_POOL_SOURCE) \
tests/stub_store_rebuild.cc \
tests/stub_store_swapout.cc \
tools.h \
+ Transients.cc \
tests/stub_tools.cc \
tests/stub_UdsOp.cc \
tests/testMain.cc \
tests/testUfs.h \
tests/stub_cache_manager.cc \
tests/stub_client_db.cc \
+ tests/stub_CollapsedForwarding.cc \
tests/stub_HelperChildConfig.cc \
tests/stub_icp.cc \
tests/stub_ipc.cc \
RequestFlags.cc \
SquidList.h \
SquidList.cc \
+ Transients.cc \
MasterXaction.cc \
MasterXaction.h \
MemObject.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
+ tests/stub_CollapsedForwarding.cc \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
" refcnt=" << e->refcount << " lastref=" << e->lastref <<
" heap_age=" << heap_age << " tie=" << tie << " -> " << key);
- if (e->mem_obj && e->mem_obj->url)
- debugs(81, 3, "HeapKeyGen_StoreEntry_LFUDA: url=" << e->mem_obj->url);
+ if (e->mem_obj)
+ debugs(81, 3, "storeId=" << e->mem_obj->storeId());
return (double) key;
}
e->lastref << " heap_age=" << heap_age << " tie=" << tie <<
" -> " << key);
- if (e->mem_obj && e->mem_obj->url)
- debugs(81, 3, "HeapKeyGen_StoreEntry_GDSF: url=" << e->mem_obj->url);
+ if (e->mem_obj)
+ debugs(81, 3, "storeId=" << e->mem_obj->storeId());
return key;
}
e->getMD5Text() << " heap_age=" << heap_age <<
" lastref=" << (double) e->lastref );
- if (e->mem_obj && e->mem_obj->url)
- debugs(81, 3, "HeapKeyGen_StoreEntry_LRU: url=" << e->mem_obj->url);
+ if (e->mem_obj)
+ debugs(81, 3, "storeId=" << e->mem_obj->storeId());
return (heap_key) e->lastref;
}
void
StoreEntry::hashDelete()
{
- hash_remove_link(store_table, this);
- storeKeyFree((const cache_key *)key);
- key = NULL;
+ if (key) { // some test cases do not create keys and do not hashInsert()
+ hash_remove_link(store_table, this);
+ storeKeyFree((const cache_key *)key);
+ key = NULL;
+ }
}
/* -------------------------------------------------------------------------- */
void MemObject::trimSwappable() STUB
void MemObject::trimUnSwappable() STUB
int64_t MemObject::policyLowestOffsetToKeep(bool swap) const STUB_RETVAL(-1)
-MemObject::MemObject(char const *, char const *) :
- url(NULL),
+MemObject::MemObject() :
inmem_lo(0),
nclients(0),
request(NULL),
ping_reply_callback(NULL),
ircb_data(NULL),
- log_url(NULL),
id(0),
object_sz(-1),
swap_hdr_sz(0),
// XXX: required by testStore
return NULL;
}
+void MemObject::setUris(char const *aStoreId, char const *aLogUri, const HttpRequestMethod &aMethod) STUB
void MemObject::reset() STUB
void MemObject::delayRead(DeferredRead const &aRead) STUB
bool MemObject::readAheadPolicyCanRead() const STUB_RETVAL(false)
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)
int64_t MemObject::availableForSwapOut() const STUB_RETVAL(0)
bool StoreEntry::checkDeferRead(int fd) const STUB_RETVAL(false)
const char *StoreEntry::getMD5Text() const STUB_RETVAL(NULL)
StoreEntry::StoreEntry() STUB
-StoreEntry::StoreEntry(const char *, const char *) STUB
StoreEntry::~StoreEntry() STUB
HttpReply const *StoreEntry::getReply() const STUB_RETVAL(NULL)
void StoreEntry::write(StoreIOBuffer) STUB
int StoreEntry::locked() const STUB_RETVAL(0)
int StoreEntry::validToSend() const STUB_RETVAL(0)
bool StoreEntry::memoryCachable() const STUB_RETVAL(false)
-void StoreEntry::makeMemObject() STUB
+MemObject *StoreEntry::makeMemObject() STUB_RETVAL(NULL)
void StoreEntry::createMemObject(const char *, const char *, const HttpRequestMethod &aMethod) STUB
void StoreEntry::dump(int debug_lvl) const STUB
void StoreEntry::hashDelete() STUB
// in Packer.cc !? void packerToStoreInit(Packer * p, StoreEntry * e) STUB
void storeGetMemSpace(int size) STUB
-#if !_USE_INLINE_
-#include "Store.cci"
-#endif
+#if !_USE_INLINE_ /* stubs for Store.cci */
+bool StoreEntry::isEmpty () const STUB_RETVAL(true)
+HttpReply const *NullStoreEntry::getReply() const STUB_RETVAL(NULL)
+
+Store &Store::Root()
+{
+ CPPUNIT_ASSERT(CurrentRoot != NULL);
+ return *CurrentRoot;
+}
+#endif /* !_USE_INLINE_ */
#include "squid.h"
#include "Mem.h"
+#include "MemObject.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "Store.h"
void
testStoreController::testStats()
{
- StoreEntry * logEntry = new StoreEntry("dummy_url", "dummy_log_url");
+ StoreEntry *logEntry = new StoreEntry;
+ logEntry->makeMemObject();
+ logEntry->mem_obj->setUris("dummy_storeId", NULL, HttpRequestMethod());
logEntry->store_status = STORE_PENDING;
StorePointer aRoot (new StoreController);
Store::Root(aRoot);
testStoreController::testMaxSize()
{
commonInit();
- StoreEntry * logEntry = new StoreEntry("dummy_url", "dummy_log_url");
+ StoreEntry *logEntry = new StoreEntry;
+ logEntry->makeMemObject();
+ logEntry->mem_obj->setUris("dummy_storeId", NULL, HttpRequestMethod());
logEntry->store_status = STORE_PENDING;
StorePointer aRoot (new StoreController);
Store::Root(aRoot);
CPPUNIT_ASSERT (e->swap_dirn != -1);
e->swap_file_sz = 0; /* garh lower level */
- e->lock_count = 0;
e->lastref = squid_curtime;
e->timestamp = squid_curtime;
e->expires = squid_curtime;
CapturingStoreEntry * anEntry = new CapturingStoreEntry();
{
- StoreEntryStream stream(anEntry);
+ StoreEntryStream stream(anEntry); // locks and unlocks/deletes anEntry
CPPUNIT_ASSERT_EQUAL(1, anEntry->_buffer_calls);
CPPUNIT_ASSERT_EQUAL(0, anEntry->_flush_calls);
CPPUNIT_ASSERT_EQUAL(String("12345677.7 some text !."),
anEntry->_appended_text);
}
-
- delete anEntry;
-
Store::Root(NULL);
}
#include "squid.h"
#include "Mem.h"
+#include "MemObject.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "Store.h"
void
testStoreHashIndex::testStats()
{
- StoreEntry * logEntry = new StoreEntry("dummy_url", "dummy_log_url");
+ StoreEntry *logEntry = new StoreEntry;
+ logEntry->makeMemObject();
+ logEntry->mem_obj->setUris("dummy_storeId", NULL, HttpRequestMethod());
logEntry->store_status = STORE_PENDING;
StorePointer aRoot (new StoreHashIndex());
Store::Root(aRoot);
void
testStoreHashIndex::testMaxSize()
{
- StoreEntry * logEntry = new StoreEntry("dummy_url", "dummy_log_url");
+ StoreEntry *logEntry = new StoreEntry;
+ logEntry->makeMemObject();
+ logEntry->mem_obj->setUris("dummy_storeId", NULL, HttpRequestMethod());
logEntry->store_status = STORE_PENDING;
StorePointer aRoot (new StoreHashIndex());
Store::Root(aRoot);
CPPUNIT_ASSERT (e->swap_dirn != -1);
e->swap_file_sz = 0; /* garh lower level */
- e->lock_count = 0;
e->lastref = squid_curtime;
e->timestamp = squid_curtime;
e->expires = squid_curtime;