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

Function testObservers

Tests/CMakeLib/testCMFilesystemPath.cxx:260–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260bool testObservers()
261{
262 std::cout << "testObservers()";
263
264 bool result = true;
265
266 {
267 std::string s("a/b/c");
268 fs::path p(s);
269 fs::path::string_type st;
270 for (auto c : s) {
271 st += static_cast<fs::path::value_type>(c);
272 }
273 if (p.native() != st || static_cast<fs::path::string_type>(p) != st ||
274 p.c_str() != st) {
275 result = false;
276 }
277 }
278 {
279 std::string s("a//b//c");
280 std::wstring ws(L"a//b//c");
281 fs::path p(s);
282 if (p.string() != s || p.wstring() != ws) {
283 result = false;
284 }
285 }
286 {
287 std::string s("a/b/c");
288 std::wstring ws;
289 for (auto c : s) {
290 ws += static_cast<std::wstring::value_type>(c);
291 }
292 std::string ns(s);
293 std::replace(
294 ns.begin(), ns.end(), '/',
295 static_cast<std::string::value_type>(fs::path::preferred_separator));
296 fs::path p(ns);
297 if (p.generic_string() != s || p.generic_wstring() != ws) {
298 result = false;
299 }
300 }
301
302 checkResult(result);
303
304 return result;
305}
306
307bool testCompare()
308{

Callers

nothing calls this directly

Calls 5

c_strMethod · 0.80
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…