From: Christopher Dykes Date: Fri, 23 Jun 2017 02:55:36 +0000 (-0700) Subject: Fix GlogFormatterTest on Windows X-Git-Tag: v2017.06.26.00~10 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=297d72d1ee6b5b8e70a6f61224f44b275e155bc3;p=folly.git 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 --- 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()};