+/*
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#ifndef TEST_TESTSWAPDIR
#define TEST_TESTSWAPDIR
-#include "squid.h"
-#include "SwapDir.h"
+#include "store/Disk.h"
class TestSwapDir : public SwapDir
{
bool statsCalled;
- virtual size_t maxSize() const;
- virtual void stat(StoreEntry &) const; /* output stats to the provided store entry */
-
- virtual void reconfigure(int, char*);
- virtual void init();
- virtual int canStore(const StoreEntry&) const;
- virtual StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *);
- virtual StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *);
- virtual void parse(int, char*);
- virtual StoreSearch *search(String, HttpRequest *);
+ /* Store::Disk API */
+ virtual uint64_t maxSize() const override;
+ virtual uint64_t currentSize() const override;
+ virtual uint64_t currentCount() const override;
+ virtual void stat(StoreEntry &) const override;
+ virtual void finalizeSwapoutSuccess(const StoreEntry &) override {}
+ virtual void finalizeSwapoutFailure(StoreEntry &) override {}
+ virtual void reconfigure() override;
+ virtual void init() override;
+ virtual bool unlinkdUseful() const override;
+ virtual bool canStore(const StoreEntry &e, int64_t diskSpaceNeeded, int &load) const override;
+ virtual StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *) override;
+ virtual StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *) override;
+ virtual void parse(int, char*) override;
+ virtual void evictCached(StoreEntry &) override {}
+ virtual void evictIfFound(const cache_key *) override {}
+ virtual bool hasReadableEntry(const StoreEntry &) const override { return false; }
+ virtual bool smpAware() const override { return false; }
};
typedef RefCount<TestSwapDir> TestSwapDirPointer;
#endif /* TEST_TESTSWAPDIR */
+