]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/testStoreController.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / testStoreController.cc
index 0f99ab89408e7640ce0e7e0654f045c6f5f55c78..a7d53229d19c854ca7cc37ff7e30577b7791aa6b 100644 (file)
@@ -1,10 +1,12 @@
-#include "squid.h"
+#define SQUID_UNIT_TEST 1
 
+#include "squid.h"
 #include "testStoreController.h"
 #include "Store.h"
 #include "SwapDir.h"
 #include "TestSwapDir.h"
 #include "Mem.h"
+#include "SquidTime.h"
 #include "StoreSearch.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testStoreController );
@@ -17,7 +19,6 @@ addSwapDir(TestSwapDirPointer aStore)
     ++Config.cacheSwap.n_configured;
 }
 
-
 void
 testStoreController::testStats()
 {
@@ -48,8 +49,6 @@ commonInit()
 
     Mem::Init();
 
-    cbdataInit();
-
     Config.Store.avgObjectSize = 1024;
 
     Config.Store.objectsPerBucket = 20;
@@ -87,12 +86,12 @@ addedEntry(StorePointer hashStore,
 {
     StoreEntry *e = new StoreEntry();
     e->store_status = STORE_OK;
-    storeSetMemStatus(e, NOT_IN_MEMORY);
+    e->setMemStatus(NOT_IN_MEMORY);
     e->swap_status = SWAPOUT_DONE; /* bogus haha */
     e->swap_filen = 0; /* garh - lower level*/
     e->swap_dirn = -1;
 
-    for (int i=0; i < Config.cacheSwap.n_configured; i++) {
+    for (int i=0; i < Config.cacheSwap.n_configured; ++i) {
         if (INDEXSD (i) == aStore.getRaw())
             e->swap_dirn = i;
     }
@@ -110,7 +109,7 @@ addedEntry(StorePointer hashStore,
     EBIT_CLR(e->flags, KEY_PRIVATE);
     e->ping_status = PING_NONE;
     EBIT_CLR(e->flags, ENTRY_VALIDATED);
-    storeHashInsert(e, (const cache_key *)name.buf()); /* do it after we clear KEY_PRIVATE */
+    e->hashInsert((const cache_key *)name.termedBuf());        /* do it after we clear KEY_PRIVATE */
     return e;
 }