From: Jim Meyering Date: Mon, 8 May 2017 23:41:07 +0000 (-0700) Subject: change EXPECT_EQ(false, ... to EXPECT_FALSE(...; ditto for true/EXPECT_TRUE X-Git-Tag: v2017.05.15.00~23 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=fea92be9924a6470a9958a77e7b634c2c2ffbe5b change EXPECT_EQ(false, ... to EXPECT_FALSE(...; ditto for true/EXPECT_TRUE Summary: Change every instance of EXPECT_EQ(false, ... to the simpler/shorter EXPECT_FALSE(... Likewise, convert each EXPECT_EQ(true, ... to EXPECT_TRUE(... Differential Revision: D5019004 fbshipit-source-id: 0203f10fa47237f869a75a057ac4456ef03e1f53 --- diff --git a/folly/test/ApplyTupleTest.cpp b/folly/test/ApplyTupleTest.cpp index 56f4c651..d18e2408 100644 --- a/folly/test/ApplyTupleTest.cpp +++ b/folly/test/ApplyTupleTest.cpp @@ -153,10 +153,11 @@ TEST(ApplyTuple, Test) { folly::applyTuple( static_cast(&Overloaded::func), std::make_tuple(&ovl, 12))); - EXPECT_EQ(true, - folly::applyTuple( - static_cast(&Overloaded::func), - std::make_tuple(&ovl, false))); + EXPECT_EQ( + /* do not code-mode to EXPECT_TRUE */ true, + folly::applyTuple( + static_cast(&Overloaded::func), + std::make_tuple(&ovl, false))); int x = folly::applyTuple(std::plus(), std::make_tuple(12, 12)); EXPECT_EQ(24, x); diff --git a/folly/test/ExceptionWrapperTest.cpp b/folly/test/ExceptionWrapperTest.cpp index 852f1f6f..67f14c5e 100644 --- a/folly/test/ExceptionWrapperTest.cpp +++ b/folly/test/ExceptionWrapperTest.cpp @@ -494,13 +494,13 @@ TEST(ExceptionWrapper, handle_std_exception) { }; expect_runtime_error_yes_catch_all(ew_eptr); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_runtime_error_yes_catch_all(ew_small); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_runtime_error_yes_catch_all(ew_big); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; auto expect_runtime_error_no_catch_all = [&](const exception_wrapper& ew) { @@ -511,13 +511,13 @@ TEST(ExceptionWrapper, handle_std_exception) { }; expect_runtime_error_no_catch_all(ew_eptr); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_runtime_error_no_catch_all(ew_small); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_runtime_error_no_catch_all(ew_big); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; auto expect_runtime_error_catch_non_std = [&](const exception_wrapper& ew) { @@ -529,13 +529,13 @@ TEST(ExceptionWrapper, handle_std_exception) { }; expect_runtime_error_catch_non_std(ew_eptr); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_runtime_error_catch_non_std(ew_small); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_runtime_error_catch_non_std(ew_big); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; // Test that an exception thrown from one handler is not caught by an @@ -551,13 +551,13 @@ TEST(ExceptionWrapper, handle_std_exception) { }; EXPECT_THROW(expect_runtime_error_rethrow(ew_eptr), std::runtime_error); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; EXPECT_THROW(expect_runtime_error_rethrow(ew_small), std::runtime_error); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; EXPECT_THROW(expect_runtime_error_rethrow(ew_big), std::runtime_error); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); } TEST(ExceptionWrapper, handle_std_exception_unhandled) { @@ -574,10 +574,10 @@ TEST(ExceptionWrapper, handle_std_exception_unhandled) { }; expect_runtime_error_yes_catch_all(ew_eptr); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_runtime_error_yes_catch_all(ew_small); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); } TEST(ExceptionWrapper, handle_non_std_exception_small) { @@ -594,13 +594,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_small) { }; expect_int_yes_catch_all(ew_eptr1); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_yes_catch_all(ew_eptr2); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_yes_catch_all(ew_small); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; auto expect_int_no_catch_all = [&](const exception_wrapper& ew) { @@ -610,13 +610,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_small) { }; expect_int_no_catch_all(ew_eptr1); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all(ew_eptr2); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all(ew_small); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) { @@ -626,13 +626,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_small) { }; expect_int_no_catch_all_2(ew_eptr1); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all_2(ew_eptr2); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all_2(ew_small); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); } TEST(ExceptionWrapper, handle_non_std_exception_big) { @@ -649,13 +649,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_big) { }; expect_int_yes_catch_all(ew_eptr1); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_yes_catch_all(ew_eptr2); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_yes_catch_all(ew_big); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; auto expect_int_no_catch_all = [&](const exception_wrapper& ew) { @@ -665,13 +665,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_big) { }; expect_int_no_catch_all(ew_eptr1); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all(ew_eptr2); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all(ew_big); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) { @@ -681,13 +681,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_big) { }; expect_int_no_catch_all_2(ew_eptr1); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all_2(ew_eptr2); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; expect_int_no_catch_all_2(ew_big); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; EXPECT_THROW( @@ -705,7 +705,7 @@ TEST(ExceptionWrapper, handle_non_std_exception_rethrow_base_derived) { }, [](const BaseException&) { EXPECT_TRUE(false); }), DerivedException); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); handled = false; EXPECT_THROW( ew.handle( @@ -715,7 +715,7 @@ TEST(ExceptionWrapper, handle_non_std_exception_rethrow_base_derived) { }, [](...) { EXPECT_TRUE(false); }), DerivedException); - EXPECT_EQ(true, handled); + EXPECT_TRUE(handled); } TEST(ExceptionWrapper, self_swap_test) {