]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testStore.cc
1 #define SQUID_UNIT_TEST 1
7 CPPUNIT_TEST_SUITE_REGISTRATION( testStore
);
26 (String
, void (*)(StoreEntry
*, void*), void*)
35 TestStore::maxSize() const
41 TestStore::minSize() const
47 TestStore::stat(StoreEntry
&) const
49 const_cast<TestStore
*>(this)->statsCalled
= true;
53 TestStore::search(String
const url
, HttpRequest
*)
59 testStore::testSetRoot()
61 StorePointer
aStore (new TestStore
);
64 CPPUNIT_ASSERT(&Store::Root() == aStore
.getRaw());
69 testStore::testUnsetRoot()
71 StorePointer
aStore (new TestStore
);
72 StorePointer
aStore2 (new TestStore
);
75 CPPUNIT_ASSERT(&Store::Root() == aStore2
.getRaw());
80 testStore::testStats()
82 TestStorePointer
aStore (new TestStore
);
83 Store::Root(aStore
.getRaw());
84 CPPUNIT_ASSERT(aStore
->statsCalled
== false);
85 Store::Stats(NullStoreEntry::getInstance());
86 CPPUNIT_ASSERT(aStore
->statsCalled
== true);
91 testStore::testMaxSize()
93 StorePointer
aStore (new TestStore
);
94 Store::Root(aStore
.getRaw());
95 CPPUNIT_ASSERT(aStore
->maxSize() == 3);