Mercurial > hg > orthanc
comparison UnitTests/MemoryCache.cpp @ 505:f59e4518fd57
rename CacheIndex as LeastRecentlyUsedIndex
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 16 Aug 2013 10:17:45 +0200 |
parents | 4031f73fe0e4 |
children | c4122c3a47c1 |
comparison
equal
deleted
inserted
replaced
503:273e7ad98ea9 | 505:f59e4518fd57 |
---|---|
6 #include <boost/lexical_cast.hpp> | 6 #include <boost/lexical_cast.hpp> |
7 #include "../Core/IDynamicObject.h" | 7 #include "../Core/IDynamicObject.h" |
8 #include "../Core/Cache/MemoryCache.h" | 8 #include "../Core/Cache/MemoryCache.h" |
9 | 9 |
10 | 10 |
11 TEST(CacheIndex, Basic) | 11 TEST(LRU, Basic) |
12 { | 12 { |
13 Orthanc::CacheIndex<std::string> r; | 13 Orthanc::LeastRecentlyUsedIndex<std::string> r; |
14 | 14 |
15 r.Add("d"); | 15 r.Add("d"); |
16 r.Add("a"); | 16 r.Add("a"); |
17 r.Add("c"); | 17 r.Add("c"); |
18 r.Add("b"); | 18 r.Add("b"); |
31 | 31 |
32 ASSERT_TRUE(r.IsEmpty()); | 32 ASSERT_TRUE(r.IsEmpty()); |
33 } | 33 } |
34 | 34 |
35 | 35 |
36 TEST(CacheIndex, Payload) | 36 TEST(LRU, Payload) |
37 { | 37 { |
38 Orthanc::CacheIndex<std::string, int> r; | 38 Orthanc::LeastRecentlyUsedIndex<std::string, int> r; |
39 | 39 |
40 r.Add("a", 420); | 40 r.Add("a", 420); |
41 r.Add("b", 421); | 41 r.Add("b", 421); |
42 r.Add("c", 422); | 42 r.Add("c", 422); |
43 r.Add("d", 423); | 43 r.Add("d", 423); |