]>
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::stat(StoreEntry
&) const
45 const_cast<TestStore
*>(this)->statsCalled
= true;
49 TestStore::search(String
const url
, HttpRequest
*)
55 testStore::testSetRoot()
57 StorePointer
aStore(new TestStore
);
60 CPPUNIT_ASSERT(&Store::Root() == aStore
.getRaw());
65 testStore::testUnsetRoot()
67 StorePointer
aStore(new TestStore
);
68 StorePointer
aStore2(new TestStore
);
71 CPPUNIT_ASSERT(&Store::Root() == aStore2
.getRaw());
76 testStore::testStats()
78 TestStorePointer
aStore(new TestStore
);
79 Store::Root(aStore
.getRaw());
80 CPPUNIT_ASSERT(aStore
->statsCalled
== false);
81 Store::Stats(NullStoreEntry::getInstance());
82 CPPUNIT_ASSERT(aStore
->statsCalled
== true);
87 testStore::testMaxSize()
89 StorePointer
aStore(new TestStore
);
90 Store::Root(aStore
.getRaw());
91 CPPUNIT_ASSERT(aStore
->maxSize() == 3);