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

Function testConstructors

Tests/CMakeLib/testCMFilesystemPath.cxx:25–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25bool testConstructors()
26{
27 std::cout << "testConstructors()";
28
29 bool result = true;
30
31 {
32 fs::path p;
33 if (p != fs::path()) {
34 result = false;
35 }
36 }
37 {
38 fs::path p1("/a/b/c");
39 fs::path p2("/a/b/c");
40 if (p1 != p2) {
41 result = false;
42 }
43 if (p1.string() != p2.string()) {
44 result = false;
45 }
46 if (p1.string() != "/a/b/c") {
47 result = false;
48 }
49 }
50 {
51 std::string s("/a/b/c");
52 fs::path p1(s);
53 fs::path p2(s.begin(), s.end());
54 if (p1 != p2) {
55 result = false;
56 }
57 if (p1.string() != s || p2.string() != s) {
58 result = false;
59 }
60#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR
61 std::string s2(s);
62 s2 += '\0';
63 fs::path p3(s2.begin());
64 if (p1 != p3 || p3.string() != s) {
65 result = false;
66 }
67#endif
68 }
69 {
70 std::wstring s(L"/a/b/c");
71 fs::path p1(s);
72 fs::path p2(s.begin(), s.end());
73 if (p1 != p2) {
74 result = false;
75 }
76 if (p1.wstring() != s || p2.wstring() != s) {
77 result = false;
78 }
79#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR
80 std::wstring s2(s);
81 s2 += L'\0';
82 fs::path p3(s2.begin());

Callers

nothing calls this directly

Calls 4

checkResultFunction · 0.70
stringMethod · 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…