52 #include "gtest/gtest.h" 53 #include "gtest/gtest-spi.h" 70 return os << (x.
value ?
"true" :
"false");
76 template <
typename T1>
93 template <
typename T1>
100 template <
typename T1>
108 <<
" is expected to be positive, but evaluates to " 114 template <
typename T1>
116 const T1& v1)
const {
126 expected_to_finish_ =
true;
135 "The predicate assertion didn't evaluate argument 2 " 139 if (expected_to_finish_ && !finished_) {
140 FAIL() <<
"The predicate assertion unexpactedly aborted the test.";
141 }
else if (!expected_to_finish_ && finished_) {
142 FAIL() <<
"The failed predicate assertion didn't abort the test " 148 static bool expected_to_finish_;
151 static bool finished_;
272 expected_to_finish_ =
false;
283 expected_to_finish_ =
false;
294 expected_to_finish_ =
false;
305 expected_to_finish_ =
false;
420 expected_to_finish_ =
false;
431 expected_to_finish_ =
false;
442 expected_to_finish_ =
false;
453 expected_to_finish_ =
false;
463 template <
typename T1,
typename T2>
480 template <
typename T1,
typename T2>
488 template <
typename T1,
typename T2>
498 <<
" is expected to be positive, but evaluates to " 504 template <
typename T1,
typename T2>
508 const T2& v2)
const {
518 expected_to_finish_ =
true;
527 "The predicate assertion didn't evaluate argument 2 " 530 "The predicate assertion didn't evaluate argument 3 " 534 if (expected_to_finish_ && !finished_) {
535 FAIL() <<
"The predicate assertion unexpactedly aborted the test.";
536 }
else if (!expected_to_finish_ && finished_) {
537 FAIL() <<
"The failed predicate assertion didn't abort the test " 543 static bool expected_to_finish_;
546 static bool finished_;
681 expected_to_finish_ =
false;
693 expected_to_finish_ =
false;
705 expected_to_finish_ =
false;
717 expected_to_finish_ =
false;
845 expected_to_finish_ =
false;
857 expected_to_finish_ =
false;
869 expected_to_finish_ =
false;
881 expected_to_finish_ =
false;
892 template <
typename T1,
typename T2,
typename T3>
894 return v1 + v2 + v3 > 0;
901 return v1 + v2 + v3 > 0;
904 return v1 + v2 + v3 > 0;
909 template <
typename T1,
typename T2,
typename T3>
913 return v1 + v2 + v3 > 0;
918 template <
typename T1,
typename T2,
typename T3>
929 << e1 <<
" + " << e2 <<
" + " << e3
930 <<
" is expected to be positive, but evaluates to " 931 << v1 + v2 + v3 <<
".";
936 template <
typename T1,
typename T2,
typename T3>
942 const T3& v3)
const {
952 expected_to_finish_ =
true;
961 "The predicate assertion didn't evaluate argument 2 " 964 "The predicate assertion didn't evaluate argument 3 " 967 "The predicate assertion didn't evaluate argument 4 " 971 if (expected_to_finish_ && !finished_) {
972 FAIL() <<
"The predicate assertion unexpactedly aborted the test.";
973 }
else if (!expected_to_finish_ && finished_) {
974 FAIL() <<
"The failed predicate assertion didn't abort the test " 980 static bool expected_to_finish_;
983 static bool finished_;
1132 expected_to_finish_ =
false;
1145 expected_to_finish_ =
false;
1158 expected_to_finish_ =
false;
1171 expected_to_finish_ =
false;
1312 expected_to_finish_ =
false;
1325 expected_to_finish_ =
false;
1338 expected_to_finish_ =
false;
1351 expected_to_finish_ =
false;
1363 template <
typename T1,
typename T2,
typename T3,
typename T4>
1365 return v1 + v2 + v3 + v4 > 0;
1372 return v1 + v2 + v3 + v4 > 0;
1375 return v1 + v2 + v3 + v4 > 0;
1380 template <
typename T1,
typename T2,
typename T3,
typename T4>
1385 return v1 + v2 + v3 + v4 > 0;
1390 template <
typename T1,
typename T2,
typename T3,
typename T4>
1403 << e1 <<
" + " << e2 <<
" + " << e3 <<
" + " << e4
1404 <<
" is expected to be positive, but evaluates to " 1405 << v1 + v2 + v3 + v4 <<
".";
1410 template <
typename T1,
typename T2,
typename T3,
typename T4>
1418 const T4& v4)
const {
1428 expected_to_finish_ =
true;
1430 n1_ = n2_ = n3_ = n4_ = 0;
1437 "The predicate assertion didn't evaluate argument 2 " 1440 "The predicate assertion didn't evaluate argument 3 " 1443 "The predicate assertion didn't evaluate argument 4 " 1446 "The predicate assertion didn't evaluate argument 5 " 1450 if (expected_to_finish_ && !finished_) {
1451 FAIL() <<
"The predicate assertion unexpactedly aborted the test.";
1452 }
else if (!expected_to_finish_ && finished_) {
1453 FAIL() <<
"The failed predicate assertion didn't abort the test " 1459 static bool expected_to_finish_;
1462 static bool finished_;
1625 expected_to_finish_ =
false;
1639 expected_to_finish_ =
false;
1653 expected_to_finish_ =
false;
1667 expected_to_finish_ =
false;
1821 expected_to_finish_ =
false;
1835 expected_to_finish_ =
false;
1849 expected_to_finish_ =
false;
1863 expected_to_finish_ =
false;
1876 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
1878 return v1 + v2 + v3 + v4 + v5 > 0;
1885 return v1 + v2 + v3 + v4 + v5 > 0;
1888 return v1 + v2 + v3 + v4 + v5 > 0;
1893 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
1899 return v1 + v2 + v3 + v4 + v5 > 0;
1904 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
1919 << e1 <<
" + " << e2 <<
" + " << e3 <<
" + " << e4 <<
" + " << e5
1920 <<
" is expected to be positive, but evaluates to " 1921 << v1 + v2 + v3 + v4 + v5 <<
".";
1926 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
1936 const T5& v5)
const {
1946 expected_to_finish_ =
true;
1948 n1_ = n2_ = n3_ = n4_ = n5_ = 0;
1955 "The predicate assertion didn't evaluate argument 2 " 1958 "The predicate assertion didn't evaluate argument 3 " 1961 "The predicate assertion didn't evaluate argument 4 " 1964 "The predicate assertion didn't evaluate argument 5 " 1967 "The predicate assertion didn't evaluate argument 6 " 1971 if (expected_to_finish_ && !finished_) {
1972 FAIL() <<
"The predicate assertion unexpactedly aborted the test.";
1973 }
else if (!expected_to_finish_ && finished_) {
1974 FAIL() <<
"The failed predicate assertion didn't abort the test " 1980 static bool expected_to_finish_;
1983 static bool finished_;
2160 expected_to_finish_ =
false;
2175 expected_to_finish_ =
false;
2190 expected_to_finish_ =
false;
2205 expected_to_finish_ =
false;
2372 expected_to_finish_ =
false;
2387 expected_to_finish_ =
false;
2402 expected_to_finish_ =
false;
2417 expected_to_finish_ =
false;
#define EXPECT_PRED3(pred, v1, v2, v3)
bool operator()(const T1 &v1, const T2 &v2)
Predicate1Test ASSERT_PRED_FORMAT1Test
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)
bool PredFunction4Int(int v1, int v2, int v3, int v4)
GTEST_API_ AssertionResult AssertionFailure()
Predicate2Test ASSERT_PRED2Test
testing::AssertionResult PredFormatFunction3(const char *e1, const char *e2, const char *e3, const T1 &v1, const T2 &v2, const T3 &v3)
testing::AssertionResult PredFormatFunction2(const char *e1, const char *e2, const T1 &v1, const T2 &v2)
#define ASSERT_PRED_FORMAT1(pred_format, v1)
Predicate5Test ASSERT_PRED_FORMAT5Test
bool PredFunction3Int(int v1, int v2, int v3)
std::ostream & operator<<(std::ostream &os, const Bool &x)
bool PredFunction1Bool(Bool v1)
#define EXPECT_EQ(val1, val2)
Predicate4Test ASSERT_PRED4Test
Predicate2Test ASSERT_PRED_FORMAT2Test
bool operator>(int n) const
#define EXPECT_PRED4(pred, v1, v2, v3, v4)
#define EXPECT_PRED1(pred, v1)
Predicate2Test EXPECT_PRED2Test
Predicate5Test EXPECT_PRED_FORMAT5Test
bool PredFunction1(T1 v1)
#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5)
#define ASSERT_PRED3(pred, v1, v2, v3)
Predicate2Test EXPECT_PRED_FORMAT2Test
bool PredFunction3Bool(Bool v1, Bool v2, Bool v3)
bool operator()(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5)
bool operator()(const T1 &v1)
bool PredFunction2Int(int v1, int v2)
Predicate5Test EXPECT_PRED5Test
FOLLY_PUSH_WARNING RHS rhs
Predicate1Test ASSERT_PRED1Test
#define EXPECT_PRED_FORMAT1(pred_format, v1)
#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3)
bool PredFunction2Bool(Bool v1, Bool v2)
static bool expected_to_finish_
Predicate3Test ASSERT_PRED3Test
bool PredFunction2(T1 v1, T2 v2)
Predicate1Test EXPECT_PRED_FORMAT1Test
GTEST_API_ AssertionResult AssertionSuccess()
#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5)
bool PredFunction1Int(int v1)
bool PredFunction5Int(int v1, int v2, int v3, int v4, int v5)
#define EXPECT_FATAL_FAILURE(statement, substr)
bool PredFunction3(T1 v1, T2 v2, T3 v3)
#define ASSERT_PRED2(pred, v1, v2)
Predicate4Test EXPECT_PRED4Test
#define EXPECT_PRED2(pred, v1, v2)
#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5)
#define ASSERT_PRED4(pred, v1, v2, v3, v4)
static bool expected_to_finish_
Predicate3Test EXPECT_PRED3Test
Predicate3Test EXPECT_PRED_FORMAT3Test
#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4)
Predicate1Test EXPECT_PRED1Test
testing::AssertionResult PredFormatFunction1(const char *e1, const T1 &v1)
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Predicate4Test ASSERT_PRED_FORMAT4Test
#define ASSERT_PRED_FORMAT2(pred_format, v1, v2)
#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5)
#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4)
#define ASSERT_PRED1(pred, v1)
testing::AssertionResult PredFormatFunction5(const char *e1, const char *e2, const char *e3, const char *e4, const char *e5, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5)
#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3)
bool PredFunction5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5)
bool operator()(const T1 &v1, const T2 &v2, const T3 &v3)
static bool expected_to_finish_
Predicate4Test EXPECT_PRED_FORMAT4Test
testing::AssertionResult PredFormatFunction4(const char *e1, const char *e2, const char *e3, const char *e4, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeSuccess)
Predicate5Test ASSERT_PRED5Test
bool PredFunction4(T1 v1, T2 v2, T3 v3, T4 v4)
Predicate3Test ASSERT_PRED_FORMAT3Test
bool PredFunction5Bool(Bool v1, Bool v2, Bool v3, Bool v4, Bool v5)
static bool expected_to_finish_
bool operator==(const Bool &rhs) const
static bool expected_to_finish_
Bool operator+(const Bool &rhs) const
bool PredFunction4Bool(Bool v1, Bool v2, Bool v3, Bool v4)
bool operator()(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)