Commit 89245097 by c8ef Committed by Copybara-Service

PR #1786: Fix typo in test case.

Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1786

Merge d81cf2128c9ad4ee03c3162c1326403e977d0af1 into dee1b6c2

Merging this change closes #1786

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1786 from c8ef:master d81cf2128c9ad4ee03c3162c1326403e977d0af1
PiperOrigin-RevId: 694627073
Change-Id: I7ba1dcc5aacdc1c8209628cff0a4e29a62cde7e6
parent 6312b70b
...@@ -88,9 +88,9 @@ TEST(PredictTest, Optional) { ...@@ -88,9 +88,9 @@ TEST(PredictTest, Optional) {
EXPECT_FALSE(ABSL_PREDICT_FALSE(no_value)); EXPECT_FALSE(ABSL_PREDICT_FALSE(no_value));
} }
class ImplictlyConvertibleToBool { class ImplicitlyConvertibleToBool {
public: public:
explicit ImplictlyConvertibleToBool(bool value) : value_(value) {} explicit ImplicitlyConvertibleToBool(bool value) : value_(value) {}
operator bool() const { // NOLINT(google-explicit-constructor) operator bool() const { // NOLINT(google-explicit-constructor)
return value_; return value_;
} }
...@@ -100,17 +100,17 @@ class ImplictlyConvertibleToBool { ...@@ -100,17 +100,17 @@ class ImplictlyConvertibleToBool {
}; };
TEST(PredictTest, ImplicitBoolConversion) { TEST(PredictTest, ImplicitBoolConversion) {
const ImplictlyConvertibleToBool is_true(true); const ImplicitlyConvertibleToBool is_true(true);
const ImplictlyConvertibleToBool is_false(false); const ImplicitlyConvertibleToBool is_false(false);
if (!ABSL_PREDICT_TRUE(is_true)) ADD_FAILURE(); if (!ABSL_PREDICT_TRUE(is_true)) ADD_FAILURE();
if (ABSL_PREDICT_TRUE(is_false)) ADD_FAILURE(); if (ABSL_PREDICT_TRUE(is_false)) ADD_FAILURE();
if (!ABSL_PREDICT_FALSE(is_true)) ADD_FAILURE(); if (!ABSL_PREDICT_FALSE(is_true)) ADD_FAILURE();
if (ABSL_PREDICT_FALSE(is_false)) ADD_FAILURE(); if (ABSL_PREDICT_FALSE(is_false)) ADD_FAILURE();
} }
class ExplictlyConvertibleToBool { class ExplicitlyConvertibleToBool {
public: public:
explicit ExplictlyConvertibleToBool(bool value) : value_(value) {} explicit ExplicitlyConvertibleToBool(bool value) : value_(value) {}
explicit operator bool() const { return value_; } explicit operator bool() const { return value_; }
private: private:
...@@ -118,8 +118,8 @@ class ExplictlyConvertibleToBool { ...@@ -118,8 +118,8 @@ class ExplictlyConvertibleToBool {
}; };
TEST(PredictTest, ExplicitBoolConversion) { TEST(PredictTest, ExplicitBoolConversion) {
const ExplictlyConvertibleToBool is_true(true); const ExplicitlyConvertibleToBool is_true(true);
const ExplictlyConvertibleToBool is_false(false); const ExplicitlyConvertibleToBool is_false(false);
if (!ABSL_PREDICT_TRUE(is_true)) ADD_FAILURE(); if (!ABSL_PREDICT_TRUE(is_true)) ADD_FAILURE();
if (ABSL_PREDICT_TRUE(is_false)) ADD_FAILURE(); if (ABSL_PREDICT_TRUE(is_false)) ADD_FAILURE();
if (!ABSL_PREDICT_FALSE(is_true)) ADD_FAILURE(); if (!ABSL_PREDICT_FALSE(is_true)) ADD_FAILURE();
......
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