From d4e51b57186c30a66318ff14de720eea069b141e Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Thu, 22 Jun 2017 18:08:23 -0700 Subject: [PATCH] Switch the logging tests from .native() to .string() 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 | 2 +- folly/experimental/logging/test/ImmediateFileWriterTest.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/folly/experimental/logging/test/AsyncFileWriterTest.cpp b/folly/experimental/logging/test/AsyncFileWriterTest.cpp index 3333c065..38797404 100644 --- a/folly/experimental/logging/test/AsyncFileWriterTest.cpp +++ b/folly/experimental/logging/test/AsyncFileWriterTest.cpp @@ -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 = diff --git a/folly/experimental/logging/test/ImmediateFileWriterTest.cpp b/folly/experimental/logging/test/ImmediateFileWriterTest.cpp index cff7525f..e52b62df 100644 --- a/folly/experimental/logging/test/ImmediateFileWriterTest.cpp +++ b/folly/experimental/logging/test/ImmediateFileWriterTest.cpp @@ -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("message ", n, "\n")); -- 2.34.1