From: Andrey Goder Date: Wed, 1 Jul 2015 17:37:34 +0000 (-0700) Subject: fix? AutoTimerTest X-Git-Tag: v0.49.0~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cd927a9e490c4bef6b9d113e35b4337fb500a542;p=folly.git fix? AutoTimerTest Summary: Apparently this test sometimes fails. @Gownta suggests it's because we're storing temproaries in StringPiece. Change it to store in a std::string, which should hopefully fix it. Reviewed By: @Gownta Differential Revision: D2208643 --- diff --git a/folly/experimental/test/AutoTimerTest.cpp b/folly/experimental/test/AutoTimerTest.cpp index 2c54a04a..e7ce057a 100644 --- a/folly/experimental/test/AutoTimerTest.cpp +++ b/folly/experimental/test/AutoTimerTest.cpp @@ -22,14 +22,14 @@ using namespace std; struct StubLogger { void operator()(StringPiece msg, double sec) { - m = msg; + m = msg.str(); t = sec; } - static StringPiece m; + static std::string m; static double t; }; -StringPiece StubLogger::m = ""; +std::string StubLogger::m = ""; double StubLogger::t = 0; struct StubClock {