From 297d72d1ee6b5b8e70a6f61224f44b275e155bc3 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Thu, 22 Jun 2017 19:55:36 -0700 Subject: [PATCH] Fix GlogFormatterTest on Windows Summary: It was missing a portability header needed for `setenv`, and was assuming that the `system_clock` was represented as nanoseconds. On Windows `std::chrono::system_clock` is represented as 100s of nanoseconds, ie. `FILETIME`. Reviewed By: simpkins Differential Revision: D5308182 fbshipit-source-id: facb922ebe1587723358b38499dadac683e3517b --- folly/experimental/logging/test/GlogFormatterTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/folly/experimental/logging/test/GlogFormatterTest.cpp b/folly/experimental/logging/test/GlogFormatterTest.cpp index 067fcb10..a10c380a 100644 --- a/folly/experimental/logging/test/GlogFormatterTest.cpp +++ b/folly/experimental/logging/test/GlogFormatterTest.cpp @@ -21,6 +21,7 @@ #include #include #include +#include using namespace folly; @@ -47,7 +48,8 @@ std::string formatMsg( GlogStyleFormatter formatter; std::chrono::system_clock::time_point logTimePoint{ - std::chrono::nanoseconds{timestampNS}}; + std::chrono::duration_cast( + std::chrono::nanoseconds{timestampNS})}; LogMessage logMessage{ category, level, logTimePoint, filename, lineNumber, msg.str()}; -- 2.34.1