diff options
author | Mike Buland <eichlan@xagasoft.com> | 2013-07-18 02:09:29 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2013-07-18 02:09:29 +0000 |
commit | 51eef132bb2bb67e658756eaebeae5e52c13de98 (patch) | |
tree | f99d9e36ab2b3bbcb26d106cd0a71a03f27a8eb5 /src/tests | |
parent | 65cc54be0a14e627938731ff8deefea61c2c1cfa (diff) | |
download | libbu++-51eef132bb2bb67e658756eaebeae5e52c13de98.tar.gz libbu++-51eef132bb2bb67e658756eaebeae5e52c13de98.tar.bz2 libbu++-51eef132bb2bb67e658756eaebeae5e52c13de98.tar.xz libbu++-51eef132bb2bb67e658756eaebeae5e52c13de98.zip |
Fixed caching changed issue. The cache now marks objects as unchanged for you
after they are saved. It needs some more testing, but the theory is sound.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/cache.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp index 20b384e..7982b2d 100644 --- a/src/tests/cache.cpp +++ b/src/tests/cache.cpp | |||
@@ -171,6 +171,8 @@ namespace Bu | |||
171 | default: | 171 | default: |
172 | throw Bu::ExceptionBase("Flagrant error! Invalid type!"); | 172 | throw Bu::ExceptionBase("Flagrant error! Invalid type!"); |
173 | } | 173 | } |
174 | |||
175 | return NULL; | ||
174 | } | 176 | } |
175 | } | 177 | } |
176 | 178 | ||
@@ -179,7 +181,7 @@ typedef Bu::CachePtr<Bu::Uuid, SubSomethingA, Something> SomethingAPtr; | |||
179 | typedef Bu::CachePtr<Bu::Uuid, SubSomethingB, Something> SomethingBPtr; | 181 | typedef Bu::CachePtr<Bu::Uuid, SubSomethingB, Something> SomethingBPtr; |
180 | typedef Bu::MyriadCache<Bu::Uuid, Something> SomethingCache; | 182 | typedef Bu::MyriadCache<Bu::Uuid, Something> SomethingCache; |
181 | 183 | ||
182 | int main( int argc, char *argv[] ) | 184 | int main( int, char *[] ) |
183 | { | 185 | { |
184 | Bu::File fStore("test.myr", Bu::File::Create|Bu::File::ReadWrite); | 186 | Bu::File fStore("test.myr", Bu::File::Create|Bu::File::ReadWrite); |
185 | SomethingCache c( fStore ); | 187 | SomethingCache c( fStore ); |
@@ -196,7 +198,6 @@ int main( int argc, char *argv[] ) | |||
196 | 198 | ||
197 | SomethingCache::KeyList lKeys = c.getKeys(); | 199 | SomethingCache::KeyList lKeys = c.getKeys(); |
198 | Bu::println("Count: %1").arg( lKeys.getSize() ); | 200 | Bu::println("Count: %1").arg( lKeys.getSize() ); |
199 | int j = 0; | ||
200 | for( SomethingCache::KeyList::iterator i = lKeys.begin(); i; i++ ) | 201 | for( SomethingCache::KeyList::iterator i = lKeys.begin(); i; i++ ) |
201 | { | 202 | { |
202 | Bu::println(" - %1: '%2'").arg( *i ).arg( c.get( *i )->toString() ); | 203 | Bu::println(" - %1: '%2'").arg( *i ).arg( c.get( *i )->toString() ); |