]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/testStore.h
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / tests / testStore.h
index fbdf7e0b4106b0e7742c2c61776b55c91ea7f4db..9f86525329b0b9a5642b04559e94c9c3f413fb19 100644 (file)
@@ -1,13 +1,19 @@
+/*
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
 
 #ifndef SQUID_SRC_TEST_STORE_H
 #define SQUID_SRC_TEST_STORE_H
 
-#include "squid.h"
 #include "Store.h"
+#include "store/Controlled.h"
 
 #include <cppunit/extensions/HelperMacros.h>
 
-
 /*
  * test the store framework
  */
@@ -30,12 +36,8 @@ protected:
     void testMaxSize();
 };
 
-
-/* subclass of Store to allow testing of methods without having all the
- * other components live
- */
-
-class TestStore : public Store
+/// allows testing of methods without having all the other components live
+class TestStore : public Store::Controller
 {
 
 public:
@@ -45,11 +47,9 @@ public:
 
     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();
 
@@ -59,19 +59,24 @@ public:
 
     virtual uint64_t minSize() const;
 
-    virtual void stat(StoreEntry &) const; /* output stats to the provided store entry */
+    virtual uint64_t currentSize() const;
+
+    virtual uint64_t currentCount() const;
+
+    virtual int64_t maxObjectSize() const;
 
-    virtual void reference(StoreEntry &) {}    /* Reference this object */
+    virtual void getStats(StoreInfoStats &) const;
 
-    virtual void dereference(StoreEntry &) {}  /* Unreference this object */
+    virtual void stat(StoreEntry &) const; /* output stats to the provided store entry */
+
+    virtual void reference(StoreEntry &) {} /* Reference this object */
 
-    virtual void updateSize(int64_t size, int sign) {}
+    virtual bool dereference(StoreEntry &) { return true; }
 
-    virtual StoreSearch *search(String const url, HttpRequest *);
+    virtual StoreSearch *search();
 };
 
 typedef RefCount<TestStore> TestStorePointer;
 
-
 #endif