]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testStore.cc
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
11 #include "testStore.h"
13 CPPUNIT_TEST_SUITE_REGISTRATION( testStore
);
22 TestStore::get(const cache_key
*)
28 TestStore::get(String
, void (*)(StoreEntry
*, void*), void*)
36 TestStore::maxSize() const
42 TestStore::minSize() const
48 TestStore::currentSize() const
54 TestStore::currentCount() const
60 TestStore::maxObjectSize() const
66 TestStore::getStats(StoreInfoStats
&) const
71 TestStore::stat(StoreEntry
&) const
73 const_cast<TestStore
*>(this)->statsCalled
= true;
77 TestStore::search(String
const url
, HttpRequest
*)
83 testStore::testSetRoot()
85 StorePointer
aStore(new TestStore
);
88 CPPUNIT_ASSERT_EQUAL(&Store::Root(),aStore
.getRaw());
93 testStore::testUnsetRoot()
95 StorePointer
aStore(new TestStore
);
96 StorePointer
aStore2(new TestStore
);
99 CPPUNIT_ASSERT_EQUAL(&Store::Root(),aStore2
.getRaw());
104 testStore::testStats()
106 TestStorePointer
aStore(new TestStore
);
107 Store::Root(aStore
.getRaw());
108 CPPUNIT_ASSERT_EQUAL(false, aStore
->statsCalled
);
109 Store::Stats(NullStoreEntry::getInstance());
110 CPPUNIT_ASSERT_EQUAL(true, aStore
->statsCalled
);
115 testStore::testMaxSize()
117 StorePointer
aStore(new TestStore
);
118 Store::Root(aStore
.getRaw());
119 CPPUNIT_ASSERT_EQUAL(static_cast<uint64_t>(3), aStore
->maxSize());