fix? AutoTimerTest
authorAndrey Goder <agoder@fb.com>
Wed, 1 Jul 2015 17:37:34 +0000 (10:37 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 1 Jul 2015 23:24:53 +0000 (16:24 -0700)
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

folly/experimental/test/AutoTimerTest.cpp

index 2c54a04aab9059d2712ec145675893f33a495690..e7ce057af8f1a20f426e69f070e6ef593473441f 100644 (file)
@@ -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 {