]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testStore.h
2 #ifndef SQUID_SRC_TEST_STORE_H
3 #define SQUID_SRC_TEST_STORE_H
7 #include <cppunit/extensions/HelperMacros.h>
11 * test the store framework
14 class testStore
: public CPPUNIT_NS::TestFixture
16 CPPUNIT_TEST_SUITE( testStore
);
17 CPPUNIT_TEST( testSetRoot
);
18 CPPUNIT_TEST( testUnsetRoot
);
19 CPPUNIT_TEST( testStats
);
20 CPPUNIT_TEST( testMaxSize
);
21 CPPUNIT_TEST_SUITE_END();
33 /* subclass of Store to allow testing of methods without having all the
34 * other components live
37 class TestStore
: public Store
41 TestStore() : statsCalled (false) {}
45 virtual int callback();
47 virtual StoreEntry
* get(const cache_key
*);
49 virtual void get(String
, void (*)(StoreEntry
*, void*), void*);
53 virtual void maintain() {};
55 virtual uint64_t maxSize() const;
57 virtual uint64_t minSize() const;
59 virtual uint64_t currentSize() const;
61 virtual uint64_t currentCount() const;
63 virtual int64_t maxObjectSize() const;
65 virtual void getStats(StoreInfoStats
&) const;
67 virtual void stat(StoreEntry
&) const; /* output stats to the provided store entry */
69 virtual void reference(StoreEntry
&) {} /* Reference this object */
71 virtual bool dereference(StoreEntry
&) { return true; }
73 virtual StoreSearch
*search(String
const url
, HttpRequest
*);
76 typedef RefCount
<TestStore
> TestStorePointer
;