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

Function testStaticModifiers

Tests/CMakeLib/testList.cxx:799–951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799bool testStaticModifiers()
800{
801 std::cout << "testStaticModifiers()";
802
803 bool result = true;
804
805 {
806 std::vector<std::string> v{ "a", "b", "c" };
807 cmList::assign(v, "d;e"_s);
808
809 if (v.size() != 2 || v[0] != "d" || v[1] != "e") {
810 result = false;
811 }
812 }
813 {
814 std::vector<std::string> v{ "a", "b", "c" };
815 cmList::append(v, "d;;e"_s);
816
817 if (v.size() != 5 || v[3] != "d" || v[4] != "e") {
818 result = false;
819 }
820 }
821 {
822 std::vector<std::string> v{ "a", "b", "c" };
823 cmList::append(v, "d;;e"_s, cmList::EmptyElements::Yes);
824
825 if (v.size() != 6 || v[3] != "d" || !v[4].empty() || v[5] != "e") {
826 result = false;
827 }
828 }
829 {
830 std::vector<std::string> v{ "a", "b", "c" };
831 cmList::prepend(v, "d;e"_s);
832
833 if (v.size() != 5 || v[0] != "d" || v[1] != "e") {
834 result = false;
835 }
836 }
837 {
838 std::vector<std::string> v{ "a", "b", "c" };
839 cmList::prepend(v, "d;;e"_s, cmList::EmptyElements::Yes);
840
841 if (v.size() != 6 || v[0] != "d" || !v[1].empty() || v[2] != "e") {
842 result = false;
843 }
844 }
845 {
846 std::string list{ "a;b;c" };
847 cmList::append(list, "d;e"_s);
848
849 if (list != "a;b;c;d;e") {
850 result = false;
851 }
852 }
853 {
854 std::string list;
855 cmList::append(list, "d;e"_s);
856

Callers

nothing calls this directly

Calls 6

appendFunction · 0.85
checkResultFunction · 0.70
sizeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…