comparison OrthancFramework/UnitTestsSources/ToolboxTests.cpp @ 4936:8422e4f99a18 more-tags

Handling RequestedTags in ExpandResource -> read parent main dicom tags if required. Not yet getting missing tags from file. Integration tests ok
author Alain Mazy <am@osimis.io>
date Fri, 11 Mar 2022 17:38:16 +0100
parents 43e613a7756b
children f630796a59b1
comparison
equal deleted inserted replaced
4935:acd3f72e2a21 4936:8422e4f99a18
207 ASSERT_EQ(42, *i); 207 ASSERT_EQ(42, *i);
208 208
209 std::unique_ptr<SingleValueObject<int> > j(new SingleValueObject<int>(42)); 209 std::unique_ptr<SingleValueObject<int> > j(new SingleValueObject<int>(42));
210 ASSERT_EQ(42, j->GetValue()); 210 ASSERT_EQ(42, j->GetValue());
211 } 211 }
212
213 TEST(Toolbox, IsSetInSet)
214 {
215 {
216 std::set<int> needles;
217 std::set<int> haystack;
218 std::set<int> missings;
219
220 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
221 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
222 }
223
224 {
225 std::set<int> needles;
226 std::set<int> haystack;
227 std::set<int> missings;
228
229 haystack.insert(5);
230 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
231 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
232 }
233
234 {
235 std::set<int> needles;
236 std::set<int> haystack;
237 std::set<int> missings;
238
239 needles.insert(5);
240 haystack.insert(5);
241 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
242 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
243 }
244
245 {
246 std::set<int> needles;
247 std::set<int> haystack;
248 std::set<int> missings;
249
250 needles.insert(5);
251
252 ASSERT_FALSE(Toolbox::IsSetInSet<int>(needles, haystack));
253 ASSERT_EQ(1, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
254 ASSERT_TRUE(missings.count(5) == 1);
255 }
256
257 {
258 std::set<int> needles;
259 std::set<int> haystack;
260 std::set<int> missings;
261
262 needles.insert(6);
263 haystack.insert(5);
264 ASSERT_FALSE(Toolbox::IsSetInSet<int>(needles, haystack));
265 ASSERT_EQ(1, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
266 ASSERT_TRUE(missings.count(6) == 1);
267 }
268
269 {
270 std::set<int> needles;
271 std::set<int> haystack;
272 std::set<int> missings;
273
274 needles.insert(5);
275 needles.insert(6);
276 haystack.insert(5);
277 haystack.insert(6);
278 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
279 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
280 }
281 }