aboutsummaryrefslogtreecommitdiff
path: root/src/tests/cache.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2008-12-20 02:01:44 +0000
committerMike Buland <eichlan@xagasoft.com>2008-12-20 02:01:44 +0000
commitb7a687b08e32adafbb609bec7aa79b54f161ee4c (patch)
tree9c0214eb7fa5c69619bb4226cb292d19445b92df /src/tests/cache.cpp
parent5db154c3fb36a677c551e39c3c6661207eb51778 (diff)
downloadlibbu++-b7a687b08e32adafbb609bec7aa79b54f161ee4c.tar.gz
libbu++-b7a687b08e32adafbb609bec7aa79b54f161ee4c.tar.bz2
libbu++-b7a687b08e32adafbb609bec7aa79b54f161ee4c.tar.xz
libbu++-b7a687b08e32adafbb609bec7aa79b54f161ee4c.zip
All of the basic, core workings of the Cache are complete, and tested. Even
added some more tests and whatnot. A lot happened, but I can't remember everything. Also, Bu::File reports errors in more error cases.
Diffstat (limited to '')
-rw-r--r--src/tests/cache.cpp27
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
11class Bob 12class Bob
12{ 13{
@@ -136,6 +137,29 @@ private:
136 long cLastId; 137 long cLastId;
137}; 138};
138 139
140class BobCalc : public Bu::CacheCalc<Bob, long>
141{
142public:
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
159private:
160
161};
162
139int main( int argc, char *argv[] ) 163int 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 {