Commit fea92be9 authored by Jim Meyering's avatar Jim Meyering Committed by Facebook Github Bot

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
parent 6b1a43fd
...@@ -153,7 +153,8 @@ TEST(ApplyTuple, Test) { ...@@ -153,7 +153,8 @@ TEST(ApplyTuple, Test) {
folly::applyTuple( folly::applyTuple(
static_cast<int (Overloaded::*)(int)>(&Overloaded::func), static_cast<int (Overloaded::*)(int)>(&Overloaded::func),
std::make_tuple(&ovl, 12))); std::make_tuple(&ovl, 12)));
EXPECT_EQ(true, EXPECT_EQ(
/* do not code-mode to EXPECT_TRUE */ true,
folly::applyTuple( folly::applyTuple(
static_cast<bool (Overloaded::*)(bool)>(&Overloaded::func), static_cast<bool (Overloaded::*)(bool)>(&Overloaded::func),
std::make_tuple(&ovl, false))); std::make_tuple(&ovl, false)));
......
...@@ -494,13 +494,13 @@ TEST(ExceptionWrapper, handle_std_exception) { ...@@ -494,13 +494,13 @@ TEST(ExceptionWrapper, handle_std_exception) {
}; };
expect_runtime_error_yes_catch_all(ew_eptr); expect_runtime_error_yes_catch_all(ew_eptr);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_runtime_error_yes_catch_all(ew_small); expect_runtime_error_yes_catch_all(ew_small);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_runtime_error_yes_catch_all(ew_big); expect_runtime_error_yes_catch_all(ew_big);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
auto expect_runtime_error_no_catch_all = [&](const exception_wrapper& ew) { auto expect_runtime_error_no_catch_all = [&](const exception_wrapper& ew) {
...@@ -511,13 +511,13 @@ TEST(ExceptionWrapper, handle_std_exception) { ...@@ -511,13 +511,13 @@ TEST(ExceptionWrapper, handle_std_exception) {
}; };
expect_runtime_error_no_catch_all(ew_eptr); expect_runtime_error_no_catch_all(ew_eptr);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_runtime_error_no_catch_all(ew_small); expect_runtime_error_no_catch_all(ew_small);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_runtime_error_no_catch_all(ew_big); expect_runtime_error_no_catch_all(ew_big);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
auto expect_runtime_error_catch_non_std = [&](const exception_wrapper& ew) { auto expect_runtime_error_catch_non_std = [&](const exception_wrapper& ew) {
...@@ -529,13 +529,13 @@ TEST(ExceptionWrapper, handle_std_exception) { ...@@ -529,13 +529,13 @@ TEST(ExceptionWrapper, handle_std_exception) {
}; };
expect_runtime_error_catch_non_std(ew_eptr); expect_runtime_error_catch_non_std(ew_eptr);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_runtime_error_catch_non_std(ew_small); expect_runtime_error_catch_non_std(ew_small);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_runtime_error_catch_non_std(ew_big); expect_runtime_error_catch_non_std(ew_big);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
// Test that an exception thrown from one handler is not caught by an // Test that an exception thrown from one handler is not caught by an
...@@ -551,13 +551,13 @@ TEST(ExceptionWrapper, handle_std_exception) { ...@@ -551,13 +551,13 @@ TEST(ExceptionWrapper, handle_std_exception) {
}; };
EXPECT_THROW(expect_runtime_error_rethrow(ew_eptr), std::runtime_error); EXPECT_THROW(expect_runtime_error_rethrow(ew_eptr), std::runtime_error);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
EXPECT_THROW(expect_runtime_error_rethrow(ew_small), std::runtime_error); EXPECT_THROW(expect_runtime_error_rethrow(ew_small), std::runtime_error);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
EXPECT_THROW(expect_runtime_error_rethrow(ew_big), std::runtime_error); EXPECT_THROW(expect_runtime_error_rethrow(ew_big), std::runtime_error);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
} }
TEST(ExceptionWrapper, handle_std_exception_unhandled) { TEST(ExceptionWrapper, handle_std_exception_unhandled) {
...@@ -574,10 +574,10 @@ 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_runtime_error_yes_catch_all(ew_eptr);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_runtime_error_yes_catch_all(ew_small); expect_runtime_error_yes_catch_all(ew_small);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
} }
TEST(ExceptionWrapper, handle_non_std_exception_small) { TEST(ExceptionWrapper, handle_non_std_exception_small) {
...@@ -594,13 +594,13 @@ 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_int_yes_catch_all(ew_eptr1);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_yes_catch_all(ew_eptr2); expect_int_yes_catch_all(ew_eptr2);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_yes_catch_all(ew_small); expect_int_yes_catch_all(ew_small);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
auto expect_int_no_catch_all = [&](const exception_wrapper& ew) { auto expect_int_no_catch_all = [&](const exception_wrapper& ew) {
...@@ -610,13 +610,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_small) { ...@@ -610,13 +610,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_small) {
}; };
expect_int_no_catch_all(ew_eptr1); expect_int_no_catch_all(ew_eptr1);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all(ew_eptr2); expect_int_no_catch_all(ew_eptr2);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all(ew_small); expect_int_no_catch_all(ew_small);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) { auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) {
...@@ -626,13 +626,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_small) { ...@@ -626,13 +626,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_small) {
}; };
expect_int_no_catch_all_2(ew_eptr1); expect_int_no_catch_all_2(ew_eptr1);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all_2(ew_eptr2); expect_int_no_catch_all_2(ew_eptr2);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all_2(ew_small); expect_int_no_catch_all_2(ew_small);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
} }
TEST(ExceptionWrapper, handle_non_std_exception_big) { TEST(ExceptionWrapper, handle_non_std_exception_big) {
...@@ -649,13 +649,13 @@ 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_int_yes_catch_all(ew_eptr1);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_yes_catch_all(ew_eptr2); expect_int_yes_catch_all(ew_eptr2);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_yes_catch_all(ew_big); expect_int_yes_catch_all(ew_big);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
auto expect_int_no_catch_all = [&](const exception_wrapper& ew) { auto expect_int_no_catch_all = [&](const exception_wrapper& ew) {
...@@ -665,13 +665,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_big) { ...@@ -665,13 +665,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_big) {
}; };
expect_int_no_catch_all(ew_eptr1); expect_int_no_catch_all(ew_eptr1);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all(ew_eptr2); expect_int_no_catch_all(ew_eptr2);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all(ew_big); expect_int_no_catch_all(ew_big);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) { auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) {
...@@ -681,13 +681,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_big) { ...@@ -681,13 +681,13 @@ TEST(ExceptionWrapper, handle_non_std_exception_big) {
}; };
expect_int_no_catch_all_2(ew_eptr1); expect_int_no_catch_all_2(ew_eptr1);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all_2(ew_eptr2); expect_int_no_catch_all_2(ew_eptr2);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
expect_int_no_catch_all_2(ew_big); expect_int_no_catch_all_2(ew_big);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
EXPECT_THROW( EXPECT_THROW(
...@@ -705,7 +705,7 @@ TEST(ExceptionWrapper, handle_non_std_exception_rethrow_base_derived) { ...@@ -705,7 +705,7 @@ TEST(ExceptionWrapper, handle_non_std_exception_rethrow_base_derived) {
}, },
[](const BaseException&) { EXPECT_TRUE(false); }), [](const BaseException&) { EXPECT_TRUE(false); }),
DerivedException); DerivedException);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
handled = false; handled = false;
EXPECT_THROW( EXPECT_THROW(
ew.handle( ew.handle(
...@@ -715,7 +715,7 @@ TEST(ExceptionWrapper, handle_non_std_exception_rethrow_base_derived) { ...@@ -715,7 +715,7 @@ TEST(ExceptionWrapper, handle_non_std_exception_rethrow_base_derived) {
}, },
[](...) { EXPECT_TRUE(false); }), [](...) { EXPECT_TRUE(false); }),
DerivedException); DerivedException);
EXPECT_EQ(true, handled); EXPECT_TRUE(handled);
} }
TEST(ExceptionWrapper, self_swap_test) { TEST(ExceptionWrapper, self_swap_test) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment