testStore.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9#ifndef SQUID_SRC_TEST_STORE_H
10#define SQUID_SRC_TEST_STORE_H
11
12#include "Store.h"
13#include "store/Controlled.h"
14
15#include "compat/cppunit.h"
16
17/*
18 * test the store framework
19 */
20
21class testStore : public CPPUNIT_NS::TestFixture
22{
30
31public:
32
33protected:
34 void testSetRoot();
35 void testUnsetRoot();
36 void testStats();
37 void testMaxSize();
39};
40
43{
44
45public:
47
49
50 virtual int callback();
51
52 virtual StoreEntry* get(const cache_key*);
53
54 virtual void get(String, void (*)(StoreEntry*, void*), void*);
55
56 virtual void init();
57
58 virtual void maintain() {};
59
60 virtual uint64_t maxSize() const;
61
62 virtual uint64_t minSize() const;
63
64 virtual uint64_t currentSize() const;
65
66 virtual uint64_t currentCount() const;
67
68 virtual int64_t maxObjectSize() const;
69
70 virtual void getStats(StoreInfoStats &) const;
71
72 virtual void stat(StoreEntry &) const; /* output stats to the provided store entry */
73
74 virtual void reference(StoreEntry &) {} /* Reference this object */
75
76 virtual bool dereference(StoreEntry &) { return true; }
77
78 virtual StoreSearch *search();
79};
80
82
83#endif
84
#define false
Definition: GnuRegex.c:240
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:14
allows testing of methods without having all the other components live
Definition: testStore.h:43
virtual void init()
Definition: testStore.cc:36
virtual StoreSearch * search()
Definition: testStore.cc:81
virtual StoreEntry * get(const cache_key *)
Definition: testStore.cc:26
virtual bool dereference(StoreEntry &)
Definition: testStore.h:76
bool statsCalled
Definition: testStore.h:48
virtual void reference(StoreEntry &)
Definition: testStore.h:74
virtual uint64_t maxSize() const
Definition: testStore.cc:40
virtual int callback()
called once every main loop iteration; TODO: Move to UFS code.
Definition: testStore.cc:20
TestStore()
Definition: testStore.h:46
virtual uint64_t currentSize() const
current size
Definition: testStore.cc:52
virtual uint64_t currentCount() const
the total number of objects stored right now
Definition: testStore.cc:58
virtual void stat(StoreEntry &) const
Definition: testStore.cc:75
virtual void maintain()
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: testStore.h:58
virtual void getStats(StoreInfoStats &) const
collect statistics
Definition: testStore.cc:70
virtual uint64_t minSize() const
the minimum size the store will shrink to via normal housekeeping
Definition: testStore.cc:46
virtual int64_t maxObjectSize() const
the maximum size of a storable object; -1 if unlimited
Definition: testStore.cc:64
void testStats()
Definition: testStore.cc:109
void testUnsetRoot()
Definition: testStore.cc:97
CPPUNIT_TEST_SUITE_END()
void testMaxSize()
Definition: testStore.cc:121
void testSetRoot()
Definition: testStore.cc:87
CPPUNIT_TEST(testSetRoot)
CPPUNIT_TEST_SUITE(testStore)
CPPUNIT_TEST(testStats)
CPPUNIT_TEST(testMaxSize)
CPPUNIT_TEST(testSwapMetaTypeClassification)
CPPUNIT_TEST(testUnsetRoot)
void testSwapMetaTypeClassification()
Definition: testStore.cc:191
unsigned char cache_key
Store key.
Definition: forward.h:29
RefCount< TestStore > TestStorePointer
Definition: testStore.h:81

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors