]>
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*)
31 TestStore::maxSize() const
37 TestStore::minSize() const
43 TestStore::currentSize() const
49 TestStore::currentCount() const
55 TestStore::maxObjectSize() const
61 TestStore::stat(StoreEntry
&) const
63 const_cast<TestStore
*>(this)->statsCalled
= true;
67 TestStore::search(String
const url
, HttpRequest
*)
73 testStore::testSetRoot()
75 StorePointer
aStore(new TestStore
);
78 CPPUNIT_ASSERT(&Store::Root() == aStore
.getRaw());
83 testStore::testUnsetRoot()
85 StorePointer
aStore(new TestStore
);
86 StorePointer
aStore2(new TestStore
);
89 CPPUNIT_ASSERT(&Store::Root() == aStore2
.getRaw());
94 testStore::testStats()
96 TestStorePointer
aStore(new TestStore
);
97 Store::Root(aStore
.getRaw());
98 CPPUNIT_ASSERT(aStore
->statsCalled
== false);
99 Store::Stats(NullStoreEntry::getInstance());
100 CPPUNIT_ASSERT(aStore
->statsCalled
== true);
105 testStore::testMaxSize()
107 StorePointer
aStore(new TestStore
);
108 Store::Root(aStore
.getRaw());
109 CPPUNIT_ASSERT(aStore
->maxSize() == 3);