MCPcopy Create free account
hub / github.com/apple/foundationdb / platformSpecificDirectoryOpsTests

Function platformSpecificDirectoryOpsTests

flow/Platform.actor.cpp:4093–4146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4091
4092#ifndef _WIN32
4093void platformSpecificDirectoryOpsTests(const std::string& cwd, int& errors) {
4094 // Create some symlinks and test resolution (or non-resolution) of them
4095 ASSERT(symlink("one/two", "simfdb/backups/four") == 0);
4096 ASSERT(symlink("../backups/four", "simfdb/backups/five") == 0);
4097
4098 errors += testPathFunction2(
4099 "abspath", abspath, "simfdb/backups/four/../two", true, true, joinPath(cwd, "simfdb/backups/one/two"));
4100 errors += testPathFunction2(
4101 "abspath", abspath, "simfdb/backups/five/../two", true, true, joinPath(cwd, "simfdb/backups/one/two"));
4102 errors += testPathFunction2(
4103 "abspath", abspath, "simfdb/backups/five/../two", true, false, joinPath(cwd, "simfdb/backups/one/two"));
4104 errors += testPathFunction2("abspath", abspath, "simfdb/backups/five/../three", true, true, platform_error());
4105 errors += testPathFunction2(
4106 "abspath", abspath, "simfdb/backups/five/../three", true, false, joinPath(cwd, "simfdb/backups/one/three"));
4107 errors += testPathFunction2("abspath",
4108 abspath,
4109 "simfdb/backups/five/../three/../four",
4110 true,
4111 false,
4112 joinPath(cwd, "simfdb/backups/one/four"));
4113
4114 errors += testPathFunction2("parentDirectory",
4115 parentDirectory,
4116 "simfdb/backups/four/../two",
4117 true,
4118 true,
4119 joinPath(cwd, "simfdb/backups/one/"));
4120 errors += testPathFunction2("parentDirectory",
4121 parentDirectory,
4122 "simfdb/backups/five/../two",
4123 true,
4124 true,
4125 joinPath(cwd, "simfdb/backups/one/"));
4126 errors += testPathFunction2("parentDirectory",
4127 parentDirectory,
4128 "simfdb/backups/five/../two",
4129 true,
4130 false,
4131 joinPath(cwd, "simfdb/backups/one/"));
4132 errors += testPathFunction2(
4133 "parentDirectory", parentDirectory, "simfdb/backups/five/../three", true, true, platform_error());
4134 errors += testPathFunction2("parentDirectory",
4135 parentDirectory,
4136 "simfdb/backups/five/../three",
4137 true,
4138 false,
4139 joinPath(cwd, "simfdb/backups/one/"));
4140 errors += testPathFunction2("parentDirectory",
4141 parentDirectory,
4142 "simfdb/backups/five/../three/../four",
4143 true,
4144 false,
4145 joinPath(cwd, "simfdb/backups/one/"));
4146}
4147#else
4148void platformSpecificDirectoryOpsTests(const std::string& cwd, int& errors) {}
4149#endif

Callers 1

Platform.actor.cppFile · 0.85

Calls 3

symlinkFunction · 0.85
testPathFunction2Function · 0.70
joinPathFunction · 0.70

Tested by

no test coverage detected