]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/TestSwapDir.h
16da5c2ba501f10ffca0eb660552d16aeb608530
2 * Copyright (C) 1996-2022 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.
9 #ifndef TEST_TESTSWAPDIR
10 #define TEST_TESTSWAPDIR
12 #include "store/Disk.h"
14 class TestSwapDir
: public SwapDir
18 TestSwapDir() : SwapDir("test"), statsCalled (false) {}
23 uint64_t maxSize() const override
;
24 uint64_t currentSize() const override
;
25 uint64_t currentCount() const override
;
26 void stat(StoreEntry
&) const override
;
27 void finalizeSwapoutSuccess(const StoreEntry
&) override
{}
28 void finalizeSwapoutFailure(StoreEntry
&) override
{}
29 void reconfigure() override
;
31 bool unlinkdUseful() const override
;
32 bool canStore(const StoreEntry
&e
, int64_t diskSpaceNeeded
, int &load
) const override
;
33 StoreIOState::Pointer
createStoreIO(StoreEntry
&, StoreIOState::STFNCB
*, StoreIOState::STIOCB
*, void *) override
;
34 StoreIOState::Pointer
openStoreIO(StoreEntry
&, StoreIOState::STFNCB
*, StoreIOState::STIOCB
*, void *) override
;
35 void parse(int, char*) override
;
36 void evictCached(StoreEntry
&) override
{}
37 void evictIfFound(const cache_key
*) override
{}
38 bool hasReadableEntry(const StoreEntry
&) const override
{ return false; }
39 bool smpAware() const override
{ return false; }
42 typedef RefCount
<TestSwapDir
> TestSwapDirPointer
;
44 #endif /* TEST_TESTSWAPDIR */