Mercurial > hg > orthanc
annotate OrthancFramework/UnitTestsSources/MemoryCacheTests.cpp @ 4520:f5cb0c0ffbed
added unit test OrthancFramework.SizeOf to dump sizeof all the public classes in the Orthanc framework
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 22 Feb 2021 18:30:31 +0100 |
parents | d9473bd5ed43 |
children | 7053502fbf97 |
rev | line source |
---|---|
827
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
1 /** |
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
967
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
827
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
6 * |
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
10 * the License, or (at your option) any later version. |
827
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
11 * |
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
15 * Lesser General Public License for more details. |
827
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
16 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
18 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
827
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
20 **/ |
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
21 |
3d6f9b7d0add
precompiled headers in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
632
diff
changeset
|
22 |
4059
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
23 #if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4062
diff
changeset
|
24 // Must be the first to be sure to use the Orthanc framework shared library |
4059
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
25 # include <OrthancFramework.h> |
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
26 #endif |
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
27 |
4062 | 28 #include <gtest/gtest.h> |
1486
f967bdf8534e
refactoring to Logging.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1367
diff
changeset
|
29 |
4059
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
30 #include "../Sources/Cache/MemoryCache.h" |
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
31 #include "../Sources/Cache/MemoryStringCache.h" |
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
32 #include "../Sources/Cache/SharedArchive.h" |
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
33 #include "../Sources/IDynamicObject.h" |
e241e5f3f088
moved LuaTests and MemoryCacheTests from OrthancServer to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
34 #include "../Sources/Logging.h" |
282 | 35 |
4062 | 36 #include <memory> |
37 #include <algorithm> | |
38 #include <boost/thread.hpp> | |
39 #include <boost/lexical_cast.hpp> | |
40 | |
282 | 41 |
505
f59e4518fd57
rename CacheIndex as LeastRecentlyUsedIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
42 TEST(LRU, Basic) |
282 | 43 { |
505
f59e4518fd57
rename CacheIndex as LeastRecentlyUsedIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
44 Orthanc::LeastRecentlyUsedIndex<std::string> r; |
282 | 45 |
46 r.Add("d"); | |
47 r.Add("a"); | |
48 r.Add("c"); | |
49 r.Add("b"); | |
50 | |
509
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
51 r.MakeMostRecent("a"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
52 r.MakeMostRecent("d"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
53 r.MakeMostRecent("b"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
54 r.MakeMostRecent("c"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
55 r.MakeMostRecent("d"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
56 r.MakeMostRecent("c"); |
282 | 57 |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
58 ASSERT_EQ("a", r.GetOldest()); |
282 | 59 ASSERT_EQ("a", r.RemoveOldest()); |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
60 ASSERT_EQ("b", r.GetOldest()); |
282 | 61 ASSERT_EQ("b", r.RemoveOldest()); |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
62 ASSERT_EQ("d", r.GetOldest()); |
282 | 63 ASSERT_EQ("d", r.RemoveOldest()); |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
64 ASSERT_EQ("c", r.GetOldest()); |
282 | 65 ASSERT_EQ("c", r.RemoveOldest()); |
66 | |
67 ASSERT_TRUE(r.IsEmpty()); | |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
68 |
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
69 ASSERT_THROW(r.GetOldest(), Orthanc::OrthancException); |
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
70 ASSERT_THROW(r.RemoveOldest(), Orthanc::OrthancException); |
282 | 71 } |
72 | |
73 | |
505
f59e4518fd57
rename CacheIndex as LeastRecentlyUsedIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
74 TEST(LRU, Payload) |
282 | 75 { |
505
f59e4518fd57
rename CacheIndex as LeastRecentlyUsedIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
76 Orthanc::LeastRecentlyUsedIndex<std::string, int> r; |
282 | 77 |
78 r.Add("a", 420); | |
79 r.Add("b", 421); | |
80 r.Add("c", 422); | |
81 r.Add("d", 423); | |
82 | |
509
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
83 r.MakeMostRecent("a"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
84 r.MakeMostRecent("d"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
85 r.MakeMostRecent("b"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
86 r.MakeMostRecent("c"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
87 r.MakeMostRecent("d"); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
88 r.MakeMostRecent("c"); |
282 | 89 |
90 ASSERT_TRUE(r.Contains("b")); | |
91 ASSERT_EQ(421, r.Invalidate("b")); | |
92 ASSERT_FALSE(r.Contains("b")); | |
93 | |
94 int p; | |
283 | 95 ASSERT_TRUE(r.Contains("a", p)); ASSERT_EQ(420, p); |
96 ASSERT_TRUE(r.Contains("c", p)); ASSERT_EQ(422, p); | |
97 ASSERT_TRUE(r.Contains("d", p)); ASSERT_EQ(423, p); | |
98 | |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
99 ASSERT_EQ("a", r.GetOldest()); |
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
100 ASSERT_EQ(420, r.GetOldestPayload()); |
282 | 101 ASSERT_EQ("a", r.RemoveOldest(p)); ASSERT_EQ(420, p); |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
102 |
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
103 ASSERT_EQ("d", r.GetOldest()); |
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
104 ASSERT_EQ(423, r.GetOldestPayload()); |
282 | 105 ASSERT_EQ("d", r.RemoveOldest(p)); ASSERT_EQ(423, p); |
507
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
106 |
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
107 ASSERT_EQ("c", r.GetOldest()); |
c4122c3a47c1
access to oldest item in LRUCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
505
diff
changeset
|
108 ASSERT_EQ(422, r.GetOldestPayload()); |
282 | 109 ASSERT_EQ("c", r.RemoveOldest(p)); ASSERT_EQ(422, p); |
110 | |
111 ASSERT_TRUE(r.IsEmpty()); | |
112 } | |
113 | |
114 | |
509
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
115 TEST(LRU, PayloadUpdate) |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
116 { |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
117 Orthanc::LeastRecentlyUsedIndex<std::string, int> r; |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
118 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
119 r.Add("a", 420); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
120 r.Add("b", 421); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
121 r.Add("d", 423); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
122 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
123 r.MakeMostRecent("a", 424); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
124 r.MakeMostRecent("d", 421); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
125 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
126 ASSERT_EQ("b", r.GetOldest()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
127 ASSERT_EQ(421, r.GetOldestPayload()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
128 r.RemoveOldest(); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
129 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
130 ASSERT_EQ("a", r.GetOldest()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
131 ASSERT_EQ(424, r.GetOldestPayload()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
132 r.RemoveOldest(); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
133 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
134 ASSERT_EQ("d", r.GetOldest()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
135 ASSERT_EQ(421, r.GetOldestPayload()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
136 r.RemoveOldest(); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
137 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
138 ASSERT_TRUE(r.IsEmpty()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
139 } |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
140 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
141 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
142 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
143 TEST(LRU, PayloadUpdateBis) |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
144 { |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
145 Orthanc::LeastRecentlyUsedIndex<std::string, int> r; |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
146 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
147 r.AddOrMakeMostRecent("a", 420); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
148 r.AddOrMakeMostRecent("b", 421); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
149 r.AddOrMakeMostRecent("d", 423); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
150 r.AddOrMakeMostRecent("a", 424); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
151 r.AddOrMakeMostRecent("d", 421); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
152 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
153 ASSERT_EQ("b", r.GetOldest()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
154 ASSERT_EQ(421, r.GetOldestPayload()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
155 r.RemoveOldest(); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
156 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
157 ASSERT_EQ("a", r.GetOldest()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
158 ASSERT_EQ(424, r.GetOldestPayload()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
159 r.RemoveOldest(); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
160 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
161 ASSERT_EQ("d", r.GetOldest()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
162 ASSERT_EQ(421, r.GetOldestPayload()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
163 r.RemoveOldest(); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
164 |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
165 ASSERT_TRUE(r.IsEmpty()); |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
166 } |
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
167 |
3454
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
168 TEST(LRU, GetAllKeys) |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
169 { |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
170 Orthanc::LeastRecentlyUsedIndex<std::string, int> r; |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
171 std::vector<std::string> keys; |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
172 |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
173 r.AddOrMakeMostRecent("a", 420); |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
174 r.GetAllKeys(keys); |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
175 |
3497
db71bd11affc
fix unit tests if dcmtk != 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3454
diff
changeset
|
176 ASSERT_EQ(1u, keys.size()); |
3454
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
177 ASSERT_EQ("a", keys[0]); |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
178 |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
179 r.AddOrMakeMostRecent("b", 421); |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
180 r.GetAllKeys(keys); |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
181 |
3497
db71bd11affc
fix unit tests if dcmtk != 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3454
diff
changeset
|
182 ASSERT_EQ(2u, keys.size()); |
3454
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
183 ASSERT_TRUE(std::find(keys.begin(), keys.end(),"a") != keys.end()); |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
184 ASSERT_TRUE(std::find(keys.begin(), keys.end(),"b") != keys.end()); |
0e3c26e4b8ec
LeastRecentlyUsedIndex::GetAllKeys (test)
Alain Mazy <alain@mazy.be>
parents:
3060
diff
changeset
|
185 } |
509
e7841864c97c
StableResourcesMonitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
507
diff
changeset
|
186 |
283 | 187 |
188 | |
189 namespace | |
190 { | |
191 class Integer : public Orthanc::IDynamicObject | |
192 { | |
193 private: | |
194 std::string& log_; | |
195 int value_; | |
282 | 196 |
197 public: | |
283 | 198 Integer(std::string& log, int v) : log_(log), value_(v) |
199 { | |
200 } | |
201 | |
2924
22524fd06225
macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
202 virtual ~Integer() ORTHANC_OVERRIDE |
283 | 203 { |
204 LOG(INFO) << "Removing cache entry for " << value_; | |
205 log_ += boost::lexical_cast<std::string>(value_) + " "; | |
206 } | |
207 }; | |
208 | |
3557
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
209 class IntegerProvider : public Orthanc::Deprecated::ICachePageProvider |
283 | 210 { |
211 public: | |
212 std::string log_; | |
213 | |
2924
22524fd06225
macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
214 virtual Orthanc::IDynamicObject* Provide(const std::string& s) ORTHANC_OVERRIDE |
283 | 215 { |
216 LOG(INFO) << "Providing " << s; | |
217 return new Integer(log_, boost::lexical_cast<int>(s)); | |
218 } | |
282 | 219 }; |
220 } | |
283 | 221 |
222 | |
223 TEST(MemoryCache, Basic) | |
224 { | |
225 IntegerProvider provider; | |
226 | |
227 { | |
3557
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
228 Orthanc::Deprecated::MemoryCache cache(provider, 3); |
285
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
229 cache.Access("42"); // 42 -> exit |
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
230 cache.Access("43"); // 43, 42 -> exit |
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
231 cache.Access("45"); // 45, 43, 42 -> exit |
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
232 cache.Access("42"); // 42, 45, 43 -> exit |
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
233 cache.Access("43"); // 43, 42, 45 -> exit |
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
234 cache.Access("47"); // 45 is removed; 47, 43, 42 -> exit |
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
235 cache.Access("44"); // 42 is removed; 44, 47, 43 -> exit |
4031f73fe0e4
access to the raw dicom tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
284
diff
changeset
|
236 cache.Access("42"); // 43 is removed; 42, 44, 47 -> exit |
283 | 237 // Closing the cache: 47, 44, 42 are successively removed |
238 } | |
239 | |
240 ASSERT_EQ("45 42 43 47 44 42 ", provider.log_); | |
241 } | |
1367 | 242 |
243 | |
244 | |
245 | |
246 | |
247 namespace | |
248 { | |
249 class S : public Orthanc::IDynamicObject | |
250 { | |
251 private: | |
252 std::string value_; | |
253 | |
254 public: | |
4204 | 255 explicit S(const std::string& value) : value_(value) |
1367 | 256 { |
257 } | |
258 | |
259 const std::string& GetValue() const | |
260 { | |
261 return value_; | |
262 } | |
263 }; | |
264 } | |
265 | |
266 | |
267 TEST(LRU, SharedArchive) | |
268 { | |
269 std::string first, second; | |
270 Orthanc::SharedArchive a(3); | |
271 first = a.Add(new S("First item")); | |
272 second = a.Add(new S("Second item")); | |
273 | |
274 for (int i = 1; i < 100; i++) | |
275 { | |
276 a.Add(new S("Item " + boost::lexical_cast<std::string>(i))); | |
2976
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
277 |
1367 | 278 // Continuously protect the two first items |
2976
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
279 { |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
280 Orthanc::SharedArchive::Accessor accessor(a, first); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
281 ASSERT_TRUE(accessor.IsValid()); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
282 ASSERT_EQ("First item", dynamic_cast<S&>(accessor.GetItem()).GetValue()); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
283 } |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
284 |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
285 { |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
286 Orthanc::SharedArchive::Accessor accessor(a, second); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
287 ASSERT_TRUE(accessor.IsValid()); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
288 ASSERT_EQ("Second item", dynamic_cast<S&>(accessor.GetItem()).GetValue()); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
289 } |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
290 |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
291 { |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
292 Orthanc::SharedArchive::Accessor accessor(a, "nope"); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
293 ASSERT_FALSE(accessor.IsValid()); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
294 ASSERT_THROW(accessor.GetItem(), Orthanc::OrthancException); |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
295 } |
1367 | 296 } |
297 | |
298 std::list<std::string> i; | |
299 a.List(i); | |
300 | |
301 size_t count = 0; | |
302 for (std::list<std::string>::const_iterator | |
4204 | 303 it = i.begin(); it != i.end(); ++it) |
1367 | 304 { |
305 if (*it == first || | |
306 *it == second) | |
307 { | |
308 count++; | |
309 } | |
310 } | |
311 | |
1492 | 312 ASSERT_EQ(2u, count); |
1367 | 313 } |
3557
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
314 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
315 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
316 TEST(MemoryStringCache, Basic) |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
317 { |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
318 Orthanc::MemoryStringCache c; |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
319 ASSERT_THROW(c.SetMaximumSize(0), Orthanc::OrthancException); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
320 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
321 c.SetMaximumSize(2); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
322 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
323 std::string v; |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
324 ASSERT_FALSE(c.Fetch(v, "hello")); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
325 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
326 c.Add("hello", "a"); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
327 ASSERT_TRUE(c.Fetch(v, "hello")); ASSERT_EQ("a", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
328 ASSERT_FALSE(c.Fetch(v, "hello2")); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
329 ASSERT_FALSE(c.Fetch(v, "hello3")); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
330 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
331 c.Add("hello2", "b"); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
332 ASSERT_TRUE(c.Fetch(v, "hello")); ASSERT_EQ("a", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
333 ASSERT_TRUE(c.Fetch(v, "hello2")); ASSERT_EQ("b", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
334 ASSERT_FALSE(c.Fetch(v, "hello3")); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
335 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
336 c.Add("hello3", "too large value"); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
337 ASSERT_TRUE(c.Fetch(v, "hello")); ASSERT_EQ("a", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
338 ASSERT_TRUE(c.Fetch(v, "hello2")); ASSERT_EQ("b", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
339 ASSERT_FALSE(c.Fetch(v, "hello3")); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
340 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
341 c.Add("hello3", "c"); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
342 ASSERT_FALSE(c.Fetch(v, "hello")); // Recycled |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
343 ASSERT_TRUE(c.Fetch(v, "hello2")); ASSERT_EQ("b", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
344 ASSERT_TRUE(c.Fetch(v, "hello3")); ASSERT_EQ("c", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
345 } |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
346 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
347 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
348 TEST(MemoryStringCache, Invalidate) |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
349 { |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
350 Orthanc::MemoryStringCache c; |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
351 c.Add("hello", "a"); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
352 c.Add("hello2", "b"); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
353 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
354 std::string v; |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
355 ASSERT_TRUE(c.Fetch(v, "hello")); ASSERT_EQ("a", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
356 ASSERT_TRUE(c.Fetch(v, "hello2")); ASSERT_EQ("b", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
357 |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
358 c.Invalidate("hello"); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
359 ASSERT_FALSE(c.Fetch(v, "hello")); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
360 ASSERT_TRUE(c.Fetch(v, "hello2")); ASSERT_EQ("b", v); |
4d809b2e1141
better cache toolbox: MemoryObjectCache
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3497
diff
changeset
|
361 } |