comparison OrthancFramework/UnitTestsSources/ToolboxTests.cpp @ 4938:f630796a59b1 more-tags

ExpandResource now able to return computed tags (like ModalitiesInStudies)
author Alain Mazy <am@osimis.io>
date Mon, 14 Mar 2022 16:44:00 +0100
parents 8422e4f99a18
children 40fd2a485a84
comparison
equal deleted inserted replaced
4937:3f9b9865c8cc 4938:f630796a59b1
277 haystack.insert(6); 277 haystack.insert(6);
278 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack)); 278 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
279 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack)); 279 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
280 } 280 }
281 } 281 }
282
283 TEST(Toolbox, JoinStrings)
284 {
285 {
286 std::set<std::string> source;
287 std::string result;
288
289 Toolbox::JoinStrings(result, source, ";");
290 ASSERT_EQ("", result);
291 }
292
293 {
294 std::set<std::string> source;
295 source.insert("1");
296
297 std::string result;
298
299 Toolbox::JoinStrings(result, source, ";");
300 ASSERT_EQ("1", result);
301 }
302
303 {
304 std::set<std::string> source;
305 source.insert("2");
306 source.insert("1");
307
308 std::string result;
309
310 Toolbox::JoinStrings(result, source, ";");
311 ASSERT_EQ("1;2", result);
312 }
313
314 {
315 std::set<std::string> source;
316 source.insert("2");
317 source.insert("1");
318
319 std::string result;
320
321 Toolbox::JoinStrings(result, source, "\\");
322 ASSERT_EQ("1\\2", result);
323 }
324 }