MCPcopy Create free account
hub / github.com/Kitware/CMake / testModifiers

Function testModifiers

Tests/CMakeLib/testList.cxx:337–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337bool testModifiers()
338{
339 std::cout << "testModifiers()";
340
341 bool result = true;
342
343 {
344 cmList list{ "1;2;3;4;5" };
345
346 auto it = list.insert(list.begin() + 2, "6;7;8"_s);
347 if (list.size() != 8 || list.to_string() != "1;2;6;7;8;3;4;5") {
348 result = false;
349 }
350 if (*it != "6") {
351 result = false;
352 }
353 }
354 {
355 cmList list{ "1;2;3;4;5" };
356
357 auto it =
358 list.insert(list.begin() + 2, "6;7;8"_s, cmList::ExpandElements::No);
359 if (list.size() != 6 || list.to_string() != "1;2;6;7;8;3;4;5") {
360 result = false;
361 }
362 if (*it != "6;7;8") {
363 result = false;
364 }
365 }
366 {
367 cmList list{ "1;2;3;4;5" };
368 cmList v{ "6", "7", "8" };
369
370 auto it = list.insert(list.begin() + 2, v);
371 if (list.size() != 8 || list.to_string() != "1;2;6;7;8;3;4;5") {
372 result = false;
373 }
374 if (*it != "6") {
375 result = false;
376 }
377 }
378 {
379 cmList list{ "1;2;3;4;5" };
380 cmList v{ "6", "7", "8" };
381
382 auto it = list.insert(list.begin() + 2, std::move(v));
383 if (list.size() != 8 || list.to_string() != "1;2;6;7;8;3;4;5") {
384 result = false;
385 }
386 if (*it != "6") {
387 result = false;
388 }
389
390 if (!v.empty()) {
391 result = false;
392 }
393 }
394 {

Callers

nothing calls this directly

Calls 7

moveFunction · 0.85
to_stringMethod · 0.80
checkResultFunction · 0.70
insertMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…