/*
- * Copyright 2004-present Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Read the log file and confirm it contains all of the expected messages
std::string data;
- auto ret = folly::readFile(tmpFile.path().native().c_str(), data);
+ auto ret = folly::readFile(tmpFile.path().string().c_str(), data);
ASSERT_TRUE(ret);
std::string expected =
TEST(ImmediateFileWriter, immediateRead) {
TemporaryFile tmpFile{"logging_test"};
- ImmediateFileWriter writer{tmpFile.path().native()};
+ ImmediateFileWriter writer{tmpFile.path().string()};
// Write several messages, and read each one back immediately
// after we write it.
- folly::File readf{tmpFile.path().native()};
+ folly::File readf{tmpFile.path().string()};
for (int n = 0; n < 10; ++n) {
writer.writeMessage(folly::to<std::string>("message ", n, "\n"));
std::string&& msg) {
internalWarnings->emplace_back(std::move(msg));
}
-}
+} // namespace
TEST(ImmediateFileWriter, ioError) {
std::array<int, 2> fds;