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_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 << "'";
}
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);
}
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(
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); };
enum LockMode { EXCLUSIVE, SHARED };
auto testLock = [&](LockMode mode, bool expectedSuccess) {
- auto ret = Subprocess({helper.native(),
+ auto ret = Subprocess({helper.string(),
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());