From 6bc33db2cdeeb1e26e32a3f89a061dbdb4121674 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Fri, 15 Jul 2016 15:42:01 -0700 Subject: [PATCH] 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 --- folly/test/SynchronizedTestLib-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } } -- 2.34.1