From 2e52104328bbbba3bc27b1ed607bfd62d636b9f3 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Fri, 15 Jul 2016 13:16:45 -0700 Subject: [PATCH] Fix the base gen test with GTest 1.7 Summary: Becuase it has bugs that cause the compiler to error :( Reviewed By: ericniebler Differential Revision: D3571263 fbshipit-source-id: 9a17fc2c3c7344c3532df33cd4b84517c97d8efc --- folly/gen/test/BaseTest.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/folly/gen/test/BaseTest.cpp b/folly/gen/test/BaseTest.cpp index b8dc807a..fa5bcecb 100644 --- a/folly/gen/test/BaseTest.cpp +++ b/folly/gen/test/BaseTest.cpp @@ -1231,17 +1231,17 @@ TEST(Gen, Unwrap) { auto oup = folly::make_optional(folly::make_unique(5)); // optional has a value, and that value is non-null - EXPECT_TRUE(oup | unwrap); + EXPECT_TRUE(bool(oup | unwrap)); EXPECT_EQ(5, *(oup | unwrap)); EXPECT_TRUE(oup.hasValue()); // still has a pointer (null or not) - EXPECT_TRUE(oup.value()); // that value isn't null + EXPECT_TRUE(bool(oup.value())); // that value isn't null auto moved1 = std::move(oup) | unwrapOr(folly::make_unique(6)); // oup still has a value, but now it's now nullptr since the pointer was moved // into moved1 EXPECT_TRUE(oup.hasValue()); EXPECT_FALSE(oup.value()); - EXPECT_TRUE(moved1); + EXPECT_TRUE(bool(moved1)); EXPECT_EQ(5, *moved1); auto moved2 = std::move(oup) | unwrapOr(folly::make_unique(7)); @@ -1251,7 +1251,7 @@ TEST(Gen, Unwrap) { oup.clear(); auto moved3 = std::move(oup) | unwrapOr(folly::make_unique(8)); // oup is empty now, so the unwrapOr comes into play. - EXPECT_TRUE(moved3); + EXPECT_TRUE(bool(moved3)); EXPECT_EQ(8, *moved3); { @@ -1290,14 +1290,14 @@ TEST(Gen, Unwrap) { auto fallback = unwrapOr(folly::make_unique(9)); // fallback must be std::move'd to be used EXPECT_EQ(8, *(opt | std::move(fallback))); - EXPECT_TRUE(opt.value()); // shared_ptr copied out, not moved - EXPECT_TRUE(opt); // value still present - EXPECT_TRUE(fallback.value()); // fallback value not needed + EXPECT_TRUE(bool(opt.value())); // shared_ptr copied out, not moved + EXPECT_TRUE(bool(opt)); // value still present + EXPECT_TRUE(bool(fallback.value())); // fallback value not needed EXPECT_EQ(8, *(std::move(opt) | std::move(fallback))); EXPECT_FALSE(opt.value()); // shared_ptr moved out - EXPECT_TRUE(opt); // gutted value still present - EXPECT_TRUE(fallback.value()); // fallback value not needed + EXPECT_TRUE(bool(opt)); // gutted value still present + EXPECT_TRUE(bool(fallback.value())); // fallback value not needed opt.clear(); -- 2.34.1