Switch the logging tests from .native() to .string()
authorChristopher Dykes <cdykes@fb.com>
Fri, 23 Jun 2017 01:08:23 +0000 (18:08 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 23 Jun 2017 01:24:36 +0000 (18:24 -0700)
Summary: These were using `boost::filesystem::path.native()` in contexts where an `std::string` was the expected output. `boost::filesystem::path.native()` returns a `std::wstring` on Windows, so use `.string()` instead.

Reviewed By: simpkins

Differential Revision: D5305649

fbshipit-source-id: 3c7cd53d2f33d2dbb222731655cdab69d1c4a187

folly/experimental/logging/test/AsyncFileWriterTest.cpp
folly/experimental/logging/test/ImmediateFileWriterTest.cpp

index 3333c06..3879740 100644 (file)
@@ -88,7 +88,7 @@ TEST(AsyncFileWriter, simpleMessages) {
   }
 
   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 =
index cff7525..e52b62d 100644 (file)
@@ -40,7 +40,7 @@ TEST(ImmediateFileWriter, readBatch) {
 
   // 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 =
@@ -59,11 +59,11 @@ TEST(ImmediateFileWriter, readBatch) {
 
 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"));