Make Synchronized tests work with gtest-1.7
authorEric Niebler <eniebler@fb.com>
Fri, 15 Jul 2016 22:42:01 +0000 (15:42 -0700)
committerFacebook Github Bot 9 <facebook-github-bot-9-bot@fb.com>
Fri, 15 Jul 2016 22:53:25 +0000 (15:53 -0700)
Summary: Gtest-1.7's ASSERT macros don't work with types with explicit conversions to bool, so do the cast for it.

Reviewed By: yfeldblum

Differential Revision: D3570782

fbshipit-source-id: 885a1022675e63afca00219c5b9de3791742207f

folly/test/SynchronizedTestLib-inl.h

index d4e027cfc4a0da7e3f4a6b3db1ebc83b3f94f6b7..99968fd93ac0795b3a8313527b6bf1b204aa79a3 100644 (file)
@@ -598,7 +598,7 @@ void testTimed() {
   // Make sure we can lock with various timeout duration units
   {
     auto lv = v.contextualLock(std::chrono::milliseconds(5));
-    EXPECT_TRUE(lv);
+    EXPECT_TRUE(bool(lv));
     EXPECT_FALSE(lv.isNull());
     auto lv2 = v.contextualLock(std::chrono::microseconds(5));
     // We may or may not acquire lv2 successfully, depending on whether
@@ -606,7 +606,7 @@ void testTimed() {
   }
   {
     auto lv = v.contextualLock(std::chrono::seconds(1));
-    EXPECT_TRUE(lv);
+    EXPECT_TRUE(bool(lv));
   }
 }