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 3333c0657b4f45131ae2408fd8184cb20266e361..3879740444b3ff124e363442a0eeb3acad4cb06b 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 cff7525f02023998b934bacbc307a88b4ae40cfc..e52b62df23f7530e89e0a876f3263cffc9a43f10 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"));