38 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ 39 #define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ 109 template <
typename T>
135 virtual void DescribeTo(::std::ostream* os)
const = 0;
190 template <
typename T>
196 return impl_->MatchAndExplain(x, listener);
202 return MatchAndExplain(x, &dummy);
206 void DescribeTo(::std::ostream* os)
const { impl_->DescribeTo(os); }
210 impl_->DescribeNegationTo(os);
216 MatchAndExplain(x, &listener);
250 template <
typename T>
260 : internal::MatcherBase<
T>(impl) {}
277 : internal::MatcherBase<const internal::
string&>(impl) {}
294 : internal::MatcherBase<internal::
string>(impl) {}
316 template <
class Impl>
327 const Impl&
impl()
const {
return impl_; }
329 template <
typename T>
335 template <
typename T>
341 impl_.DescribeTo(os);
345 impl_.DescribeNegationTo(os);
349 return impl_.MatchAndExplain(x, listener);
370 template <
typename T>
382 template <
class Impl>
391 template <
typename T,
typename M>
401 template <
typename T>
406 template <
typename M>
420 template <
typename U>
424 T_must_be_implicitly_convertible_to_U);
429 cannot_convert_non_referentce_arg_to_reference);
437 kTIsOther || kUIsOther ||
438 (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
439 conversion_of_arithmetic_types_must_be_lossless);
440 return MatcherCast<T>(matcher);
444 template <
typename T,
typename M>
450 template <
typename T>
460 if (explanation !=
"" && os != NULL) {
461 *os <<
", " << explanation;
471 return (type_name.length() <= 20 ||
472 type_name.find_first_of(
"<(") == string::npos);
480 template <
typename Value,
typename T>
494 const string& type_name = GetTypeName<Value>();
496 *listener->
stream() <<
" (of type " << type_name <<
")";
511 template <
typename MatcherTuple,
typename ValueTuple>
513 const ValueTuple& value_tuple) {
514 using ::std::tr1::get;
516 &&
get<
N - 1>(matcher_tuple).
Matches(get<N - 1>(value_tuple));
523 template <
typename MatcherTuple,
typename ValueTuple>
525 const ValueTuple& values,
526 ::std::ostream* os) {
527 using ::std::tr1::tuple_element;
528 using ::std::tr1::get;
536 get<N - 1>(matchers);
537 typedef typename tuple_element<N - 1, ValueTuple>::type
Value;
538 Value value =
get<N - 1>(values);
540 if (!matcher.MatchAndExplain(value, &listener)) {
543 *os <<
" Expected arg #" << N - 1 <<
": ";
544 get<N - 1>(matchers).DescribeTo(os);
545 *os <<
"\n Actual: ";
562 template <
typename MatcherTuple,
typename ValueTuple>
564 const ValueTuple& ) {
568 template <
typename MatcherTuple,
typename ValueTuple>
579 template <
typename MatcherTuple,
typename ValueTuple>
581 const ValueTuple& value_tuple) {
582 using ::std::tr1::tuple_size;
586 tuple_size<ValueTuple>::value,
587 matcher_and_value_have_different_numbers_of_fields);
589 Matches(matcher_tuple, value_tuple);
594 template <
typename MatcherTuple,
typename ValueTuple>
596 const ValueTuple& values,
597 ::std::ostream* os) {
598 using ::std::tr1::tuple_size;
600 matchers, values, os);
612 template <
typename T,
typename M>
623 template <
typename T,
typename U>
634 : source_matcher_(source_matcher) {}
638 return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
642 source_matcher_.DescribeTo(os);
646 source_matcher_.DescribeNegationTo(os);
658 template <
typename T>
665 template <
typename T>
670 virtual void DescribeTo(::std::ostream* os)
const { *os <<
"is anything"; }
675 *os <<
"never matches";
685 template <
typename T>
702 #define GMOCK_IMPLEMENT_COMPARISON_MATCHER_( \ 703 name, op, relation, negated_relation) \ 704 template <typename Rhs> class name##Matcher { \ 706 explicit name##Matcher(const Rhs& rhs) : rhs_(rhs) {} \ 707 template <typename Lhs> \ 708 operator Matcher<Lhs>() const { \ 709 return MakeMatcher(new Impl<Lhs>(rhs_)); \ 712 template <typename Lhs> \ 713 class Impl : public MatcherInterface<Lhs> { \ 715 explicit Impl(const Rhs& rhs) : rhs_(rhs) {} \ 716 virtual bool MatchAndExplain(\ 717 Lhs lhs, MatchResultListener* ) const { \ 718 return lhs op rhs_; \ 720 virtual void DescribeTo(::std::ostream* os) const { \ 721 *os << relation " "; \ 722 UniversalPrint(rhs_, os); \ 724 virtual void DescribeNegationTo(::std::ostream* os) const { \ 725 *os << negated_relation " "; \ 726 UniversalPrint(rhs_, os); \ 730 GTEST_DISALLOW_ASSIGN_(Impl); \ 733 GTEST_DISALLOW_ASSIGN_(name##Matcher); \ 745 #undef GMOCK_IMPLEMENT_COMPARISON_MATCHER_ 751 template <
typename Po
inter>
757 void DescribeTo(::std::ostream* os)
const { *os <<
"is NULL"; }
767 template <
typename Po
inter>
773 void DescribeTo(::std::ostream* os)
const { *os <<
"isn't NULL"; }
792 template <
typename T>
795 template <
typename T>
808 template <
typename Super>
819 template <
typename Super>
822 explicit Impl(Super& x) : object_(x) {}
828 *listener <<
"which is located @" <<
static_cast<const void*
>(&x);
829 return &x == &object_;
833 *os <<
"references the variable ";
838 *os <<
"does not reference the variable ";
859 const wchar_t* rhs) {
860 return String::CaseInsensitiveWideCStringEquals(lhs, rhs);
865 template <
typename StringType>
867 const StringType& s2) {
874 const typename StringType::value_type nul = 0;
875 const size_t i1 = s1.find(nul), i2 = s2.find(nul);
878 if (i1 == StringType::npos || i2 == StringType::npos) {
889 template <
typename StringType>
896 : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}
905 return MatchAndExplain(StringType(s), listener);
910 const bool eq = case_sensitive_ ? s == string_ :
912 return expect_eq_ == eq;
916 DescribeToHelper(expect_eq_, os);
920 DescribeToHelper(!expect_eq_, os);
925 *os << (expect_eq ?
"is " :
"isn't ");
927 if (!case_sensitive_) {
928 *os <<
"(ignoring case) ";
943 template <
typename StringType>
949 : substring_(substring) {}
956 return s != NULL && MatchAndExplain(StringType(s), listener);
961 return s.find(substring_) != StringType::npos;
966 *os <<
"has substring ";
971 *os <<
"has no substring ";
984 template <
typename StringType>
997 return s != NULL && MatchAndExplain(StringType(s), listener);
1002 return s.length() >= prefix_.length() &&
1003 s.substr(0, prefix_.length()) == prefix_;
1007 *os <<
"starts with ";
1012 *os <<
"doesn't start with ";
1025 template <
typename StringType>
1037 return s != NULL && MatchAndExplain(StringType(s), listener);
1042 return s.length() >= suffix_.length() &&
1043 s.substr(s.length() - suffix_.length()) == suffix_;
1047 *os <<
"ends with ";
1052 *os <<
"doesn't end with ";
1068 : regex_(regex), full_match_(full_match) {}
1081 return full_match_ ? RE::FullMatch(s, *regex_) :
1082 RE::PartialMatch(s, *regex_);
1086 *os << (full_match_ ?
"matches" :
"contains")
1087 <<
" regular expression ";
1092 *os <<
"doesn't " << (full_match_ ?
"match" :
"contain")
1093 <<
" regular expression ";
1115 #define GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(name, op, relation) \ 1116 class name##2Matcher { \ 1118 template <typename T1, typename T2> \ 1119 operator Matcher< ::std::tr1::tuple<T1, T2> >() const { \ 1120 return MakeMatcher(new Impl< ::std::tr1::tuple<T1, T2> >); \ 1122 template <typename T1, typename T2> \ 1123 operator Matcher<const ::std::tr1::tuple<T1, T2>&>() const { \ 1124 return MakeMatcher(new Impl<const ::std::tr1::tuple<T1, T2>&>); \ 1127 template <typename Tuple> \ 1128 class Impl : public MatcherInterface<Tuple> { \ 1130 virtual bool MatchAndExplain( \ 1132 MatchResultListener* ) const { \ 1133 return ::std::tr1::get<0>(args) op ::std::tr1::get<1>(args); \ 1135 virtual void DescribeTo(::std::ostream* os) const { \ 1136 *os << "are " relation; \ 1138 virtual void DescribeNegationTo(::std::ostream* os) const { \ 1139 *os << "aren't " relation; \ 1147 Ge, >=,
"a pair where the first >= the second");
1149 Gt, >,
"a pair where the first > the second");
1151 Le, <=,
"a pair where the first <= the second");
1153 Lt, <,
"a pair where the first < the second");
1156 #undef GMOCK_IMPLEMENT_COMPARISON2_MATCHER_ 1162 template <
typename T>
1166 : matcher_(matcher) {}
1169 return !matcher_.MatchAndExplain(x, listener);
1173 matcher_.DescribeNegationTo(os);
1177 matcher_.DescribeTo(os);
1188 template <
typename InnerMatcher>
1195 template <
typename T>
1210 template <
typename T>
1214 : matcher1_(matcher1), matcher2_(matcher2) {}
1218 matcher1_.DescribeTo(os);
1220 matcher2_.DescribeTo(os);
1226 matcher1_.DescribeNegationTo(os);
1228 matcher2_.DescribeNegationTo(os);
1236 if (!matcher1_.MatchAndExplain(x, &listener1)) {
1237 *listener << listener1.
str();
1242 if (!matcher2_.MatchAndExplain(x, &listener2)) {
1243 *listener << listener2.
str();
1256 *listener <<
", and " << s2;
1271 template <
typename Matcher1,
typename Matcher2>
1275 : matcher1_(matcher1), matcher2_(matcher2) {}
1280 template <
typename T>
1283 SafeMatcherCast<T>(matcher2_)));
1297 template <
typename T>
1301 : matcher1_(matcher1), matcher2_(matcher2) {}
1305 matcher1_.DescribeTo(os);
1307 matcher2_.DescribeTo(os);
1313 matcher1_.DescribeNegationTo(os);
1315 matcher2_.DescribeNegationTo(os);
1323 if (matcher1_.MatchAndExplain(x, &listener1)) {
1324 *listener << listener1.
str();
1329 if (matcher2_.MatchAndExplain(x, &listener2)) {
1330 *listener << listener2.
str();
1343 *listener <<
", and " << s2;
1359 template <
typename Matcher1,
typename Matcher2>
1363 : matcher1_(matcher1), matcher2_(matcher2) {}
1368 template <
typename T>
1371 SafeMatcherCast<T>(matcher1_), SafeMatcherCast<T>(matcher2_)));
1383 template <
typename Predicate>
1392 template <
typename T>
1407 *os <<
"satisfies the given predicate";
1411 *os <<
"doesn't satisfy the given predicate";
1422 template <
typename M>
1433 template <
typename T>
1449 return MatcherCast<const T&>(matcher_).
Matches(x);
1460 template <
typename M>
1468 template <
typename T>
1484 ::std::stringstream ss;
1485 ss <<
"Value of: " << value_text <<
"\n" 1488 ss <<
"\n Actual: " << listener.str();
1501 template <
typename M>
1511 template <
typename FloatType>
1519 rhs_(rhs), nan_eq_nan_(nan_eq_nan) {}
1522 template <
typename T>
1525 Impl(FloatType rhs,
bool nan_eq_nan) :
1526 rhs_(rhs), nan_eq_nan_(nan_eq_nan) {}
1533 if (nan_eq_nan_ && lhs.is_nan()) {
1537 return lhs.AlmostEquals(rhs);
1544 const ::std::streamsize old_precision = os->precision(
1545 ::std::numeric_limits<FloatType>::digits10 + 2);
1550 *os <<
"never matches";
1553 *os <<
"is approximately " << rhs_;
1555 os->precision(old_precision);
1560 const ::std::streamsize old_precision = os->precision(
1561 ::std::numeric_limits<FloatType>::digits10 + 2);
1566 *os <<
"is anything";
1569 *os <<
"isn't approximately " << rhs_;
1572 os->precision(old_precision);
1608 template <
typename InnerMatcher>
1621 template <
typename Po
inter>
1628 template <
typename Po
inter>
1634 explicit Impl(
const InnerMatcher& matcher)
1635 : matcher_(MatcherCast<const Pointee&>(matcher)) {}
1638 *os <<
"points to a value that ";
1639 matcher_.DescribeTo(os);
1643 *os <<
"does not point to a value that ";
1644 matcher_.DescribeTo(os);
1652 *listener <<
"which points to ";
1669 template <
typename Class,
typename FieldType>
1674 : field_(field), matcher_(matcher) {}
1677 *os <<
"is an object whose given field ";
1678 matcher_.DescribeTo(os);
1682 *os <<
"is an object whose given field ";
1683 matcher_.DescribeNegationTo(os);
1686 template <
typename T>
1688 return MatchAndExplainImpl(
1689 typename ::testing::internal::
1700 *listener <<
"whose given field is ";
1709 *listener <<
"which points to an object ";
1713 return MatchAndExplainImpl(
false_type(), *p, listener);
1724 template <
typename Class,
typename PropertyType>
1735 : property_(property), matcher_(matcher) {}
1738 *os <<
"is an object whose given property ";
1739 matcher_.DescribeTo(os);
1743 *os <<
"is an object whose given property ";
1744 matcher_.DescribeNegationTo(os);
1747 template <
typename T>
1749 return MatchAndExplainImpl(
1750 typename ::testing::internal::
1761 *listener <<
"whose given property is ";
1764 RefToConstProperty result = (obj.*property_)();
1773 *listener <<
"which points to an object ";
1777 return MatchAndExplainImpl(
false_type(), *p, listener);
1780 PropertyType (
Class::*property_)()
const;
1790 template <
typename Functor>
1796 template <
typename T>
1797 static ResultType
Invoke(Functor f,
T arg) {
return f(arg); }
1801 template <
typename ArgType,
typename ResType>
1804 typedef ResType(*StorageType)(ArgType);
1808 <<
"NULL function pointer is passed into ResultOf().";
1810 template <
typename T>
1811 static ResType
Invoke(ResType(*f)(ArgType),
T arg) {
1818 template <
typename Callable>
1824 : callable_(callable), matcher_(matcher) {
1828 template <
typename T>
1836 template <
typename T>
1840 : callable_(callable), matcher_(matcher) {}
1843 *os <<
"is mapped by the given callable to a value that ";
1844 matcher_.DescribeTo(os);
1848 *os <<
"is mapped by the given callable to a value that ";
1849 matcher_.DescribeNegationTo(os);
1853 *listener <<
"which is mapped by the given callable to ";
1889 template <
typename Container>
1910 *os <<
"does not equal ";
1914 template <
typename LhsContainer>
1921 typedef typename LhsView::type LhsStlContainer;
1922 StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
1923 if (lhs_stl_container == rhs_)
1926 ::std::ostream*
const os = listener->
stream();
1929 bool printed_header =
false;
1930 for (
typename LhsStlContainer::const_iterator it =
1931 lhs_stl_container.begin();
1932 it != lhs_stl_container.end(); ++it) {
1935 if (printed_header) {
1938 *os <<
"which has these unexpected elements: ";
1939 printed_header =
true;
1946 bool printed_header2 =
false;
1947 for (
typename StlContainer::const_iterator it = rhs_.begin();
1948 it != rhs_.end(); ++it) {
1950 lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==
1951 lhs_stl_container.end()) {
1952 if (printed_header2) {
1955 *os << (printed_header ?
",\nand" :
"which")
1956 <<
" doesn't have these expected elements: ";
1957 printed_header2 =
true;
1977 template <
typename TupleMatcher,
typename RhsContainer>
1987 : tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {
1994 template <
typename LhsContainer>
1999 template <
typename LhsContainer>
2013 Impl(
const TupleMatcher& tuple_matcher,
const RhsStlContainer& rhs)
2015 : mono_tuple_matcher_(
SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
2019 *os <<
"contains " << rhs_.size()
2020 <<
" values, where each value and its corresponding value in ";
2023 mono_tuple_matcher_.DescribeTo(os);
2026 *os <<
"doesn't contain exactly " << rhs_.size()
2027 <<
" values, or contains a value x at some index i" 2028 <<
" where x and the i-th value of ";
2031 mono_tuple_matcher_.DescribeNegationTo(os);
2036 LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
2037 const size_t actual_size = lhs_stl_container.size();
2038 if (actual_size != rhs_.size()) {
2039 *listener <<
"which contains " << actual_size <<
" values";
2043 typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
2044 typename RhsStlContainer::const_iterator right = rhs_.begin();
2045 for (
size_t i = 0; i != actual_size; ++i, ++left, ++right) {
2046 const InnerMatcherArg value_pair(*left, *right);
2050 if (!mono_tuple_matcher_.MatchAndExplain(
2051 value_pair, &inner_listener)) {
2052 *listener <<
"where the value pair (";
2056 *listener <<
") at index #" << i <<
" don't match";
2061 if (!mono_tuple_matcher_.Matches(value_pair))
2084 template <
typename Container>
2091 typedef typename StlContainer::value_type
Element;
2093 template <
typename InnerMatcher>
2102 Container container,
2104 StlContainerReference stl_container = View::ConstReference(container);
2106 for (
typename StlContainer::const_iterator it = stl_container.begin();
2107 it != stl_container.end(); ++it, ++i) {
2109 const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);
2111 if (matches != all_elements_should_match) {
2112 *listener <<
"whose element #" << i
2113 << (matches ?
" matches" :
" doesn't match");
2115 return !all_elements_should_match;
2118 return all_elements_should_match;
2129 template <
typename Container>
2132 template <
typename InnerMatcher>
2138 *os <<
"contains at least one element that ";
2139 this->inner_matcher_.DescribeTo(os);
2143 *os <<
"doesn't contain any element that ";
2144 this->inner_matcher_.DescribeTo(os);
2149 return this->MatchAndExplainImpl(
false, container, listener);
2158 template <
typename Container>
2161 template <
typename InnerMatcher>
2167 *os <<
"only contains elements that ";
2168 this->inner_matcher_.DescribeTo(os);
2172 *os <<
"contains some element that ";
2173 this->inner_matcher_.DescribeNegationTo(os);
2178 return this->MatchAndExplainImpl(
true, container, listener);
2186 template <
typename M>
2191 template <
typename Container>
2203 template <
typename M>
2208 template <
typename Container>
2223 template <
typename PairType>
2229 template <
typename InnerMatcher>
2239 const bool match = inner_matcher_.MatchAndExplain(key_value.first,
2242 if (explanation !=
"") {
2243 *listener <<
"whose first field is a value " << explanation;
2250 *os <<
"has a key that ";
2251 inner_matcher_.DescribeTo(os);
2256 *os <<
"doesn't have a key that ";
2257 inner_matcher_.DescribeTo(os);
2267 template <
typename M>
2272 template <
typename PairType>
2285 template <
typename PairType>
2292 template <
typename FirstMatcher,
typename SecondMatcher>
2302 *os <<
"has a first field that ";
2303 first_matcher_.DescribeTo(os);
2304 *os <<
", and has a second field that ";
2305 second_matcher_.DescribeTo(os);
2310 *os <<
"has a first field that ";
2311 first_matcher_.DescribeNegationTo(os);
2312 *os <<
", or has a second field that ";
2313 second_matcher_.DescribeNegationTo(os);
2323 return first_matcher_.Matches(a_pair.first) &&
2324 second_matcher_.Matches(a_pair.second);
2327 if (!first_matcher_.MatchAndExplain(a_pair.first,
2328 &first_inner_listener)) {
2329 *listener <<
"whose first field does not match";
2334 if (!second_matcher_.MatchAndExplain(a_pair.second,
2335 &second_inner_listener)) {
2336 *listener <<
"whose second field does not match";
2340 ExplainSuccess(first_inner_listener.
str(), second_inner_listener.
str(),
2349 *listener <<
"whose both fields match";
2350 if (first_explanation !=
"") {
2351 *listener <<
", where the first field is a value " << first_explanation;
2353 if (second_explanation !=
"") {
2355 if (first_explanation !=
"") {
2356 *listener <<
"and ";
2358 *listener <<
"where ";
2360 *listener <<
"the second field is a value " << second_explanation;
2371 template <
typename FirstMatcher,
typename SecondMatcher>
2375 : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
2377 template <
typename PairType>
2381 first_matcher_, second_matcher_));
2392 template <
typename Container>
2399 typedef typename StlContainer::value_type
Element;
2403 template <
typename InputIter>
2405 matchers_.reserve(a_count);
2406 InputIter it = first;
2407 for (
size_t i = 0; i != a_count; ++i, ++it) {
2408 matchers_.push_back(MatcherCast<const Element&>(*it));
2416 }
else if (count() == 1) {
2417 *os <<
"has 1 element that ";
2418 matchers_[0].DescribeTo(os);
2420 *os <<
"has " << Elements(count()) <<
" where\n";
2421 for (
size_t i = 0; i != count(); ++i) {
2422 *os <<
"element #" << i <<
" ";
2423 matchers_[i].DescribeTo(os);
2424 if (i + 1 < count()) {
2434 *os <<
"isn't empty";
2438 *os <<
"doesn't have " << Elements(count()) <<
", or\n";
2439 for (
size_t i = 0; i != count(); ++i) {
2440 *os <<
"element #" << i <<
" ";
2441 matchers_[i].DescribeNegationTo(os);
2442 if (i + 1 < count()) {
2450 StlContainerReference stl_container = View::ConstReference(container);
2451 const size_t actual_count = stl_container.size();
2452 if (actual_count != count()) {
2457 if (actual_count != 0) {
2458 *listener <<
"which has " << Elements(actual_count);
2463 typename StlContainer::const_iterator it = stl_container.begin();
2465 std::vector<internal::string> explanations(count());
2466 for (
size_t i = 0; i != count(); ++it, ++i) {
2468 if (matchers_[i].MatchAndExplain(*it, &s)) {
2469 explanations[i] = s.
str();
2473 *listener <<
"whose element #" << i <<
" doesn't match";
2481 bool reason_printed =
false;
2482 for (
size_t i = 0; i != count(); ++i) {
2485 if (reason_printed) {
2486 *listener <<
",\nand ";
2488 *listener <<
"whose element #" << i <<
" matches, " << s;
2489 reason_printed =
true;
2498 return Message() << count << (count == 1 ?
" element" :
" elements");
2501 size_t count()
const {
return matchers_.size(); }
2512 template <
typename Container>
2524 template <
typename T>
2528 first_(first), count_(count) {}
2530 template <
typename Container>
2552 const Strings& param_values);
2557 template <
typename T,
typename M>
2573 template <
typename T>
2577 template <
typename T>
2583 template <
typename T>
2584 inline internal::EqMatcher<T>
Eq(
T x) {
return internal::EqMatcher<T>(x); }
2588 template <
typename T>
2603 template <
typename Lhs,
typename Rhs>
2607 template <
typename Rhs>
2608 inline internal::GeMatcher<Rhs>
Ge(Rhs x) {
2609 return internal::GeMatcher<Rhs>(x);
2613 template <
typename Rhs>
2614 inline internal::GtMatcher<Rhs>
Gt(Rhs x) {
2615 return internal::GtMatcher<Rhs>(x);
2619 template <
typename Rhs>
2620 inline internal::LeMatcher<Rhs>
Le(Rhs x) {
2621 return internal::LeMatcher<Rhs>(x);
2625 template <
typename Rhs>
2626 inline internal::LtMatcher<Rhs>
Lt(Rhs x) {
2627 return internal::LtMatcher<Rhs>(x);
2631 template <
typename Rhs>
2632 inline internal::NeMatcher<Rhs>
Ne(Rhs x) {
2633 return internal::NeMatcher<Rhs>(x);
2650 template <
typename T>
2681 template <
typename InnerMatcher>
2683 const InnerMatcher& inner_matcher) {
2691 template <
typename Class,
typename FieldType,
typename FieldMatcher>
2694 FieldType
Class::*field,
const FieldMatcher& matcher) {
2697 field, MatcherCast<const FieldType&>(matcher)));
2708 template <
typename Class,
typename PropertyType,
typename PropertyMatcher>
2711 PropertyType (
Class::*property)()
const,
const PropertyMatcher& matcher) {
2735 template <
typename Callable,
typename ResultOfMatcher>
2737 Callable callable,
const ResultOfMatcher& matcher) {
2740 MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
2775 str,
false,
false));
2822 #if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING 2850 str,
false,
false));
2875 #endif // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING 2879 inline internal::Eq2Matcher
Eq() {
return internal::Eq2Matcher(); }
2883 inline internal::Ge2Matcher
Ge() {
return internal::Ge2Matcher(); }
2887 inline internal::Gt2Matcher
Gt() {
return internal::Gt2Matcher(); }
2891 inline internal::Le2Matcher
Le() {
return internal::Le2Matcher(); }
2895 inline internal::Lt2Matcher
Lt() {
return internal::Lt2Matcher(); }
2899 inline internal::Ne2Matcher
Ne() {
return internal::Ne2Matcher(); }
2903 template <
typename InnerMatcher>
2911 template <
typename Predicate>
2921 template <
typename Container>
2938 template <
typename TupleMatcher,
typename Container>
2941 Pointwise(
const TupleMatcher& tuple_matcher,
const Container& rhs) {
2946 tuple_matcher, rhs);
2967 template <
typename M>
2999 template <
typename M>
3007 template <
typename M>
3017 template <
typename FirstMatcher,
typename SecondMatcher>
3019 Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
3021 first_matcher, second_matcher);
3026 template <
typename M>
3032 template <
typename T,
typename M>
3039 template <
typename T,
typename M>
3042 return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
3052 template <
typename InnerMatcher>
3053 inline InnerMatcher
AllArgs(
const InnerMatcher& matcher) {
return matcher; }
3059 #define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\ 3060 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value) 3061 #define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\ 3062 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value) 3066 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ Functor StorageType
Definition: gmock-matchers.h:1793
TrulyMatcher(Predicate pred)
Definition: gmock-matchers.h:1386
static Matcher< T > Cast(const Matcher< U > &source_matcher)
Definition: gmock-matchers.h:626
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly(Predicate pred)
Definition: gmock-matchers.h:2913
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1909
const Matcher< const SecondType & > second_matcher_
Definition: gmock-matchers.h:2365
static Matcher< T > Cast(M polymorphic_matcher)
Definition: gmock-matchers.h:407
const StlContainer rhs_
Definition: gmock-matchers.h:1968
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe(const internal::string &str)
Definition: gmock-matchers.h:2773
const M inner_matcher_
Definition: gmock-matchers.h:2214
Definition: gtest-internal.h:847
#define GMOCK_KIND_OF_(type)
Definition: gmock-internal-utils.h:168
::std::ostream * stream()
Definition: gmock-matchers.h:91
Definition: gmock-matchers.h:2204
const Matcher< RefToConstProperty > matcher_
Definition: gmock-matchers.h:1781
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
Definition: gmock-matchers.h:1698
Definition: gmock-matchers.h:1298
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1006
bool MatchAndExplain(ConstCharPointer s, MatchResultListener *listener) const
Definition: gmock-matchers.h:1035
const FieldType Class::* field_
Definition: gmock-matchers.h:1716
bool MatchAndExplainImpl(true_type, const Class *p, MatchResultListener *listener) const
Definition: gmock-matchers.h:1768
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1681
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:1168
const bool expect_eq_
Definition: gmock-matchers.h:934
Definition: gmock-matchers.h:890
const Impl & impl() const
Definition: gmock-matchers.h:327
const bool case_sensitive_
Definition: gmock-matchers.h:935
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith(const internal::string &suffix)
Definition: gmock-matchers.h:2795
Definition: gmock-actions.h:49
MatcherBase()
Definition: gmock-matchers.h:220
Matcher< T > SafeMatcherCast(const M &polymorphic_matcher)
Definition: gmock-matchers.h:445
ContainsMatcher(M m)
Definition: gmock-matchers.h:2189
Definition: gmock-matchers.h:110
bool IsInterested() const
Definition: gmock-matchers.h:97
ElementsAreMatcher0()
Definition: gmock-matchers.h:2510
Definition: gmock-matchers.h:1189
const M matcher_for_key_
Definition: gmock-matchers.h:2278
T & object_
Definition: gmock-matchers.h:848
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:757
View::type StlContainer
Definition: gmock-matchers.h:2397
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:971
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition: gmock-matchers.h:752
EitherOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition: gmock-matchers.h:1300
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1540
bool MatchAndExplain(const StringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:908
StringMatchResultListener()
Definition: gmock-matchers.h:176
EndsWithMatcher(const StringType &suffix)
Definition: gmock-matchers.h:1030
LhsView::type LhsStlContainer
Definition: gmock-matchers.h:2004
Impl(const Matcher< U > &source_matcher)
Definition: gmock-matchers.h:633
KeyMatcher(M m)
Definition: gmock-matchers.h:2270
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2166
static void ExplainMatchFailuresTo(const MatcherTuple &matchers, const ValueTuple &values,::std::ostream *os)
Definition: gmock-matchers.h:524
ElementsAreArrayMatcher(const T *first, size_t count)
Definition: gmock-matchers.h:2527
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2413
internal::GtMatcher< Rhs > Gt(Rhs x)
Definition: gmock-matchers.h:2614
const StringType prefix_
Definition: gmock-matchers.h:1017
MatchResultListener & operator<<(const T &x)
Definition: gmock-matchers.h:84
Definition: gmock-matchers.h:2393
Definition: gmock-matchers.h:666
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:670
internal::StlContainerView< RhsContainer > RhsView
Definition: gmock-matchers.h:1980
M matcher_
Definition: gmock-matchers.h:1453
bool operator()(const T &x) const
Definition: gmock-matchers.h:1434
::std::ostream *const stream_
Definition: gmock-matchers.h:100
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2137
Definition: gmock-matchers.h:2525
StrEqualityMatcher(const StringType &str, bool expect_eq, bool case_sensitive)
Definition: gmock-matchers.h:894
virtual bool MatchAndExplain(Super &x, MatchResultListener *listener) const
Definition: gmock-matchers.h:826
static ResType Invoke(ResType(*f)(ArgType), T arg)
Definition: gmock-matchers.h:1811
Definition: gmock-matchers.h:1272
void DescribeToHelper(bool expect_eq,::std::ostream *os) const
Definition: gmock-matchers.h:924
Definition: gmock-matchers.h:1890
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe(const internal::string &str)
Definition: gmock-matchers.h:2759
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1176
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1051
const Matcher< T > matcher1_
Definition: gmock-matchers.h:1263
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex(const internal::RE *regex)
Definition: gmock-matchers.h:2813
Definition: gmock-internal-utils.h:127
const Matcher< T > matcher2_
Definition: gmock-matchers.h:1264
bool Matches(T x) const
Definition: gmock-matchers.h:200
Definition: gmock-internal-utils.h:377
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2142
internal::ResultOfMatcher< Callable > ResultOf(Callable callable, const ResultOfMatcher &matcher)
Definition: gmock-matchers.h:2736
Definition: gmock-matchers.h:749
bool MatchAndExplain(ConstCharPointer s, MatchResultListener *listener) const
Definition: gmock-matchers.h:954
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:970
::std::string string
Definition: gtest-port.h:756
Definition: gtest-internal.h:317
static void CheckIsValid(ResType(*f)(ArgType))
Definition: gmock-matchers.h:1806
ResultOfMatcher(Callable callable, const Matcher< ResultType > &matcher)
Definition: gmock-matchers.h:1823
BothOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition: gmock-matchers.h:1213
const StringType suffix_
Definition: gmock-matchers.h:1057
internal::GeMatcher< Rhs > Ge(Rhs x)
Definition: gmock-matchers.h:2608
Definition: gmock-matchers.h:793
virtual bool MatchAndExplain(T value, MatchResultListener *) const
Definition: gmock-matchers.h:1528
MatchesRegexMatcher(const RE *regex, bool full_match)
Definition: gmock-matchers.h:1067
Matcher(const MatcherInterface< internal::string > *impl)
Definition: gmock-matchers.h:293
Definition: gmock-matchers.h:1065
const bool nan_eq_nan_
Definition: gmock-matchers.h:1601
Impl(FloatType rhs, bool nan_eq_nan)
Definition: gmock-matchers.h:1525
PredicateFormatterFromMatcher< M > MakePredicateFormatterFromMatcher(const M &matcher)
Definition: gmock-matchers.h:1503
Definition: gtest-port.h:1473
Definition: InputPrereqs.h:107
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2171
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:645
::std::wstring wstring
Definition: gtest-port.h:762
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1842
StringType::const_pointer ConstCharPointer
Definition: gmock-matchers.h:1028
RefMatcher(T &x)
Definition: gmock-matchers.h:806
Definition: gmock-matchers.h:765
Definition: gmock-matchers.h:1725
Definition: gmock-matchers.h:164
bool MatchAndExplainImpl(bool all_elements_should_match, Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2101
FloatingEqMatcher(FloatType rhs, bool nan_eq_nan)
Definition: gmock-matchers.h:1518
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1311
StlContainer::value_type Element
Definition: gmock-matchers.h:2399
Definition: gtest-tuple.h:109
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:965
internal::StlContainerView< RawContainer > View
Definition: gmock-matchers.h:2396
const Matcher< ResultType > matcher_
Definition: gmock-matchers.h:1868
MonomorphicImpl(const Impl &impl)
Definition: gmock-matchers.h:338
InnerMatcher AllArgs(const InnerMatcher &matcher)
Definition: gmock-matchers.h:3053
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1558
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2249
PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: gmock-matchers.h:2293
internal::StlContainerView< Container > View
Definition: gmock-matchers.h:1892
Definition: gmock-matchers.h:1670
const bool full_match_
Definition: gmock-matchers.h:1099
bool MatchAndExplain(T &x, MatchResultListener *) const
Definition: gmock-matchers.h:1393
internal::FloatingEqMatcher< float > FloatEq(float rhs)
Definition: gmock-matchers.h:2669
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
Definition: gmock-matchers.h:481
Definition: gmock-matchers.h:2000
Matcher< T > An()
Definition: gmock-matchers.h:2578
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1091
Definition: gmock-matchers.h:2085
const Matcher< const Element & > inner_matcher_
Definition: gmock-matchers.h:2122
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:773
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
Definition: gmock-matchers.h:2710
Definition: gmock-matchers.h:1423
RhsView::type RhsStlContainer
Definition: gmock-matchers.h:1981
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: gmock-matchers.h:580
Definition: gmock-matchers.h:2268
#define GMOCK_IMPLEMENT_COMPARISON_MATCHER_(name, op, relation, negated_relation)
Definition: gmock-matchers.h:702
Definition: gmock-matchers.h:2130
Definition: gmock-matchers.h:1163
const size_t count_
Definition: gmock-matchers.h:2541
const StringType substring_
Definition: gmock-matchers.h:976
Definition: gmock-matchers.h:2187
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith(const internal::string &prefix)
Definition: gmock-matchers.h:2788
const Matcher< T > matcher1_
Definition: gmock-matchers.h:1350
internal::EqMatcher< T > Eq(T x)
Definition: gmock-matchers.h:2584
::testing::internal::linked_ptr< const MatcherInterface< T > > impl_
Definition: gmock-matchers.h:240
bool CaseInsensitiveCStringEquals(const wchar_t *lhs, const wchar_t *rhs)
Definition: gmock-matchers.h:858
#define GTEST_REMOVE_REFERENCE_(T)
Definition: gtest-internal.h:786
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1011
GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener)
QuantifierMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2094
CallableStorageType callable_
Definition: gmock-matchers.h:1867
internal::FloatingEqMatcher< float > NanSensitiveFloatEq(float rhs)
Definition: gmock-matchers.h:2675
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:774
FieldMatcher(FieldType Class::*field, const Matcher< const FieldType & > &matcher)
Definition: gmock-matchers.h:1672
View::type StlContainer
Definition: gmock-matchers.h:2089
static Matcher< T > Cast(M polymorphic_matcher)
Definition: gmock-matchers.h:615
bool is_nan() const
Definition: gtest-internal.h:398
View::type StlContainer
Definition: gmock-matchers.h:1893
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1847
ContainsMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2133
PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: gmock-matchers.h:2374
#define GTEST_DISALLOW_ASSIGN_(type)
Definition: gtest-port.h:615
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
Definition: gmock-matchers.h:2802
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:209
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1303
StartsWithMatcher(const StringType &prefix)
Definition: gmock-matchers.h:989
Impl(Super &x)
Definition: gmock-matchers.h:822
Definition: gmock-matchers.h:613
Definition: gmock-matchers.h:683
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:143
EachMatcher(M m)
Definition: gmock-matchers.h:2206
Definition: gmock-matchers.h:2224
Matcher()
Definition: gmock-matchers.h:256
bool_constant< false > false_type
Definition: gtest-port.h:1469
Definition: gmock-matchers.h:336
const Impl impl_
Definition: gmock-matchers.h:353
typedef void(ENET_CALLBACK *ENetPacketFreeCallback)(struct _ENetPacket *)
PolymorphicMatcher< internal::NotNullMatcher > NotNull()
Definition: gmock-matchers.h:2644
ContainerEqMatcher(const Container &rhs)
Definition: gmock-matchers.h:1898
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:641
RawPairType::second_type SecondType
Definition: gmock-matchers.h:2290
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:348
Impl & mutable_impl()
Definition: gmock-matchers.h:323
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1216
static bool Matches(const MatcherTuple &, const ValueTuple &)
Definition: gmock-matchers.h:563
Matcher1 matcher1_
Definition: gmock-matchers.h:1375
#define GTEST_REFERENCE_TO_CONST_(T)
Definition: gtest-internal.h:840
Definition: gmock-matchers.h:191
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1637
Matcher()
Definition: gmock-matchers.h:291
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:837
Definition: gmock-matchers.h:153
virtual bool MatchAndExplain(LhsContainer lhs, MatchResultListener *listener) const
Definition: gmock-matchers.h:2034
internal::PointwiseMatcher< TupleMatcher, GTEST_REMOVE_CONST_(Container)> Pointwise(const TupleMatcher &tuple_matcher, const Container &rhs)
Definition: gmock-matchers.h:2941
Definition: gmock-matchers.h:317
Matcher2 matcher2_
Definition: gmock-matchers.h:1376
StringType::const_pointer ConstCharPointer
Definition: gmock-matchers.h:892
Impl(CallableStorageType callable, const Matcher< ResultType > &matcher)
Definition: gmock-matchers.h:1839
bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:195
Definition: gmock-matchers.h:796
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq(const internal::string &str)
Definition: gmock-matchers.h:2766
Impl(const InnerMatcher &matcher)
Definition: gmock-matchers.h:1634
const type & const_reference
Definition: gmock-internal-utils.h:380
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:699
MatcherBase(const MatcherInterface< T > *impl)
Definition: gmock-matchers.h:223
CallableTraits< Callable >::ResultType ResultType
Definition: gmock-matchers.h:1821
Definition: gtest-linked_ptr.h:136
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:966
PointwiseMatcher(const TupleMatcher &tuple_matcher, const RhsContainer &rhs)
Definition: gmock-matchers.h:1986
size_t count() const
Definition: gmock-matchers.h:2501
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2025
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1224
PolymorphicMatcher< Impl > MakePolymorphicMatcher(const Impl &impl)
Definition: gmock-matchers.h:383
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition: gmock-matchers.h:1748
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:944
Predicate predicate_
Definition: gmock-matchers.h:1415
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2448
const Matcher< T > matcher2_
Definition: gmock-matchers.h:1351
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:340
const CallableStorageType callable_
Definition: gmock-matchers.h:1873
Definition: gmock-matchers.h:944
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1046
static Message Elements(size_t count)
Definition: gmock-matchers.h:2497
Matcher1 matcher1_
Definition: gmock-matchers.h:1287
Pointer::element_type * GetRawPointer(const Pointer &p)
Definition: gmock-internal-utils.h:76
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:3033
LhsView::const_reference LhsStlContainerReference
Definition: gmock-matchers.h:2005
internal::MatcherAsPredicate< M > Matches(M matcher)
Definition: gmock-matchers.h:3027
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2018
Impl(const TupleMatcher &tuple_matcher, const RhsStlContainer &rhs)
Definition: gmock-matchers.h:2013
const SecondMatcher second_matcher_
Definition: gmock-matchers.h:2386
void ExplainMatchResultTo(T x,::std::ostream *os) const
Definition: gmock-matchers.h:214
bool MatchAndExplain(const LhsContainer &lhs, MatchResultListener *listener) const
Definition: gmock-matchers.h:1915
Definition: gmock-matchers.h:1384
Definition: gmock-matchers.h:74
void PrintIfNotEmpty(const internal::string &explanation, std::ostream *os)
Definition: gmock-matchers.h:458
HasSubstrMatcher(const StringType &substring)
Definition: gmock-matchers.h:948
Functor::result_type ResultType
Definition: gmock-matchers.h:1792
bool MatchAndExplainImpl(true_type, const Class *p, MatchResultListener *listener) const
Definition: gmock-matchers.h:1704
Definition: gmock-matchers.h:1837
void UniversalPrint(const T &value,::std::ostream *os)
Definition: gtest-printers.h:696
PolymorphicMatcher(const Impl &an_impl)
Definition: gmock-matchers.h:319
EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition: gmock-matchers.h:1362
LhsStlContainer::value_type LhsValue
Definition: gmock-matchers.h:2006
const Matcher< T > matcher_
Definition: gmock-matchers.h:1181
const FloatType rhs_
Definition: gmock-matchers.h:1576
bool MatchAndExplain(const char *s, MatchResultListener *listener) const
Definition: gmock-matchers.h:1074
Definition: gmock-matchers.h:2372
Matcher()
Definition: gmock-matchers.h:274
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2176
internal::LeMatcher< Rhs > Le(Rhs x)
Definition: gmock-matchers.h:2620
const StringType string_
Definition: gmock-matchers.h:933
PropertyMatcher(PropertyType(Class::*property)() const, const Matcher< RefToConstProperty > &matcher)
Definition: gmock-matchers.h:1733
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1642
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
Definition: gmock-matchers.h:1759
#define GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(name, op, relation)
Definition: gmock-matchers.h:1115
Definition: gtest-port.h:809
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:637
bool MatchAndExplain(ConstCharPointer s, MatchResultListener *listener) const
Definition: gmock-matchers.h:995
Definition: gmock-internal-utils.h:338
ElementsAreMatcherImpl(InputIter first, size_t a_count)
Definition: gmock-matchers.h:2404
const FirstMatcher first_matcher_
Definition: gmock-matchers.h:2385
virtual ~MatcherInterface()
Definition: gmock-matchers.h:112
Definition: InputPrereqs.h:78
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:915
const FloatType rhs_
Definition: gmock-matchers.h:1600
Definition: gmock-matchers.h:402
const bool nan_eq_nan_
Definition: gmock-matchers.h:1577
Definition: gtest-port.h:1463
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:1232
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
Definition: gmock-matchers.h:2637
virtual bool MatchAndExplain(T, MatchResultListener *) const
Definition: gmock-matchers.h:668
View::const_reference StlContainerReference
Definition: gmock-matchers.h:2090
StreamMatchResultListener(::std::ostream *os)
Definition: gmock-matchers.h:166
::std::stringstream ss_
Definition: gmock-matchers.h:182
Definition: gmock-matchers.h:1512
internal::PairMatcher< FirstMatcher, SecondMatcher > Pair(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: gmock-matchers.h:3019
const RhsStlContainer rhs_
Definition: gmock-matchers.h:2071
const TupleMatcher tuple_matcher_
Definition: gmock-matchers.h:2077
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values,::std::ostream *os)
Definition: gmock-matchers.h:595
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1742
MatchResultListener(::std::ostream *os)
Definition: gmock-matchers.h:78
Definition: gmock-matchers.h:1629
NotMatcher(InnerMatcher matcher)
Definition: gmock-matchers.h:1191
Matcher(const MatcherInterface< T > *impl)
Definition: gmock-matchers.h:259
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:206
Definition: gmock-internal-utils.h:63
Definition: gmock-generated-internal-utils.h:67
static Matcher< T > Cast(const Matcher< U > &matcher)
Definition: gmock-matchers.h:421
virtual ~MatchResultListener()=0
Definition: gmock-matchers.h:105
Definition: gmock-matchers.h:1360
Definition: gmock-matchers.h:985
Definition: gmock-matchers.h:2286
Definition: gmock-matchers.h:1609
Definition: gmock-matchers.h:174
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
Definition: gmock-matchers.h:2924
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
Definition: gmock-matchers.h:2003
const Matcher< const FirstType & > first_matcher_
Definition: gmock-matchers.h:2364
string FormatMatcherDescription(bool negation, const char *matcher_name, const Strings ¶m_values)
Definition: gmock-matchers.cc:92
const RhsStlContainer rhs_
Definition: gmock-matchers.h:2078
bool ExplainMatchResult(M matcher, const T &value, MatchResultListener *listener)
Definition: gmock-matchers.h:3040
virtual ~MatcherBase()
Definition: gmock-matchers.h:226
View::const_reference StlContainerReference
Definition: gmock-matchers.h:2398
const Matcher< InnerMatcherArg > mono_tuple_matcher_
Definition: gmock-matchers.h:2070
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition: gmock-matchers.h:1687
Matcher2 matcher2_
Definition: gmock-matchers.h:1288
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
Definition: gmock-matchers.h:371
void ExplainSuccess(const internal::string &first_explanation, const internal::string &second_explanation, MatchResultListener *listener) const
Definition: gmock-matchers.h:2346
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition: gmock-matchers.h:768
static void CheckIsValid(Functor)
Definition: gmock-matchers.h:1795
Definition: gmock-matchers.h:2508
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1737
RawPairType::first_type FirstType
Definition: gmock-matchers.h:2289
StringType::const_pointer ConstCharPointer
Definition: gmock-matchers.h:987
Definition: InputPrereqs.h:108
Matcher< T > A()
Definition: gmock-matchers.h:2574
std::vector< Matcher< const Element & > > matchers_
Definition: gmock-matchers.h:2502
virtual bool MatchAndExplain(PairType a_pair, MatchResultListener *listener) const
Definition: gmock-matchers.h:2318
static void ExplainMatchFailuresTo(const MatcherTuple &, const ValueTuple &,::std::ostream *)
Definition: gmock-matchers.h:569
ResType ResultType
Definition: gmock-matchers.h:1803
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2309
virtual bool MatchAndExplain(Pointer pointer, MatchResultListener *listener) const
Definition: gmock-matchers.h:1647
Definition: gmock-matchers.h:1523
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1905
const internal::linked_ptr< const RE > regex_
Definition: gmock-matchers.h:1098
Definition: gmock-matchers.h:506
bool IsReadableTypeName(const string &type_name)
Definition: gmock-matchers.h:468
bool MatchAndExplain(ConstCharPointer s, MatchResultListener *listener) const
Definition: gmock-matchers.h:900
RawPairType::first_type KeyType
Definition: gmock-matchers.h:2227
Matcher< Lhs > TypedEq(const Rhs &rhs)
Definition: gmock-matchers.h:2604
NotMatcherImpl(const Matcher< T > &matcher)
Definition: gmock-matchers.h:1165
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:1319
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
Definition: gmock-matchers.h:2781
bool MatchAndExplain(const StringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:1040
Definition: gmock-matchers.h:1819
virtual bool MatchAndExplain(T obj, MatchResultListener *listener) const
Definition: gmock-matchers.h:1852
internal::ContainsMatcher< M > Contains(M matcher)
Definition: gmock-matchers.h:2968
const M inner_matcher_
Definition: gmock-matchers.h:2197
virtual bool MatchAndExplain(PairType key_value, MatchResultListener *listener) const
Definition: gmock-matchers.h:2236
bool StaticAssertTypeEq()
Definition: gtest.h:2074
bool CaseInsensitiveStringEquals(const StringType &s1, const StringType &s2)
Definition: gmock-matchers.h:866
const Matcher< ResultType > matcher_
Definition: gmock-matchers.h:1874
const internal::AnythingMatcher _
Definition: gmock-matchers.h:2571
StlContainer::value_type Element
Definition: gmock-matchers.h:2091
Definition: gmock-matchers.h:1978
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
Definition: gmock-matchers.h:2752
bool MatchAndExplain(const StringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:1000
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1676
Definition: gmock-matchers.h:1026
#define GTEST_REMOVE_CONST_(T)
Definition: gtest-internal.h:811
Matcher< T > MatcherCast(M m)
Definition: gmock-matchers.h:2558
static bool Matches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: gmock-matchers.h:512
DummyMatchResultListener()
Definition: gmock-matchers.h:155
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
Definition: gmock-matchers.h:2657
bool MatchAndExplain(const internal::string &s, MatchResultListener *) const
Definition: gmock-matchers.h:1079
StringType::const_pointer ConstCharPointer
Definition: gmock-matchers.h:946
RhsStlContainer::value_type RhsValue
Definition: gmock-matchers.h:1982
Impl impl_
Definition: gmock-matchers.h:358
const Matcher< const FieldType & > matcher_
Definition: gmock-matchers.h:1717
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2255
Definition: gmock-matchers.h:251
Definition: gtest-printers.h:261
Iter ArrayAwareFind(Iter begin, Iter end, const Element &elem)
Definition: gtest-internal.h:980
bool MatchAndExplain(const StringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:959
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:832
const Matcher< U > source_matcher_
Definition: gmock-matchers.h:650
Matcher(const MatcherInterface< const internal::string & > *impl)
Definition: gmock-matchers.h:276
Definition: gmock-matchers.h:1791
EachMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2162
static Matcher< T > Cast(const Matcher< T > &matcher)
Definition: gmock-matchers.h:661
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
Definition: gmock-matchers.h:2682
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field(FieldType Class::*field, const FieldMatcher &matcher)
Definition: gmock-matchers.h:2693
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2432
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2301
const InnerMatcher matcher_
Definition: gmock-matchers.h:1662
Definition: InputPrereqs.h:80
InnerMatcher matcher_
Definition: gmock-matchers.h:1201
internal::KeyMatcher< M > Key(M inner_matcher)
Definition: gmock-matchers.h:3008
const Matcher< const Pointee & > matcher_
Definition: gmock-matchers.h:1657
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)
Definition: gmock-matchers.h:2904
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1406
internal::LtMatcher< Rhs > Lt(Rhs x)
Definition: gmock-matchers.h:2626
Definition: gmock-matchers.h:1211
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq(double rhs)
Definition: gmock-matchers.h:2663
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1410
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:344
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1085
PointeeMatcher(const InnerMatcher &matcher)
Definition: gmock-matchers.h:1611
StlContainerView< RawContainer > View
Definition: gmock-matchers.h:2088
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:671
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1172
Definition: gtest-message.h:82
const T *const first_
Definition: gmock-matchers.h:2540
KeyMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2230
View::const_reference StlContainerReference
Definition: gmock-matchers.h:1894
RawContainer type
Definition: gmock-internal-utils.h:379
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
Definition: gtest-internal.h:815
PointeeOf< GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(Pointer))>::type Pointee
Definition: gmock-matchers.h:1632
std::tr1::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
Definition: gmock-matchers.h:2011
internal::RefMatcher< T & > Ref(T &x)
Definition: gmock-matchers.h:2651
const Super & object_
Definition: gmock-matchers.h:843
MatcherAsPredicate(M matcher)
Definition: gmock-matchers.h:1425
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:758
static ResultType Invoke(Functor f, T arg)
Definition: gmock-matchers.h:1797
internal::string str() const
Definition: gmock-matchers.h:179
internal::EachMatcher< M > Each(M matcher)
Definition: gmock-matchers.h:3000
Definition: gmock-matchers.h:2159
internal::NeMatcher< Rhs > Ne(Rhs x)
Definition: gmock-matchers.h:2632
CallableTraits< Callable >::StorageType CallableStorageType
Definition: gmock-matchers.h:1834
const Matcher< const KeyType & > inner_matcher_
Definition: gmock-matchers.h:2261
BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition: gmock-matchers.h:1274
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:919
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2147
#define Class(ClassName)
Returns the Identifier of the given class.
Definition: CoreIncludes.h:147