comparison OrthancFramework/UnitTestsSources/ToolboxTests.cpp @ 4982:40fd2a485a84

fix build for older compilers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 25 Apr 2022 18:25:46 +0200
parents f630796a59b1
children 95d8e0540219
comparison
equal deleted inserted replaced
4981:d0c34145320c 4982:40fd2a485a84
216 std::set<int> needles; 216 std::set<int> needles;
217 std::set<int> haystack; 217 std::set<int> haystack;
218 std::set<int> missings; 218 std::set<int> missings;
219 219
220 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack)); 220 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
221 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack)); 221 ASSERT_EQ(0u, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
222 } 222 }
223 223
224 { 224 {
225 std::set<int> needles; 225 std::set<int> needles;
226 std::set<int> haystack; 226 std::set<int> haystack;
227 std::set<int> missings; 227 std::set<int> missings;
228 228
229 haystack.insert(5); 229 haystack.insert(5);
230 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack)); 230 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
231 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack)); 231 ASSERT_EQ(0u, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
232 } 232 }
233 233
234 { 234 {
235 std::set<int> needles; 235 std::set<int> needles;
236 std::set<int> haystack; 236 std::set<int> haystack;
237 std::set<int> missings; 237 std::set<int> missings;
238 238
239 needles.insert(5); 239 needles.insert(5);
240 haystack.insert(5); 240 haystack.insert(5);
241 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack)); 241 ASSERT_TRUE(Toolbox::IsSetInSet<int>(needles, haystack));
242 ASSERT_EQ(0, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack)); 242 ASSERT_EQ(0u, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
243 } 243 }
244 244
245 { 245 {
246 std::set<int> needles; 246 std::set<int> needles;
247 std::set<int> haystack; 247 std::set<int> haystack;
248 std::set<int> missings; 248 std::set<int> missings;
249 249
250 needles.insert(5); 250 needles.insert(5);
251 251
252 ASSERT_FALSE(Toolbox::IsSetInSet<int>(needles, haystack)); 252 ASSERT_FALSE(Toolbox::IsSetInSet<int>(needles, haystack));
253 ASSERT_EQ(1, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack)); 253 ASSERT_EQ(1u, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
254 ASSERT_TRUE(missings.count(5) == 1); 254 ASSERT_TRUE(missings.count(5) == 1);
255 } 255 }
256 256
257 { 257 {
258 std::set<int> needles; 258 std::set<int> needles;
260 std::set<int> missings; 260 std::set<int> missings;
261 261
262 needles.insert(6); 262 needles.insert(6);
263 haystack.insert(5); 263 haystack.insert(5);
264 ASSERT_FALSE(Toolbox::IsSetInSet<int>(needles, haystack)); 264 ASSERT_FALSE(Toolbox::IsSetInSet<int>(needles, haystack));
265 ASSERT_EQ(1, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack)); 265 ASSERT_EQ(1u, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
266 ASSERT_TRUE(missings.count(6) == 1); 266 ASSERT_TRUE(missings.count(6) == 1);
267 } 267 }
268 268
269 { 269 {
270 std::set<int> needles; 270 std::set<int> needles;
274 needles.insert(5); 274 needles.insert(5);
275 needles.insert(6); 275 needles.insert(6);
276 haystack.insert(5); 276 haystack.insert(5);
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(0u, Toolbox::GetMissingsFromSet<int>(missings, needles, haystack));
280 } 280 }
281 } 281 }
282 282
283 TEST(Toolbox, JoinStrings) 283 TEST(Toolbox, JoinStrings)
284 { 284 {