Summary: Which means `.native()` returns a `wstring`, and `.c_str()` returns a `wchar_t*`. As we're using them in places expecting a `char*`, convert to `string` first.
Reviewed By: yfeldblum
Differential Revision:
D3506911
fbshipit-source-id:
ca34b9888f98106914438490bbd860f9b922ad5e
EXPECT_TRUE(fs::is_directory(path));
fs::path fp = path / "bar";
EXPECT_TRUE(fs::is_directory(path));
fs::path fp = path / "bar";
- int fd = open(fp.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0666);
+ int fd = open(fp.string().c_str(), O_RDWR | O_CREAT | O_TRUNC, 0666);
EXPECT_NE(fd, -1);
close(fd);
EXPECT_NE(fd, -1);
close(fd);
EXPECT_EQ(lines.size(), write(file.fd(), lines.data(), lines.size()));
auto expected = from({lines}) | resplit('\n') | collect;
EXPECT_EQ(lines.size(), write(file.fd(), lines.data(), lines.size()));
auto expected = from({lines}) | resplit('\n') | collect;
- auto found = byLine(file.path().c_str()) | collect;
+ auto found = byLine(file.path().string().c_str()) | collect;
EXPECT_EQ(expected, found) << "For Input: '" << lines << "'";
}
EXPECT_EQ(expected, found) << "For Input: '" << lines << "'";
}
auto expected = src | resplit('\n') | collect;
src | eachAs<StringPiece>() | toFile(File(file.fd()), bufferSize);
auto expected = src | resplit('\n') | collect;
src | eachAs<StringPiece>() | toFile(File(file.fd()), bufferSize);
- auto found = byLine(file.path().c_str()) | collect;
+ auto found = byLine(file.path().string().c_str()) | collect;
EXPECT_TRUE(expected == found);
}
EXPECT_TRUE(expected == found);
}
auto squares = seq(1, 100) | map([](int x) { return x * x; });
squares | map(toLine) | eachAs<StringPiece>() | toFile(File(file.fd()));
EXPECT_EQ(squares | sum,
auto squares = seq(1, 100) | map([](int x) { return x * x; });
squares | map(toLine) | eachAs<StringPiece>() | toFile(File(file.fd()));
EXPECT_EQ(squares | sum,
- byLine(File(file.path().c_str())) | eachTo<int>() | sum);
+ byLine(File(file.path().string().c_str())) | eachTo<int>() | sum);
}
INSTANTIATE_TEST_CASE_P(
}
INSTANTIATE_TEST_CASE_P(
TemporaryDirectory tmpdir;
auto exnpath = tmpdir.path() / "ExceptionTest";
TemporaryDirectory tmpdir;
auto exnpath = tmpdir.path() / "ExceptionTest";
- auto fp = fopen(exnpath.c_str(), "w+b");
+ auto fp = fopen(exnpath.string().c_str(), "w+b");
ASSERT_TRUE(fp != nullptr);
SCOPE_EXIT { fclose(fp); };
ASSERT_TRUE(fp != nullptr);
SCOPE_EXIT { fclose(fp); };
enum LockMode { EXCLUSIVE, SHARED };
auto testLock = [&](LockMode mode, bool expectedSuccess) {
enum LockMode { EXCLUSIVE, SHARED };
auto testLock = [&](LockMode mode, bool expectedSuccess) {
- auto ret = Subprocess({helper.native(),
+ auto ret = Subprocess({helper.string(),
mode == SHARED ? "-s" : "-x",
mode == SHARED ? "-s" : "-x",
- tempFile.path().native()}).wait();
+ tempFile.path().string()}).wait();
EXPECT_TRUE(ret.exited());
if (ret.exited()) {
EXPECT_EQ(expectedSuccess ? 0 : 42, ret.exitStatus());
EXPECT_TRUE(ret.exited());
if (ret.exited()) {
EXPECT_EQ(expectedSuccess ? 0 : 42, ret.exitStatus());