]>
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 void stat(StoreEntry
&) const; /* output stats to the provided store entry */
64 virtual void reference(StoreEntry
&) {} /* Reference this object */
66 virtual void dereference(StoreEntry
&) {} /* Unreference this object */
68 virtual void updateSize(int64_t size
, int sign
) {}
70 virtual StoreSearch
*search(String
const url
, HttpRequest
*);
73 typedef RefCount
<TestStore
> TestStorePointer
;