diff options
Diffstat (limited to '')
| -rw-r--r-- | src/tests/cache.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp index 18e6a95..12b5bf4 100644 --- a/src/tests/cache.cpp +++ b/src/tests/cache.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "bu/cache.h" | 7 | #include "bu/cache.h" |
| 8 | #include "bu/file.h" | 8 | #include "bu/file.h" |
| 9 | #include "bu/fstring.h" | 9 | #include "bu/fstring.h" |
| 10 | #include "bu/cachecalc.h" | ||
| 10 | 11 | ||
| 11 | class Bob | 12 | class Bob |
| 12 | { | 13 | { |
| @@ -136,6 +137,29 @@ private: | |||
| 136 | long cLastId; | 137 | long cLastId; |
| 137 | }; | 138 | }; |
| 138 | 139 | ||
| 140 | class BobCalc : public Bu::CacheCalc<Bob, long> | ||
| 141 | { | ||
| 142 | public: | ||
| 143 | BobCalc() | ||
| 144 | { | ||
| 145 | } | ||
| 146 | |||
| 147 | virtual ~BobCalc() | ||
| 148 | { | ||
| 149 | } | ||
| 150 | |||
| 151 | virtual void onLoad( Bob *, const long & ) | ||
| 152 | { | ||
| 153 | } | ||
| 154 | |||
| 155 | virtual void onUnload( Bob *, const long & ) | ||
| 156 | { | ||
| 157 | } | ||
| 158 | |||
| 159 | private: | ||
| 160 | |||
| 161 | }; | ||
| 162 | |||
| 139 | int main( int argc, char *argv[] ) | 163 | int main( int argc, char *argv[] ) |
| 140 | { | 164 | { |
| 141 | TRACE( argc, argv ); | 165 | TRACE( argc, argv ); |
| @@ -148,7 +172,8 @@ int main( int argc, char *argv[] ) | |||
| 148 | return 0; | 172 | return 0; |
| 149 | } | 173 | } |
| 150 | 174 | ||
| 151 | BobCache cBob; | 175 | BobCalc cc; |
| 176 | BobCache cBob( cc ); | ||
| 152 | cBob.appendStore( new BobStore() ); | 177 | cBob.appendStore( new BobStore() ); |
| 153 | switch( argv[1][0] ) | 178 | switch( argv[1][0] ) |
| 154 | { | 179 | { |
