From: Eric Niebler Date: Fri, 15 Jul 2016 22:42:01 +0000 (-0700) Subject: Make Synchronized tests work with gtest-1.7 X-Git-Tag: 2016.07.26~45 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6bc33db2cdeeb1e26e32a3f89a061dbdb4121674;p=folly.git Make Synchronized tests work with gtest-1.7 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 --- diff --git a/folly/test/SynchronizedTestLib-inl.h b/folly/test/SynchronizedTestLib-inl.h index d4e027cf..99968fd9 100644 --- a/folly/test/SynchronizedTestLib-inl.h +++ b/folly/test/SynchronizedTestLib-inl.h @@ -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)); } }