]>
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
8 #include <cppunit/extensions/HelperMacros.h>
12 * test the store framework
15 class testStore
: public CPPUNIT_NS::TestFixture
17 CPPUNIT_TEST_SUITE( testStore
);
18 CPPUNIT_TEST( testSetRoot
);
19 CPPUNIT_TEST( testUnsetRoot
);
20 CPPUNIT_TEST( testStats
);
21 CPPUNIT_TEST( testMaxSize
);
22 CPPUNIT_TEST_SUITE_END();
34 /* subclass of Store to allow testing of methods without having all the
35 * other components live
38 class TestStore
: public Store
42 TestStore() : statsCalled (false) {}
46 virtual int callback();
48 virtual StoreEntry
* get
52 (String
, void (*)(StoreEntry
*, void*), void*);
56 virtual void maintain() {};
58 virtual uint64_t maxSize() const;
60 virtual uint64_t minSize() const;
62 virtual uint64_t currentSize() const;
64 virtual uint64_t currentCount() const;
66 virtual int64_t maxObjectSize() const;
68 virtual void stat(StoreEntry
&) const; /* output stats to the provided store entry */
70 virtual void reference(StoreEntry
&) {} /* Reference this object */
72 virtual bool dereference(StoreEntry
&) { return true; }
74 virtual StoreSearch
*search(String
const url
, HttpRequest
*);
77 typedef RefCount
<TestStore
> TestStorePointer
;