]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testStore.cc
1 #define SQUID_UNIT_TEST 1
7 CPPUNIT_TEST_SUITE_REGISTRATION( testStore
);
16 TestStore::get(const cache_key
*)
22 TestStore::get(String
, void (*)(StoreEntry
*, void*), void*)
30 TestStore::maxSize() const
36 TestStore::minSize() const
42 TestStore::currentSize() const
48 TestStore::currentCount() const
54 TestStore::maxObjectSize() const
60 TestStore::getStats(StoreInfoStats
&) const
65 TestStore::stat(StoreEntry
&) const
67 const_cast<TestStore
*>(this)->statsCalled
= true;
71 TestStore::search(String
const url
, HttpRequest
*)
77 testStore::testSetRoot()
79 StorePointer
aStore(new TestStore
);
82 CPPUNIT_ASSERT(&Store::Root() == aStore
.getRaw());
87 testStore::testUnsetRoot()
89 StorePointer
aStore(new TestStore
);
90 StorePointer
aStore2(new TestStore
);
93 CPPUNIT_ASSERT(&Store::Root() == aStore2
.getRaw());
98 testStore::testStats()
100 TestStorePointer
aStore(new TestStore
);
101 Store::Root(aStore
.getRaw());
102 CPPUNIT_ASSERT(aStore
->statsCalled
== false);
103 Store::Stats(NullStoreEntry::getInstance());
104 CPPUNIT_ASSERT(aStore
->statsCalled
== true);
109 testStore::testMaxSize()
111 StorePointer
aStore(new TestStore
);
112 Store::Root(aStore
.getRaw());
113 CPPUNIT_ASSERT(aStore
->maxSize() == 3);