38#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
39#define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
53#include "gtest/gtest.h"
55#if GTEST_HAS_STD_INITIALIZER_LIST_
56# include <initializer_list>
203 template <
typename A,
typename B>
207 template <
typename A,
typename B>
211 template <
typename A,
typename B>
215 template <
typename A,
typename B>
219 template <
typename A,
typename B>
223 template <
typename A,
typename B>
257 return impl_->MatchAndExplain(x, listener);
271 impl_->DescribeNegationTo(os);
319class Matcher :
public internal::MatcherBase<T> {
372#if GTEST_HAS_STRING_PIECE_
378 :
public internal::MatcherBase<const StringPiece&> {
402 explicit Matcher(
const MatcherInterface<StringPiece>* impl)
403 : internal::MatcherBase<StringPiece>(impl) {}
407 Matcher(
const internal::string&
s);
410 Matcher(
const char*
s);
413 Matcher(StringPiece
s);
442 template <
typename T>
448 template <
typename T>
454 impl_.DescribeTo(os);
458 impl_.DescribeNegationTo(os);
462 return impl_.MatchAndExplain(x, listener);
514template <
typename T,
typename M>
532 polymorphic_matcher_or_value,
555 return polymorphic_matcher_or_value;
562template <
typename T,
typename U>
609template <
typename T,
typename M>
626 template <
typename M>
640 template <
typename U>
644 T_must_be_implicitly_convertible_to_U);
649 cannot_convert_non_referentce_arg_to_reference);
657 kTIsOther || kUIsOther ||
658 (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
659 conversion_of_arithmetic_types_must_be_lossless);
664template <
typename T,
typename M>
679 ::std::ostream* os) {
680 if (explanation !=
"" && os != NULL) {
681 *os <<
", " << explanation;
691 return (type_name.length() <= 20 ||
692 type_name.find_first_of(
"<(") == string::npos);
700template <
typename Value,
typename T>
716 *listener->
stream() <<
" (of type " << type_name <<
")";
731 template <
typename MatcherTuple,
typename ValueTuple>
733 const ValueTuple& value_tuple) {
742 template <
typename MatcherTuple,
typename ValueTuple>
744 const ValueTuple& values,
745 ::std::ostream* os) {
752 get<N - 1>(matchers);
753 typedef typename tuple_element<N - 1, ValueTuple>
::type Value;
756 if (!matcher.MatchAndExplain(
value, &listener)) {
759 *os <<
" Expected arg #" << N - 1 <<
": ";
760 get<N - 1>(matchers).DescribeTo(os);
761 *os <<
"\n Actual: ";
778 template <
typename MatcherTuple,
typename ValueTuple>
780 const ValueTuple& ) {
784 template <
typename MatcherTuple,
typename ValueTuple>
795template <
typename MatcherTuple,
typename ValueTuple>
797 const ValueTuple& value_tuple) {
801 tuple_size<ValueTuple>::value,
802 matcher_and_value_have_different_numbers_of_fields);
804 Matches(matcher_tuple, value_tuple);
809template <
typename MatcherTuple,
typename ValueTuple>
811 const ValueTuple& values,
812 ::std::ostream* os) {
814 matchers, values, os);
821template <
typename Tuple,
typename Func,
typename OutIter>
829 static OutIter
Run(Func f,
const Tuple& t, OutIter out) {
834 template <
typename Tup,
size_t kRemainingSize>
836 OutIter
operator() (Func f,
const Tup& t, OutIter out)
const {
837 *out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t));
841 template <
typename Tup>
852template <
typename Tuple,
typename Func,
typename OutIter>
863 virtual void DescribeTo(::std::ostream* os)
const { *os <<
"is anything"; }
868 *os <<
"never matches";
878 template <
typename T>
892template <
typename D,
typename Rhs,
typename Op>
896 template <
typename Lhs>
902 template <
typename Lhs>
908 return Op()(lhs,
rhs_);
911 *os << D::Desc() <<
" ";
915 *os << D::NegatedDesc() <<
" ";
926template <
typename Rhs>
931 static const char*
Desc() {
return "is equal to"; }
934template <
typename Rhs>
939 static const char*
Desc() {
return "isn't equal to"; }
942template <
typename Rhs>
947 static const char*
Desc() {
return "is <"; }
950template <
typename Rhs>
955 static const char*
Desc() {
return "is >"; }
958template <
typename Rhs>
963 static const char*
Desc() {
return "is <="; }
966template <
typename Rhs>
971 static const char*
Desc() {
return "is >="; }
979 template <
typename Po
inter>
989 void DescribeTo(::std::ostream* os)
const { *os <<
"is NULL"; }
999 template <
typename Po
inter>
1003 return p !=
nullptr;
1009 void DescribeTo(::std::ostream* os)
const { *os <<
"isn't NULL"; }
1028template <
typename T>
1031template <
typename T>
1044 template <
typename Super>
1055 template <
typename Super>
1064 *listener <<
"which is located @" <<
static_cast<const void*
>(&x);
1069 *os <<
"references the variable ";
1074 *os <<
"does not reference the variable ";
1095 const wchar_t* rhs) {
1101template <
typename StringType>
1103 const StringType& s2) {
1110 const typename StringType::value_type nul = 0;
1111 const size_t i1 = s1.find(nul), i2 = s2.find(nul);
1114 if (i1 == StringType::npos || i2 == StringType::npos) {
1125template <
typename StringType>
1129 bool case_sensitive)
1137 template <
typename CharType>
1149 template <
typename MatcheeStringType>
1152 const StringType& s2(
s);
1168 *os << (expect_eq ?
"is " :
"isn't ");
1171 *os <<
"(ignoring case) ";
1186template <
typename StringType>
1197 template <
typename CharType>
1206 template <
typename MatcheeStringType>
1209 const StringType& s2(
s);
1210 return s2.find(
substring_) != StringType::npos;
1215 *os <<
"has substring ";
1220 *os <<
"has no substring ";
1233template <
typename StringType>
1244 template <
typename CharType>
1253 template <
typename MatcheeStringType>
1256 const StringType& s2(
s);
1257 return s2.length() >=
prefix_.length() &&
1262 *os <<
"starts with ";
1267 *os <<
"doesn't start with ";
1280template <
typename StringType>
1290 template <
typename CharType>
1299 template <
typename MatcheeStringType>
1302 const StringType& s2(
s);
1303 return s2.length() >=
suffix_.length() &&
1308 *os <<
"ends with ";
1313 *os <<
"doesn't end with ";
1336 template <
typename CharType>
1345 template <
class MatcheeStringType>
1355 <<
" regular expression ";
1360 *os <<
"doesn't " << (
full_match_ ?
"match" :
"contain")
1361 <<
" regular expression ";
1380template <
typename D,
typename Op>
1383 template <
typename T1,
typename T2>
1387 template <
typename T1,
typename T2>
1393 static ::std::ostream&
GetDesc(::std::ostream& os) {
1394 return os << D::Desc();
1397 template <
typename Tuple>
1403 return Op()(::testing::get<0>(args), ::testing::get<1>(args));
1416 static const char*
Desc() {
return "an equal pair"; }
1420 static const char*
Desc() {
return "an unequal pair"; }
1424 static const char*
Desc() {
return "a pair where the first < the second"; }
1428 static const char*
Desc() {
return "a pair where the first > the second"; }
1432 static const char*
Desc() {
return "a pair where the first <= the second"; }
1436 static const char*
Desc() {
return "a pair where the first >= the second"; }
1443template <
typename T>
1450 return !
matcher_.MatchAndExplain(x, listener);
1469template <
typename InnerMatcher>
1476 template <
typename T>
1491template <
typename T>
1517 if (!
matcher1_.MatchAndExplain(x, &listener1)) {
1518 *listener << listener1.
str();
1523 if (!
matcher2_.MatchAndExplain(x, &listener2)) {
1524 *listener << listener2.
str();
1537 *listener <<
", and " << s2;
1558template <
int kSize,
typename Head,
typename... Tail>
1560 typedef MatcherList<kSize - 1, Tail...> MatcherListTail;
1561 typedef ::std::pair<Head, typename MatcherListTail::ListType> ListType;
1567 static ListType BuildList(
const Head& matcher,
const Tail&... tail) {
1568 return ListType(matcher, MatcherListTail::BuildList(tail...));
1575 template <
typename T,
template <
typename >
class CombiningMatcher>
1579 MatcherListTail::template CreateMatcher<T, CombiningMatcher>(
1586template <
typename Matcher1,
typename Matcher2>
1587struct MatcherList<2, Matcher1, Matcher2> {
1588 typedef ::std::pair<Matcher1, Matcher2> ListType;
1590 static ListType BuildList(
const Matcher1& matcher1,
1591 const Matcher2& matcher2) {
1592 return ::std::pair<Matcher1, Matcher2>(matcher1, matcher2);
1595 template <
typename T,
template <
typename >
class CombiningMatcher>
1596 static Matcher<
T> CreateMatcher(
const ListType& matchers) {
1597 return Matcher<T>(
new CombiningMatcher<T>(
1598 SafeMatcherCast<T>(matchers.first),
1599 SafeMatcherCast<T>(matchers.second)));
1607template <
template <
typename T>
class CombiningMatcher,
typename...
Args>
1608class VariadicMatcher {
1610 VariadicMatcher(
const Args&... matchers)
1611 : matchers_(MatcherListType::BuildList(matchers...)) {}
1616 template <
typename T>
1617 operator Matcher<T>()
const {
1618 return MatcherListType::template CreateMatcher<T, CombiningMatcher>(
1623 typedef MatcherList<
sizeof...(Args),
Args...> MatcherListType;
1625 const typename MatcherListType::ListType matchers_;
1630template <
typename...
Args>
1637template <
typename Matcher1,
typename Matcher2>
1646 template <
typename T>
1663template <
typename T>
1689 if (
matcher1_.MatchAndExplain(x, &listener1)) {
1690 *listener << listener1.
str();
1695 if (
matcher2_.MatchAndExplain(x, &listener2)) {
1696 *listener << listener2.
str();
1709 *listener <<
", and " << s2;
1724template <
typename...
Args>
1732template <
typename Matcher1,
typename Matcher2>
1741 template <
typename T>
1756template <
typename Predicate>
1765 template <
typename T>
1780 *os <<
"satisfies the given predicate";
1784 *os <<
"doesn't satisfy the given predicate";
1795template <
typename M>
1806 template <
typename T>
1833template <
typename M>
1841 template <
typename T>
1859 ::std::stringstream ss;
1860 ss <<
"Value of: " << value_text <<
"\n"
1863 ss <<
"\n Actual: " << listener.
str();
1877template <
typename M>
1887template <
typename FloatType>
1904 FloatType max_abs_error)
1909 <<
", where max_abs_error is" << max_abs_error;
1913 template <
typename T>
1916 Impl(FloatType expected,
bool nan_eq_nan, FloatType max_abs_error)
1926 if (actual.is_nan() || expected.
is_nan()) {
1927 if (actual.is_nan() && expected.
is_nan()) {
1948 *listener <<
"which is " << diff <<
" from " <<
expected_;
1952 return actual.AlmostEquals(expected);
1960 const ::std::streamsize old_precision = os->precision(
1961 ::std::numeric_limits<FloatType>::digits10 + 2);
1966 *os <<
"never matches";
1969 *os <<
"is approximately " <<
expected_;
1974 os->precision(old_precision);
1979 const ::std::streamsize old_precision = os->precision(
1980 ::std::numeric_limits<FloatType>::digits10 + 2);
1985 *os <<
"is anything";
1988 *os <<
"isn't approximately " <<
expected_;
1994 os->precision(old_precision);
2042template <
typename InnerMatcher>
2055 template <
typename Po
inter>
2062 template <
typename Po
inter>
2068 explicit Impl(
const InnerMatcher& matcher)
2072 *os <<
"points to a value that ";
2077 *os <<
"does not point to a value that ";
2086 *listener <<
"which points to ";
2107template <
typename To>
2130 return "the target type";
2136 *os <<
"when dynamic_cast to " <<
GetToName() <<
", ";
2144template <
typename To>
2150 template <
typename From>
2153 To to =
dynamic_cast<To>(from);
2160template <
typename To>
2166 template <
typename From>
2169 To* to =
dynamic_cast<To*
>(&from);
2171 *listener <<
"which cannot be dynamic_cast to " << this->
GetToName();
2180template <
typename Class,
typename FieldType>
2188 *os <<
"is an object whose given field ";
2193 *os <<
"is an object whose given field ";
2197 template <
typename T>
2200 typename ::testing::internal::
2211 *listener <<
"whose given field is ";
2220 *listener <<
"which points to an object ";
2235template <
typename Class,
typename PropertyType>
2249 *os <<
"is an object whose given property ";
2254 *os <<
"is an object whose given property ";
2258 template <
typename T>
2261 typename ::testing::internal::
2272 *listener <<
"whose given property is ";
2275#if defined(_PREFAST_ ) && _MSC_VER == 1800
2291 *listener <<
"which points to an object ";
2308template <
typename Functor>
2314 template <
typename T>
2319template <
typename ArgType,
typename ResType>
2326 <<
"NULL function pointer is passed into ResultOf().";
2328 template <
typename T>
2329 static ResType
Invoke(ResType(*f)(ArgType),
T arg) {
2336template <
typename Callable>
2346 template <
typename T>
2354 template <
typename T>
2361 *os <<
"is mapped by the given callable to a value that ";
2366 *os <<
"is mapped by the given callable to a value that ";
2371 *listener <<
"which is mapped by the given callable to ";
2398template <
typename SizeMatcher>
2405 template <
typename Container>
2410 template <
typename Container>
2415 typedef typename ContainerView::type::size_type
SizeType;
2416 explicit Impl(
const SizeMatcher& size_matcher)
2434 <<
"whose size " << size << (
result ?
" matches" :
" doesn't match");
2451template <
typename DistanceMatcher>
2457 template <
typename Container>
2462 template <
typename Container>
2467 typedef typename std::iterator_traits<
2468 typename ContainerView::type::const_iterator>::difference_type
2470 explicit Impl(
const DistanceMatcher& distance_matcher)
2474 *os <<
"distance between begin() and end() ";
2478 *os <<
"distance between begin() and end() ";
2484#if GTEST_HAS_STD_BEGIN_AND_END_
2487 DistanceType distance = std::distance(begin(container), end(container));
2489 DistanceType distance = std::distance(container.begin(), container.end());
2494 *listener <<
"whose distance between begin() and end() " << distance
2495 << (
result ?
" matches" :
" doesn't match");
2520template <
typename Container>
2542 *os <<
"does not equal ";
2546 template <
typename LhsContainer>
2553 typedef typename LhsView::type LhsStlContainer;
2558 ::std::ostream*
const os = listener->
stream();
2561 bool printed_header =
false;
2562 for (
typename LhsStlContainer::const_iterator it =
2563 lhs_stl_container.begin();
2564 it != lhs_stl_container.end(); ++it) {
2567 if (printed_header) {
2570 *os <<
"which has these unexpected elements: ";
2571 printed_header =
true;
2578 bool printed_header2 =
false;
2579 for (
typename StlContainer::const_iterator it =
expected_.begin();
2582 lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==
2583 lhs_stl_container.end()) {
2584 if (printed_header2) {
2587 *os << (printed_header ?
",\nand" :
"which")
2588 <<
" doesn't have these expected elements: ";
2589 printed_header2 =
true;
2607 template <
typename T,
typename U>
2608 bool operator()(
const T& lhs,
const U& rhs)
const {
return lhs < rhs; }
2612template <
typename Comparator,
typename ContainerMatcher>
2616 const ContainerMatcher& matcher)
2619 template <
typename LhsContainer>
2624 template <
typename LhsContainer>
2636 Impl(
const Comparator& comparator,
const ContainerMatcher& matcher)
2640 *os <<
"(when sorted) ";
2645 *os <<
"(when sorted) ";
2652 ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
2653 lhs_stl_container.end());
2655 sorted_container.begin(), sorted_container.end(),
comparator_);
2660 return matcher_.Matches(sorted_container);
2663 *listener <<
"which is ";
2665 *listener <<
" when sorted";
2668 const bool match =
matcher_.MatchAndExplain(sorted_container,
2692template <
typename TupleMatcher,
typename RhsContainer>
2709 template <
typename LhsContainer>
2714 template <
typename LhsContainer>
2734 *os <<
"contains " <<
rhs_.size()
2735 <<
" values, where each value and its corresponding value in ";
2741 *os <<
"doesn't contain exactly " <<
rhs_.size()
2742 <<
" values, or contains a value x at some index i"
2743 <<
" where x and the i-th value of ";
2752 const size_t actual_size = lhs_stl_container.size();
2753 if (actual_size !=
rhs_.size()) {
2754 *listener <<
"which contains " << actual_size <<
" values";
2758 typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
2759 typename RhsStlContainer::const_iterator right =
rhs_.begin();
2760 for (
size_t i = 0; i != actual_size; ++i, ++left, ++right) {
2766 value_pair, &inner_listener)) {
2767 *listener <<
"where the value pair (";
2771 *listener <<
") at index #" << i <<
" don't match";
2799template <
typename Container>
2806 typedef typename StlContainer::value_type
Element;
2808 template <
typename InnerMatcher>
2817 Container container,
2821 for (
typename StlContainer::const_iterator it = stl_container.begin();
2822 it != stl_container.end(); ++it, ++i) {
2824 const bool matches =
inner_matcher_.MatchAndExplain(*it, &inner_listener);
2826 if (matches != all_elements_should_match) {
2827 *listener <<
"whose element #" << i
2828 << (matches ?
" matches" :
" doesn't match");
2830 return !all_elements_should_match;
2833 return all_elements_should_match;
2844template <
typename Container>
2847 template <
typename InnerMatcher>
2853 *os <<
"contains at least one element that ";
2858 *os <<
"doesn't contain any element that ";
2873template <
typename Container>
2876 template <
typename InnerMatcher>
2882 *os <<
"only contains elements that ";
2887 *os <<
"contains some element that ";
2901template <
typename M>
2906 template <
typename Container>
2918template <
typename M>
2923 template <
typename Container>
2938template <
typename PairType>
2944 template <
typename InnerMatcher>
2954 const bool match =
inner_matcher_.MatchAndExplain(key_value.first,
2957 if (explanation !=
"") {
2958 *listener <<
"whose first field is a value " << explanation;
2965 *os <<
"has a key that ";
2971 *os <<
"doesn't have a key that ";
2982template <
typename M>
2987 template <
typename PairType>
3000template <
typename PairType>
3007 template <
typename FirstMatcher,
typename SecondMatcher>
3017 *os <<
"has a first field that ";
3019 *os <<
", and has a second field that ";
3025 *os <<
"has a first field that ";
3027 *os <<
", or has a second field that ";
3043 &first_inner_listener)) {
3044 *listener <<
"whose first field does not match";
3050 &second_inner_listener)) {
3051 *listener <<
"whose second field does not match";
3064 *listener <<
"whose both fields match";
3065 if (first_explanation !=
"") {
3066 *listener <<
", where the first field is a value " << first_explanation;
3068 if (second_explanation !=
"") {
3070 if (first_explanation !=
"") {
3071 *listener <<
"and ";
3073 *listener <<
"where ";
3075 *listener <<
"the second field is a value " << second_explanation;
3086template <
typename FirstMatcher,
typename SecondMatcher>
3092 template <
typename PairType>
3107template <
typename Container>
3114 typedef typename StlContainer::value_type
Element;
3118 template <
typename InputIter>
3120 while (first != last) {
3129 }
else if (
count() == 1) {
3130 *os <<
"has 1 element that ";
3134 for (
size_t i = 0; i !=
count(); ++i) {
3135 *os <<
"element #" << i <<
" ";
3137 if (i + 1 <
count()) {
3147 *os <<
"isn't empty";
3152 for (
size_t i = 0; i !=
count(); ++i) {
3153 *os <<
"element #" << i <<
" ";
3155 if (i + 1 <
count()) {
3166 const bool listener_interested = listener->
IsInterested();
3169 ::std::vector<internal::string> explanations(
count());
3171 typename StlContainer::const_iterator it = stl_container.begin();
3172 size_t exam_pos = 0;
3173 bool mismatch_found =
false;
3178 for (; it != stl_container.end() && exam_pos !=
count(); ++it, ++exam_pos) {
3180 if (listener_interested) {
3182 match =
matchers_[exam_pos].MatchAndExplain(*it, &
s);
3183 explanations[exam_pos] =
s.str();
3185 match =
matchers_[exam_pos].Matches(*it);
3189 mismatch_found =
true;
3198 size_t actual_count = exam_pos;
3199 for (; it != stl_container.end(); ++it) {
3203 if (actual_count !=
count()) {
3208 if (listener_interested && (actual_count != 0)) {
3209 *listener <<
"which has " <<
Elements(actual_count);
3214 if (mismatch_found) {
3216 if (listener_interested) {
3217 *listener <<
"whose element #" << exam_pos <<
" doesn't match";
3225 if (listener_interested) {
3226 bool reason_printed =
false;
3227 for (
size_t i = 0; i !=
count(); ++i) {
3230 if (reason_printed) {
3231 *listener <<
",\nand ";
3233 *listener <<
"whose element #" << i <<
" matches, " <<
s;
3234 reason_printed =
true;
3281 string DebugString()
const;
3325 const ::std::vector<string>& element_printouts,
3334 return Message() << n <<
" element" << (n == 1 ?
"" :
"s");
3344template <
typename Container>
3354 typedef typename StlContainer::value_type
Element;
3358 template <
typename InputIter>
3360 for (; first != last; ++first) {
3379 ::std::vector<string> element_printouts;
3381 stl_container.end(),
3385 const size_t actual_count = matrix.
LhsSize();
3386 if (actual_count == 0 &&
matchers_.empty()) {
3395 *listener <<
"which has " <<
Elements(actual_count);
3401 matrix, listener) &&
3408 template <
typename ElementIter>
3410 ::std::vector<string>* element_printouts,
3412 element_printouts->clear();
3413 ::std::vector<char> did_match;
3414 size_t num_elements = 0;
3415 for (; elem_first != elem_last; ++num_elements, ++elem_first) {
3419 for (
size_t irhs = 0; irhs !=
matchers_.size(); ++irhs) {
3425 ::std::vector<char>::const_iterator did_match_iter = did_match.begin();
3426 for (
size_t ilhs = 0; ilhs != num_elements; ++ilhs) {
3427 for (
size_t irhs = 0; irhs !=
matchers_.size(); ++irhs) {
3428 matrix.
SetEdge(ilhs, irhs, *did_match_iter++ != 0);
3441template <
typename Target>
3443 template <
typename Arg>
3450template <
typename MatcherTuple>
3456 template <
typename Container>
3460 typedef typename View::value_type Element;
3461 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
3462 MatcherVec matchers;
3463 matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
3465 ::std::back_inserter(matchers));
3467 matchers.begin(), matchers.end()));
3476template <
typename MatcherTuple>
3481 template <
typename Container>
3485 typedef typename View::value_type Element;
3486 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
3487 MatcherVec matchers;
3488 matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
3490 ::std::back_inserter(matchers));
3492 matchers.begin(), matchers.end()));
3501template <
typename T>
3506 template <
typename Iter>
3510 template <
typename Container>
3524template <
typename T>
3527 template <
typename Iter>
3530 template <
typename Container>
3551template <
typename Tuple2Matcher,
typename Second>
3557 template <
typename T>
3571 GTEST_LOG_(FATAL) <<
"BoundSecondMatcher should never be assigned.";
3575 template <
typename T>
3580 Impl(
const Tuple2Matcher& tm,
const Second& second)
3611template <
typename Tuple2Matcher,
typename Second>
3613 const Tuple2Matcher& tm,
const Second& second) {
3623 const char* matcher_name,
3643template <
typename Iter>
3644inline internal::ElementsAreArrayMatcher<
3645 typename ::std::iterator_traits<Iter>::value_type>
3647 typedef typename ::std::iterator_traits<Iter>::value_type
T;
3651template <
typename T>
3657template <
typename T,
size_t N>
3659 const T (&array)[N]) {
3663template <
typename Container>
3664inline internal::ElementsAreArrayMatcher<typename Container::value_type>
3669#if GTEST_HAS_STD_INITIALIZER_LIST_
3670template <
typename T>
3671inline internal::ElementsAreArrayMatcher<T>
3685template <
typename Iter>
3687 typename ::std::iterator_traits<Iter>::value_type>
3689 typedef typename ::std::iterator_traits<Iter>::value_type
T;
3693template <
typename T>
3694inline internal::UnorderedElementsAreArrayMatcher<T>
3699template <
typename T,
size_t N>
3700inline internal::UnorderedElementsAreArrayMatcher<T>
3705template <
typename Container>
3706inline internal::UnorderedElementsAreArrayMatcher<
3707 typename Container::value_type>
3712#if GTEST_HAS_STD_INITIALIZER_LIST_
3713template <
typename T>
3714inline internal::UnorderedElementsAreArrayMatcher<T>
3731template <
typename T>
3735template <
typename T>
3741template <
typename T>
3746template <
typename T>
3761template <
typename Lhs,
typename Rhs>
3765template <
typename Rhs>
3771template <
typename Rhs>
3777template <
typename Rhs>
3783template <
typename Rhs>
3789template <
typename Rhs>
3808template <
typename T>
3829 double rhs,
double max_abs_error) {
3837 double rhs,
double max_abs_error) {
3857 float rhs,
float max_abs_error) {
3865 float rhs,
float max_abs_error) {
3871template <
typename InnerMatcher>
3873 const InnerMatcher& inner_matcher) {
3883template <
typename To>
3884inline PolymorphicMatcher<internal::WhenDynamicCastToMatcher<To> >
3894template <
typename Class,
typename FieldType,
typename FieldMatcher>
3895inline PolymorphicMatcher<
3897 FieldType Class::*field,
const FieldMatcher& matcher) {
3911template <
typename Class,
typename PropertyType,
typename PropertyMatcher>
3912inline PolymorphicMatcher<
3914 PropertyType (Class::*property)()
const,
const PropertyMatcher& matcher) {
3938template <
typename Callable,
typename ResultOfMatcher>
3940 Callable callable,
const ResultOfMatcher& matcher) {
3954inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3961inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3968inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3975inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3978 str,
false,
false));
3983inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::string> >
3990inline PolymorphicMatcher<internal::StartsWithMatcher<internal::string> >
3997inline PolymorphicMatcher<internal::EndsWithMatcher<internal::string> >
4025#if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
4029inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
4030 StrEq(
const internal::wstring&
str) {
4037 StrNe(
const internal::wstring&
str) {
4053 str,
false,
false));
4059 HasSubstr(
const internal::wstring& substring) {
4066 StartsWith(
const internal::wstring& prefix) {
4073 EndsWith(
const internal::wstring& suffix) {
4106template <
typename InnerMatcher>
4114template <
typename Predicate>
4115inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> >
4126template <
typename SizeMatcher>
4127inline internal::SizeIsMatcher<SizeMatcher>
4137template <
typename DistanceMatcher>
4138inline internal::BeginEndDistanceIsMatcher<DistanceMatcher>
4147template <
typename Container>
4148inline PolymorphicMatcher<internal::ContainerEqMatcher<
4160template <
typename Comparator,
typename ContainerMatcher>
4161inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher>
4163 const ContainerMatcher& container_matcher) {
4165 comparator, container_matcher);
4170template <
typename ContainerMatcher>
4171inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>
4184template <
typename TupleMatcher,
typename Container>
4185inline internal::PointwiseMatcher<TupleMatcher,
4187Pointwise(
const TupleMatcher& tuple_matcher,
const Container& rhs) {
4193 tuple_matcher, rhs);
4196#if GTEST_HAS_STD_INITIALIZER_LIST_
4199template <
typename TupleMatcher,
typename T>
4200inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> >
Pointwise(
4201 const TupleMatcher& tuple_matcher, std::initializer_list<T> rhs) {
4202 return Pointwise(tuple_matcher, std::vector<T>(rhs));
4218template <
typename Tuple2Matcher,
typename RhsContainer>
4222 RhsContainer)>::type::value_type> >
4224 const RhsContainer& rhs_container) {
4233 typedef typename RhsView::type RhsStlContainer;
4234 typedef typename RhsStlContainer::value_type Second;
4235 const RhsStlContainer& rhs_stl_container =
4236 RhsView::ConstReference(rhs_container);
4239 ::std::vector<internal::BoundSecondMatcher<Tuple2Matcher, Second> > matchers;
4240 for (
typename RhsStlContainer::const_iterator it = rhs_stl_container.begin();
4241 it != rhs_stl_container.end(); ++it) {
4250#if GTEST_HAS_STD_INITIALIZER_LIST_
4253template <
typename Tuple2Matcher,
typename T>
4254inline internal::UnorderedElementsAreArrayMatcher<
4255 typename internal::BoundSecondMatcher<Tuple2Matcher, T> >
4257 std::initializer_list<T> rhs) {
4281template <
typename M>
4313template <
typename M>
4321template <
typename M>
4331template <
typename FirstMatcher,
typename SecondMatcher>
4332inline internal::PairMatcher<FirstMatcher, SecondMatcher>
4333Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
4335 first_matcher, second_matcher);
4340template <
typename M>
4346template <
typename T,
typename M>
4353template <
typename T,
typename M>
4362template <
typename...
Args>
4363inline internal::AllOfMatcher<
Args...>
AllOf(
const Args&... matchers) {
4364 return internal::AllOfMatcher<
Args...>(matchers...);
4367template <
typename...
Args>
4368inline internal::AnyOfMatcher<
Args...>
AnyOf(
const Args&... matchers) {
4369 return internal::AnyOfMatcher<
Args...>(matchers...);
4381template <
typename InnerMatcher>
4382inline InnerMatcher
AllArgs(
const InnerMatcher& matcher) {
return matcher; }
4388#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
4389 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
4390#define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\
4391 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
#define s(x, c)
Definition aesb.c:47
cryptonote::block b
Definition block.cpp:40
Definition gmock-matchers.h:319
Matcher()
Definition gmock-matchers.h:324
Definition gmock-matchers.h:80
MatchResultListener(::std::ostream *os)
Definition gmock-matchers.h:85
::std::ostream * stream()
Definition gmock-matchers.h:98
::std::ostream *const stream_
Definition gmock-matchers.h:107
MatchResultListener & operator<<(const T &x)
Definition gmock-matchers.h:91
virtual ~MatchResultListener()=0
Definition gmock-matchers.h:112
bool IsInterested() const
Definition gmock-matchers.h:104
GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener)
Definition gmock-matchers.h:117
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:134
virtual void DescribeTo(::std::ostream *os) const =0
virtual ~MatcherDescriberInterface()
Definition gmock-matchers.h:119
Definition gmock-matchers.h:143
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const =0
Matcher()
Definition gmock-matchers.h:342
Matcher(const internal::string &s)
Matcher(const MatcherInterface< const internal::string & > *impl)
Definition gmock-matchers.h:344
Matcher(const MatcherInterface< internal::string > *impl)
Definition gmock-matchers.h:361
Matcher()
Definition gmock-matchers.h:359
Definition gmock-matchers.h:319
Matcher()
Definition gmock-matchers.h:324
Matcher(T value)
Definition gmock-matchers.h:3747
Matcher(const MatcherInterface< T > *impl)
Definition gmock-matchers.h:327
Definition gtest-message.h:85
Definition gmock-matchers.h:449
GTEST_DISALLOW_ASSIGN_(MonomorphicImpl)
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition gmock-matchers.h:461
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:457
MonomorphicImpl(const Impl &impl)
Definition gmock-matchers.h:451
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:453
const Impl impl_
Definition gmock-matchers.h:466
Definition gmock-matchers.h:430
GTEST_DISALLOW_ASSIGN_(PolymorphicMatcher)
PolymorphicMatcher(const Impl &an_impl)
Definition gmock-matchers.h:432
Impl & mutable_impl()
Definition gmock-matchers.h:436
const Impl & impl() const
Definition gmock-matchers.h:440
Impl impl_
Definition gmock-matchers.h:471
Definition gmock-matchers.h:622
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
Definition gmock-matchers.h:627
static Matcher< T > Cast(const Matcher< U > &matcher)
Definition gmock-matchers.h:641
Definition gmock-matchers.h:184
StringMatchResultListener()
Definition gmock-matchers.h:186
::std::stringstream ss_
Definition gmock-matchers.h:195
GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener)
internal::string str() const
Definition gmock-matchers.h:189
void Clear()
Definition gmock-matchers.h:192
DummyMatchResultListener()
Definition gmock-matchers.h:230
Impl(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
Definition gmock-matchers.h:1916
FloatingEqMatcher(FloatType expected, bool nan_eq_nan)
Definition gmock-matchers.h:1896
MatchMatrix(size_t num_elements, size_t num_matchers)
Definition gmock-matchers.h:3259
MatchResultListener(::std::ostream *os)
Definition gmock-matchers.h:85
MonomorphicImpl(const Impl &impl)
Definition gmock-matchers.h:451
PolymorphicMatcher(const Impl &an_impl)
Definition gmock-matchers.h:432
StreamMatchResultListener(::std::ostream *os)
Definition gmock-matchers.h:241
StringMatchResultListener()
Definition gmock-matchers.h:186
Definition gmock-matchers.h:859
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:863
virtual bool MatchAndExplain(T, MatchResultListener *) const
Definition gmock-matchers.h:861
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:864
Definition gmock-matchers.h:876
Definition gmock-matchers.h:2463
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2477
GTEST_DISALLOW_ASSIGN_(Impl)
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
Definition gmock-matchers.h:2466
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2473
Impl(const DistanceMatcher &distance_matcher)
Definition gmock-matchers.h:2470
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition gmock-matchers.h:2482
const Matcher< DistanceType > distance_matcher_
Definition gmock-matchers.h:2501
std::iterator_traits< typenameContainerView::type::const_iterator >::difference_type DistanceType
Definition gmock-matchers.h:2469
Definition gmock-matchers.h:2452
BeginEndDistanceIsMatcher(const DistanceMatcher &distance_matcher)
Definition gmock-matchers.h:2454
GTEST_DISALLOW_ASSIGN_(BeginEndDistanceIsMatcher)
const DistanceMatcher distance_matcher_
Definition gmock-matchers.h:2506
Definition gmock-matchers.h:1492
const Matcher< T > matcher1_
Definition gmock-matchers.h:1544
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1497
BothOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition gmock-matchers.h:1494
GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl)
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition gmock-matchers.h:1513
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1505
const Matcher< T > matcher2_
Definition gmock-matchers.h:1545
typename AllOfResult1< M2 >::type matcher2_
Definition gmock-matchers.h:1654
typename AllOfResult1< M1 >::type matcher1_
Definition gmock-matchers.h:1653
GTEST_DISALLOW_ASSIGN_(BothOfMatcher)
BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition gmock-matchers.h:1640
Definition gmock-matchers.h:3576
const Second second_value_
Definition gmock-matchers.h:3598
Impl(const Tuple2Matcher &tm, const Second &second)
Definition gmock-matchers.h:3580
const Matcher< const ArgTuple & > mono_tuple2_matcher_
Definition gmock-matchers.h:3597
GTEST_DISALLOW_ASSIGN_(Impl)
::testing::tuple< T, Second > ArgTuple
Definition gmock-matchers.h:3578
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:3584
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition gmock-matchers.h:3591
Definition gmock-matchers.h:3552
const Tuple2Matcher tuple2_matcher_
Definition gmock-matchers.h:3603
const Second second_value_
Definition gmock-matchers.h:3604
void operator=(const BoundSecondMatcher &)
Definition gmock-matchers.h:3570
BoundSecondMatcher(const Tuple2Matcher &tm, const Second &second)
Definition gmock-matchers.h:3554
Definition gmock-matchers.h:903
GTEST_DISALLOW_ASSIGN_(Impl)
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:910
virtual bool MatchAndExplain(Lhs lhs, MatchResultListener *) const
Definition gmock-matchers.h:906
Rhs rhs_
Definition gmock-matchers.h:919
Impl(const Rhs &rhs)
Definition gmock-matchers.h:905
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:914
ComparisonBase(const Rhs &rhs)
Definition gmock-matchers.h:895
GTEST_DISALLOW_ASSIGN_(ComparisonBase)
Rhs rhs_
Definition gmock-matchers.h:922
Definition gmock-matchers.h:2521
internal::StlContainerView< Container > View
Definition gmock-matchers.h:2523
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2537
bool MatchAndExplain(const LhsContainer &lhs, MatchResultListener *listener) const
Definition gmock-matchers.h:2547
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2541
GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher)
View::type StlContainer
Definition gmock-matchers.h:2524
View::const_reference StlContainerReference
Definition gmock-matchers.h:2525
const StlContainer expected_
Definition gmock-matchers.h:2600
ContainerEqMatcher(const Container &expected)
Definition gmock-matchers.h:2529
Definition gmock-matchers.h:2845
GTEST_DISALLOW_ASSIGN_(ContainsMatcherImpl)
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition gmock-matchers.h:2862
ContainsMatcherImpl(InnerMatcher inner_matcher)
Definition gmock-matchers.h:2848
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2857
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2852
Definition gmock-matchers.h:2902
ContainsMatcher(M m)
Definition gmock-matchers.h:2904
const M inner_matcher_
Definition gmock-matchers.h:2912
GTEST_DISALLOW_ASSIGN_(ContainsMatcher)
Definition gmock-matchers.h:228
DummyMatchResultListener()
Definition gmock-matchers.h:230
GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener)
Definition gmock-matchers.h:2874
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition gmock-matchers.h:2891
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2886
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2881
GTEST_DISALLOW_ASSIGN_(EachMatcherImpl)
EachMatcherImpl(InnerMatcher inner_matcher)
Definition gmock-matchers.h:2877
Definition gmock-matchers.h:2919
EachMatcher(M m)
Definition gmock-matchers.h:2921
GTEST_DISALLOW_ASSIGN_(EachMatcher)
const M inner_matcher_
Definition gmock-matchers.h:2929
Definition gmock-matchers.h:1664
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1669
const Matcher< T > matcher2_
Definition gmock-matchers.h:1717
GTEST_DISALLOW_ASSIGN_(EitherOfMatcherImpl)
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1677
const Matcher< T > matcher1_
Definition gmock-matchers.h:1716
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition gmock-matchers.h:1685
EitherOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition gmock-matchers.h:1666
typename AnyOfResult1< M1 >::type matcher1_
Definition gmock-matchers.h:1748
typename AnyOfResult1< M2 >::type matcher2_
Definition gmock-matchers.h:1749
EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition gmock-matchers.h:1735
GTEST_DISALLOW_ASSIGN_(EitherOfMatcher)
Definition gmock-matchers.h:3525
ElementsAreArrayMatcher(Iter first, Iter last)
Definition gmock-matchers.h:3528
GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher)
const ::std::vector< T > matchers_
Definition gmock-matchers.h:3537
Definition gmock-matchers.h:3108
View::type StlContainer
Definition gmock-matchers.h:3112
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition gmock-matchers.h:3161
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:3126
internal::StlContainerView< RawContainer > View
Definition gmock-matchers.h:3111
size_t count() const
Definition gmock-matchers.h:3246
static Message Elements(size_t count)
Definition gmock-matchers.h:3242
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer
StlContainer::value_type Element
Definition gmock-matchers.h:3114
GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl)
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:3145
ElementsAreMatcherImpl(InputIter first, InputIter last)
Definition gmock-matchers.h:3119
View::const_reference StlContainerReference
Definition gmock-matchers.h:3113
::std::vector< Matcher< const Element & > > matchers_
Definition gmock-matchers.h:3248
const MatcherTuple matchers_
Definition gmock-matchers.h:3496
ElementsAreMatcher(const MatcherTuple &args)
Definition gmock-matchers.h:3479
GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher)
Definition gmock-matchers.h:1281
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition gmock-matchers.h:1300
EndsWithMatcher(const StringType &suffix)
Definition gmock-matchers.h:1283
const StringType suffix_
Definition gmock-matchers.h:1318
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition gmock-matchers.h:1291
GTEST_DISALLOW_ASSIGN_(EndsWithMatcher)
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1307
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1312
Definition gmock-matchers.h:1414
static const char * Desc()
Definition gmock-matchers.h:1416
Definition gmock-matchers.h:927
static const char * NegatedDesc()
Definition gmock-matchers.h:932
EqMatcher(const Rhs &rhs)
Definition gmock-matchers.h:929
static const char * Desc()
Definition gmock-matchers.h:931
Definition gmock-matchers.h:2181
const Matcher< const FieldType & > matcher_
Definition gmock-matchers.h:2228
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
Definition gmock-matchers.h:2209
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2192
GTEST_DISALLOW_ASSIGN_(FieldMatcher)
const FieldType Class::* field_
Definition gmock-matchers.h:2227
bool MatchAndExplainImpl(true_type, const Class *p, MatchResultListener *listener) const
Definition gmock-matchers.h:2215
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition gmock-matchers.h:2198
FieldMatcher(FieldType Class::*field, const Matcher< const FieldType & > &matcher)
Definition gmock-matchers.h:2183
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2187
Definition gmock-matchers.h:1914
GTEST_DISALLOW_ASSIGN_(Impl)
Impl(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
Definition gmock-matchers.h:1916
bool HasMaxAbsError() const
Definition gmock-matchers.h:1998
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1977
virtual bool MatchAndExplain(T value, MatchResultListener *listener) const
Definition gmock-matchers.h:1921
const bool nan_eq_nan_
Definition gmock-matchers.h:2003
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1956
const FloatType expected_
Definition gmock-matchers.h:2002
const FloatType max_abs_error_
Definition gmock-matchers.h:2005
Definition gmock-matchers.h:1888
const FloatType expected_
Definition gmock-matchers.h:2032
const FloatType max_abs_error_
Definition gmock-matchers.h:2035
FloatingEqMatcher(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
Definition gmock-matchers.h:1903
const bool nan_eq_nan_
Definition gmock-matchers.h:2033
FloatingEqMatcher(FloatType expected, bool nan_eq_nan)
Definition gmock-matchers.h:1896
GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher)
Definition gtest-internal.h:262
bool is_nan() const
Definition gtest-internal.h:346
Definition gmock-matchers.h:1434
static const char * Desc()
Definition gmock-matchers.h:1436
Definition gmock-matchers.h:967
static const char * Desc()
Definition gmock-matchers.h:971
static const char * NegatedDesc()
Definition gmock-matchers.h:972
GeMatcher(const Rhs &rhs)
Definition gmock-matchers.h:969
Definition gmock-matchers.h:1426
static const char * Desc()
Definition gmock-matchers.h:1428
Definition gmock-matchers.h:951
static const char * Desc()
Definition gmock-matchers.h:955
static const char * NegatedDesc()
Definition gmock-matchers.h:956
GtMatcher(const Rhs &rhs)
Definition gmock-matchers.h:953
Definition gmock-matchers.h:1187
GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher)
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition gmock-matchers.h:1207
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1214
HasSubstrMatcher(const StringType &substring)
Definition gmock-matchers.h:1189
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition gmock-matchers.h:1198
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1219
const StringType substring_
Definition gmock-matchers.h:1225
Definition gtest-internal.h:855
static const bool value
Definition gtest-internal.h:891
Definition gmock-matchers.h:977
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:989
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:990
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition gmock-matchers.h:980
Definition gmock-matchers.h:2939
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2970
const Matcher< const KeyType & > inner_matcher_
Definition gmock-matchers.h:2976
KeyMatcherImpl(InnerMatcher inner_matcher)
Definition gmock-matchers.h:2945
RawPairType::first_type KeyType
Definition gmock-matchers.h:2942
GTEST_DISALLOW_ASSIGN_(KeyMatcherImpl)
virtual bool MatchAndExplain(PairType key_value, MatchResultListener *listener) const
Definition gmock-matchers.h:2951
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2964
Definition gmock-matchers.h:2983
KeyMatcher(M m)
Definition gmock-matchers.h:2985
const M matcher_for_key_
Definition gmock-matchers.h:2993
GTEST_DISALLOW_ASSIGN_(KeyMatcher)
Definition gmock-matchers.h:1430
static const char * Desc()
Definition gmock-matchers.h:1432
Definition gmock-matchers.h:959
static const char * Desc()
Definition gmock-matchers.h:963
static const char * NegatedDesc()
Definition gmock-matchers.h:964
LeMatcher(const Rhs &rhs)
Definition gmock-matchers.h:961
Definition gmock-matchers.h:1422
static const char * Desc()
Definition gmock-matchers.h:1424
Definition gmock-matchers.h:943
static const char * Desc()
Definition gmock-matchers.h:947
static const char * NegatedDesc()
Definition gmock-matchers.h:948
LtMatcher(const Rhs &rhs)
Definition gmock-matchers.h:945
Definition gmock-matchers.h:3257
size_t LhsSize() const
Definition gmock-matchers.h:3265
bool HasEdge(size_t ilhs, size_t irhs) const
Definition gmock-matchers.h:3267
size_t num_elements_
Definition gmock-matchers.h:3288
size_t SpaceIndex(size_t ilhs, size_t irhs) const
Definition gmock-matchers.h:3284
size_t num_matchers_
Definition gmock-matchers.h:3289
void SetEdge(size_t ilhs, size_t irhs, bool b)
Definition gmock-matchers.h:3270
::std::vector< char > matched_
Definition gmock-matchers.h:3294
MatchMatrix(size_t num_elements, size_t num_matchers)
Definition gmock-matchers.h:3259
size_t RhsSize() const
Definition gmock-matchers.h:3266
Definition gmock-matchers.h:1796
GTEST_DISALLOW_ASSIGN_(MatcherAsPredicate)
M matcher_
Definition gmock-matchers.h:1826
MatcherAsPredicate(M matcher)
Definition gmock-matchers.h:1798
bool operator()(const T &x) const
Definition gmock-matchers.h:1807
Definition gmock-matchers.h:252
bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition gmock-matchers.h:256
bool Matches(T x) const
Definition gmock-matchers.h:261
virtual ~MatcherBase()
Definition gmock-matchers.h:294
MatcherBase()
Definition gmock-matchers.h:288
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:267
::testing::internal::linked_ptr< const MatcherInterface< T > > impl_
Definition gmock-matchers.h:308
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:270
void ExplainMatchResultTo(T x, ::std::ostream *os) const
Definition gmock-matchers.h:275
const MatcherDescriberInterface * GetDescriber() const
Definition gmock-matchers.h:283
MatcherBase(const MatcherInterface< T > *impl)
Definition gmock-matchers.h:291
static Matcher< T > Cast(const Matcher< T > &matcher)
Definition gmock-matchers.h:600
Definition gmock-matchers.h:570
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:584
GTEST_DISALLOW_ASSIGN_(Impl)
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:580
const Matcher< U > source_matcher_
Definition gmock-matchers.h:589
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition gmock-matchers.h:576
Impl(const Matcher< U > &source_matcher)
Definition gmock-matchers.h:572
static Matcher< T > Cast(const Matcher< U > &source_matcher)
Definition gmock-matchers.h:565
Definition gmock-matchers.h:515
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
Definition gmock-matchers.h:517
static Matcher< T > CastImpl(const M &polymorphic_matcher_or_value, BooleanConstant< true >)
Definition gmock-matchers.h:545
static Matcher< T > CastImpl(const M &value, BooleanConstant< false >)
Definition gmock-matchers.h:538
Definition gmock-matchers.h:1326
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition gmock-matchers.h:1337
GTEST_DISALLOW_ASSIGN_(MatchesRegexMatcher)
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition gmock-matchers.h:1346
const internal::linked_ptr< const RE > regex_
Definition gmock-matchers.h:1366
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1359
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1353
const bool full_match_
Definition gmock-matchers.h:1367
MatchesRegexMatcher(const RE *regex, bool full_match)
Definition gmock-matchers.h:1328
Definition gmock-matchers.h:1418
static const char * Desc()
Definition gmock-matchers.h:1420
Definition gmock-matchers.h:935
static const char * NegatedDesc()
Definition gmock-matchers.h:940
NeMatcher(const Rhs &rhs)
Definition gmock-matchers.h:937
static const char * Desc()
Definition gmock-matchers.h:939
Definition gmock-matchers.h:1444
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1453
const Matcher< T > matcher_
Definition gmock-matchers.h:1462
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1457
GTEST_DISALLOW_ASSIGN_(NotMatcherImpl)
NotMatcherImpl(const Matcher< T > &matcher)
Definition gmock-matchers.h:1446
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition gmock-matchers.h:1449
Definition gmock-matchers.h:1470
NotMatcher(InnerMatcher matcher)
Definition gmock-matchers.h:1472
InnerMatcher matcher_
Definition gmock-matchers.h:1482
GTEST_DISALLOW_ASSIGN_(NotMatcher)
Definition gmock-matchers.h:997
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1010
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition gmock-matchers.h:1000
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1009
Definition gmock-matchers.h:1398
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1405
virtual bool MatchAndExplain(Tuple args, MatchResultListener *) const
Definition gmock-matchers.h:1400
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1408
Definition gmock-matchers.h:1381
::std::ostream & GetDesc(::std::ostream &os)
Definition gmock-matchers.h:1393
Definition gmock-matchers.h:3001
virtual bool MatchAndExplain(PairType a_pair, MatchResultListener *listener) const
Definition gmock-matchers.h:3033
const Matcher< const SecondType & > second_matcher_
Definition gmock-matchers.h:3080
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:3024
GTEST_DISALLOW_ASSIGN_(PairMatcherImpl)
const Matcher< const FirstType & > first_matcher_
Definition gmock-matchers.h:3079
RawPairType::first_type FirstType
Definition gmock-matchers.h:3004
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:3016
RawPairType::second_type SecondType
Definition gmock-matchers.h:3005
PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition gmock-matchers.h:3008
void ExplainSuccess(const internal::string &first_explanation, const internal::string &second_explanation, MatchResultListener *listener) const
Definition gmock-matchers.h:3061
Definition gmock-matchers.h:3087
const SecondMatcher second_matcher_
Definition gmock-matchers.h:3101
PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition gmock-matchers.h:3089
GTEST_DISALLOW_ASSIGN_(PairMatcher)
const FirstMatcher first_matcher_
Definition gmock-matchers.h:3100
Definition gmock-matchers.h:2063
virtual bool MatchAndExplain(Pointer pointer, MatchResultListener *listener) const
Definition gmock-matchers.h:2081
Impl(const InnerMatcher &matcher)
Definition gmock-matchers.h:2068
GTEST_DISALLOW_ASSIGN_(Impl)
const Matcher< const Pointee & > matcher_
Definition gmock-matchers.h:2091
PointeeOf< GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(Pointer))>::type Pointee
Definition gmock-matchers.h:2066
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2076
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2071
Definition gmock-matchers.h:2043
GTEST_DISALLOW_ASSIGN_(PointeeMatcher)
const InnerMatcher matcher_
Definition gmock-matchers.h:2096
PointeeMatcher(const InnerMatcher &matcher)
Definition gmock-matchers.h:2045
Definition gmock-matchers.h:2715
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2733
LhsView::type LhsStlContainer
Definition gmock-matchers.h:2719
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2740
virtual bool MatchAndExplain(LhsContainer lhs, MatchResultListener *listener) const
Definition gmock-matchers.h:2749
LhsStlContainer::value_type LhsValue
Definition gmock-matchers.h:2721
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
Definition gmock-matchers.h:2718
const RhsStlContainer rhs_
Definition gmock-matchers.h:2786
LhsView::const_reference LhsStlContainerReference
Definition gmock-matchers.h:2720
Impl(const TupleMatcher &tuple_matcher, const RhsStlContainer &rhs)
Definition gmock-matchers.h:2728
::testing::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
Definition gmock-matchers.h:2726
const Matcher< InnerMatcherArg > mono_tuple_matcher_
Definition gmock-matchers.h:2785
GTEST_DISALLOW_ASSIGN_(Impl)
Definition gmock-matchers.h:2693
GTEST_DISALLOW_ASSIGN_(PointwiseMatcher)
internal::StlContainerView< RhsContainer > RhsView
Definition gmock-matchers.h:2695
const TupleMatcher tuple_matcher_
Definition gmock-matchers.h:2792
const RhsStlContainer rhs_
Definition gmock-matchers.h:2793
RhsStlContainer::value_type RhsValue
Definition gmock-matchers.h:2697
PointwiseMatcher(const TupleMatcher &tuple_matcher, const RhsContainer &rhs)
Definition gmock-matchers.h:2701
RhsView::type RhsStlContainer
Definition gmock-matchers.h:2696
Definition gmock-matchers.h:2236
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2248
GTEST_DISALLOW_ASSIGN_(PropertyMatcher)
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2253
PropertyType(Class::* property_)() const
Definition gmock-matchers.h:2298
bool MatchAndExplainImpl(true_type, const Class *p, MatchResultListener *listener) const
Definition gmock-matchers.h:2286
PropertyMatcher(PropertyType(Class::*property)() const, const Matcher< RefToConstProperty > &matcher)
Definition gmock-matchers.h:2244
typedef GTEST_REFERENCE_TO_CONST_(PropertyType) RefToConstProperty
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
Definition gmock-matchers.h:2270
const Matcher< RefToConstProperty > matcher_
Definition gmock-matchers.h:2299
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition gmock-matchers.h:2259
View::const_reference StlContainerReference
Definition gmock-matchers.h:2805
StlContainer::value_type Element
Definition gmock-matchers.h:2806
View::type StlContainer
Definition gmock-matchers.h:2804
StlContainerView< RawContainer > View
Definition gmock-matchers.h:2803
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer
bool MatchAndExplainImpl(bool all_elements_should_match, Container container, MatchResultListener *listener) const
Definition gmock-matchers.h:2816
GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl)
QuantifierMatcherImpl(InnerMatcher inner_matcher)
Definition gmock-matchers.h:2809
const Matcher< const Element & > inner_matcher_
Definition gmock-matchers.h:2837
Definition gtest-port.h:1156
static bool PartialMatch(const ::std::string &str, const RE &re)
Definition gtest-port.h:1187
static bool FullMatch(const ::std::string &str, const RE &re)
Definition gtest-port.h:1184
Definition gmock-matchers.h:1056
virtual bool MatchAndExplain(Super &x, MatchResultListener *listener) const
Definition gmock-matchers.h:1062
const Super & object_
Definition gmock-matchers.h:1079
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1068
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1073
Impl(Super &x)
Definition gmock-matchers.h:1058
GTEST_DISALLOW_ASSIGN_(Impl)
T & object_
Definition gmock-matchers.h:1084
RefMatcher(T &x)
Definition gmock-matchers.h:1042
GTEST_DISALLOW_ASSIGN_(RefMatcher)
Definition gmock-matchers.h:1029
Definition gmock-matchers.h:2355
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2365
const Matcher< ResultType > matcher_
Definition gmock-matchers.h:2386
CallableStorageType callable_
Definition gmock-matchers.h:2385
virtual bool MatchAndExplain(T obj, MatchResultListener *listener) const
Definition gmock-matchers.h:2370
GTEST_DISALLOW_ASSIGN_(Impl)
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2360
Impl(CallableStorageType callable, const Matcher< ResultType > &matcher)
Definition gmock-matchers.h:2357
Definition gmock-matchers.h:2337
const CallableStorageType callable_
Definition gmock-matchers.h:2391
CallableTraits< Callable >::StorageType CallableStorageType
Definition gmock-matchers.h:2352
ResultOfMatcher(Callable callable, const Matcher< ResultType > &matcher)
Definition gmock-matchers.h:2341
CallableTraits< Callable >::ResultType ResultType
Definition gmock-matchers.h:2339
GTEST_DISALLOW_ASSIGN_(ResultOfMatcher)
const Matcher< ResultType > matcher_
Definition gmock-matchers.h:2392
Definition gmock-matchers.h:2411
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2423
GTEST_DISALLOW_ASSIGN_(Impl)
const Matcher< SizeType > size_matcher_
Definition gmock-matchers.h:2440
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition gmock-matchers.h:2428
ContainerView::type::size_type SizeType
Definition gmock-matchers.h:2415
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2419
Impl(const SizeMatcher &size_matcher)
Definition gmock-matchers.h:2416
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
Definition gmock-matchers.h:2414
Definition gmock-matchers.h:2399
GTEST_DISALLOW_ASSIGN_(SizeIsMatcher)
const SizeMatcher size_matcher_
Definition gmock-matchers.h:2445
SizeIsMatcher(const SizeMatcher &size_matcher)
Definition gmock-matchers.h:2401
Definition gmock-matchers.h:1234
GTEST_DISALLOW_ASSIGN_(StartsWithMatcher)
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition gmock-matchers.h:1254
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition gmock-matchers.h:1245
const StringType prefix_
Definition gmock-matchers.h:1272
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1266
StartsWithMatcher(const StringType &prefix)
Definition gmock-matchers.h:1236
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1261
Definition gmock-internal-utils.h:406
Container type
Definition gmock-internal-utils.h:408
static const_reference ConstReference(const GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer) &container)
Definition gmock-internal-utils.h:411
const type & const_reference
Definition gmock-internal-utils.h:409
Definition gmock-matchers.h:1126
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1158
StrEqualityMatcher(const StringType &str, bool expect_eq, bool case_sensitive)
Definition gmock-matchers.h:1128
GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher)
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition gmock-matchers.h:1138
const bool expect_eq_
Definition gmock-matchers.h:1177
void DescribeToHelper(bool expect_eq, ::std::ostream *os) const
Definition gmock-matchers.h:1167
const bool case_sensitive_
Definition gmock-matchers.h:1178
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition gmock-matchers.h:1150
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1162
const StringType string_
Definition gmock-matchers.h:1176
Definition gmock-matchers.h:239
StreamMatchResultListener(::std::ostream *os)
Definition gmock-matchers.h:241
GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener)
static bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
Definition gtest.cc:1905
static bool CaseInsensitiveWideCStringEquals(const wchar_t *lhs, const wchar_t *rhs)
Definition gtest.cc:1925
Definition gtest-port_test.cc:202
Definition gmock-matchers.h:1757
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:1783
Predicate predicate_
Definition gmock-matchers.h:1788
TrulyMatcher(Predicate pred)
Definition gmock-matchers.h:1759
GTEST_DISALLOW_ASSIGN_(TrulyMatcher)
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:1779
bool MatchAndExplain(T &x, MatchResultListener *) const
Definition gmock-matchers.h:1766
static bool Matches(const MatcherTuple &, const ValueTuple &)
Definition gmock-matchers.h:779
static void ExplainMatchFailuresTo(const MatcherTuple &, const ValueTuple &, ::std::ostream *)
Definition gmock-matchers.h:785
Definition gmock-matchers.h:726
static void ExplainMatchFailuresTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition gmock-matchers.h:743
static bool Matches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition gmock-matchers.h:732
static void Print(const T &value, ::std::ostream *os)
Definition gtest-printers.h:698
Definition gmock-matchers.h:3502
UnorderedElementsAreArrayMatcher()
Definition gmock-matchers.h:3504
UnorderedElementsAreArrayMatcher(Iter first, Iter last)
Definition gmock-matchers.h:3507
::std::vector< T > matchers_
Definition gmock-matchers.h:3518
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreArrayMatcher)
Definition gmock-matchers.h:3311
void DescribeToImpl(::std::ostream *os) const
Definition gmock-matchers.cc:395
bool VerifyAllElementsAndMatchersAreMatched(const ::std::vector< string > &element_printouts, const MatchMatrix &matrix, MatchResultListener *listener) const
Definition gmock-matchers.cc:444
::std::vector< const MatcherDescriberInterface * > MatcherDescriberVec
Definition gmock-matchers.h:3316
void DescribeNegationToImpl(::std::ostream *os) const
Definition gmock-matchers.cc:416
static Message Elements(size_t n)
Definition gmock-matchers.h:3333
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImplBase)
MatcherDescriberVec & matcher_describers()
Definition gmock-matchers.h:3329
MatcherDescriberVec matcher_describers_
Definition gmock-matchers.h:3338
Definition gmock-matchers.h:3347
UnorderedElementsAreMatcherImpl(InputIter first, InputIter last)
Definition gmock-matchers.h:3359
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImpl)
MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last, ::std::vector< string > *element_printouts, MatchResultListener *listener) const
Definition gmock-matchers.h:3409
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:3367
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition gmock-matchers.h:3376
StlContainer::const_iterator StlContainerConstIterator
Definition gmock-matchers.h:3353
View::type StlContainer
Definition gmock-matchers.h:3351
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer
MatcherVec matchers_
Definition gmock-matchers.h:3434
View::const_reference StlContainerReference
Definition gmock-matchers.h:3352
StlContainer::value_type Element
Definition gmock-matchers.h:3354
internal::StlContainerView< RawContainer > View
Definition gmock-matchers.h:3350
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:3372
::std::vector< Matcher< const Element & > > MatcherVec
Definition gmock-matchers.h:3406
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcher)
const MatcherTuple matchers_
Definition gmock-matchers.h:3471
UnorderedElementsAreMatcher(const MatcherTuple &args)
Definition gmock-matchers.h:3453
void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2118
const Matcher< To > matcher_
Definition gmock-matchers.h:2124
GTEST_DISALLOW_ASSIGN_(WhenDynamicCastToMatcherBase)
static string GetToName()
Definition gmock-matchers.h:2126
void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2113
WhenDynamicCastToMatcherBase(const Matcher< To > &matcher)
Definition gmock-matchers.h:2110
static void GetCastTypeDescription(::std::ostream *os)
Definition gmock-matchers.h:2135
bool MatchAndExplain(From &from, MatchResultListener *listener) const
Definition gmock-matchers.h:2167
WhenDynamicCastToMatcher(const Matcher< To & > &matcher)
Definition gmock-matchers.h:2163
Definition gmock-matchers.h:2145
bool MatchAndExplain(From from, MatchResultListener *listener) const
Definition gmock-matchers.h:2151
WhenDynamicCastToMatcher(const Matcher< To > &matcher)
Definition gmock-matchers.h:2147
Definition gmock-matchers.h:2625
virtual void DescribeNegationTo(::std::ostream *os) const
Definition gmock-matchers.h:2644
LhsView::type LhsStlContainer
Definition gmock-matchers.h:2629
RemoveConstFromKey< typenameLhsStlContainer::value_type >::type LhsValue
Definition gmock-matchers.h:2634
virtual void DescribeTo(::std::ostream *os) const
Definition gmock-matchers.h:2639
const Matcher< const ::std::vector< LhsValue > & > matcher_
Definition gmock-matchers.h:2676
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
Definition gmock-matchers.h:2628
Impl(const Comparator &comparator, const ContainerMatcher &matcher)
Definition gmock-matchers.h:2636
const Comparator comparator_
Definition gmock-matchers.h:2675
virtual bool MatchAndExplain(LhsContainer lhs, MatchResultListener *listener) const
Definition gmock-matchers.h:2649
LhsView::const_reference LhsStlContainerReference
Definition gmock-matchers.h:2630
GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl)
Definition gmock-matchers.h:2613
GTEST_DISALLOW_ASSIGN_(WhenSortedByMatcher)
WhenSortedByMatcher(const Comparator &comparator, const ContainerMatcher &matcher)
Definition gmock-matchers.h:2615
const ContainerMatcher matcher_
Definition gmock-matchers.h:2683
const Comparator comparator_
Definition gmock-matchers.h:2682
Definition gtest-linked_ptr.h:146
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Definition document.h:2116
GenericPointer< Value, CrtAllocator > Pointer
Definition fwd.h:128
#define GTEST_REMOVE_CONST_(T)
Definition gtest-internal.h:819
#define GTEST_REMOVE_REFERENCE_(T)
Definition gtest-internal.h:788
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
Definition gtest-internal.h:823
#define GTEST_REFERENCE_TO_CONST_(T)
Definition gtest-internal.h:848
#define GTEST_LOG_(severity)
Definition gtest-port.h:1271
#define GTEST_API_
Definition gtest-port.h:934
#define GTEST_CHECK_(condition)
Definition gtest-port.h:1295
#define GTEST_DISALLOW_ASSIGN_(type)
Definition gtest-port.h:869
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition gtest-port.h:1032
#define GMOCK_KIND_OF_(type)
Definition gmock-internal-utils.h:168
void get(std::istream &input, bool &res)
Definition io.h:61
#define const
Definition ipfrdr.c:80
Definition document.h:406
void Abort()
Definition gtest-port.h:2410
Definition gmock-actions.h:64
::std::vector< ElementMatcherPair > ElementMatcherPairs
Definition gmock-matchers.h:3298
bool_constant< true > true_type
Definition gtest-port.h:2210
OutIter TransformTupleValues(Func f, const Tuple &t, OutIter out)
Definition gmock-matchers.h:853
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
Definition gmock-matchers.h:701
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition gmock-matchers.h:796
::std::pair< size_t, size_t > ElementMatcherPair
Definition gmock-matchers.h:3297
bool IsReadableTypeName(const string &type_name)
Definition gmock-matchers.h:688
void UniversalPrint(const T &value, ::std::ostream *os)
Definition gtest-printers.h:852
bool CaseInsensitiveStringEquals(const StringType &s1, const StringType &s2)
Definition gmock-matchers.h:1102
BoundSecondMatcher< Tuple2Matcher, Second > MatcherBindSecond(const Tuple2Matcher &tm, const Second &second)
Definition gmock-matchers.h:3612
GTEST_API_ string FormatMatcherDescription(bool negation, const char *matcher_name, const Strings ¶m_values)
Definition gmock-matchers.cc:127
std::string GetTypeName()
Definition gtest-type-util.h:64
PredicateFormatterFromMatcher< M > MakePredicateFormatterFromMatcher(M matcher)
Definition gmock-matchers.h:1879
::std::string string
Definition gtest-port.h:1097
bool_constant< false > false_type
Definition gtest-port.h:2209
Iter ArrayAwareFind(Iter begin, Iter end, const Element &elem)
Definition gtest-internal.h:983
To ImplicitCast_(To x)
Definition gtest-port.h:1343
const T & move(const T &t)
Definition gtest-port.h:1317
const bool ImplicitlyConvertible< From, To >::value
Definition gtest-internal.h:897
@ kOther
Definition gmock-internal-utils.h:127
::std::vector< string > Strings
Definition gtest-printers.h:859
const Pointer::element_type * GetRawPointer(const Pointer &p)
Definition gmock-internal-utils.h:76
GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching(const MatchMatrix &g)
Definition gmock-matchers.cc:308
bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
Definition gmock-matchers.h:1090
GTEST_API_ bool FindPairing(const MatchMatrix &matrix, MatchResultListener *listener)
Definition gmock-matchers.cc:328
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
Definition gmock-matchers.h:678
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition gmock-matchers.h:810
Definition gmock-actions.h:53
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith(const internal::string &prefix)
Definition gmock-matchers.h:3991
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)
Definition gmock-matchers.h:4107
internal::Le2Matcher Le()
Definition gmock-matchers.h:4094
internal::PointwiseMatcher< TupleMatcher, GTEST_REMOVE_CONST_(Container)> Pointwise(const TupleMatcher &tuple_matcher, const Container &rhs)
Definition gmock-matchers.h:4187
Matcher< Lhs > TypedEq(const Rhs &rhs)
Definition gmock-matchers.h:3762
Matcher< T > An()
Definition gmock-matchers.h:3736
internal::Ne2Matcher Ne()
Definition gmock-matchers.h:4102
internal::FloatingEqMatcher< float > FloatEq(float rhs)
Definition gmock-matchers.h:3843
PolymorphicMatcher< internal::NotNullMatcher > NotNull()
Definition gmock-matchers.h:3802
internal::WhenSortedByMatcher< Comparator, ContainerMatcher > WhenSortedBy(const Comparator &comparator, const ContainerMatcher &container_matcher)
Definition gmock-matchers.h:4162
InnerMatcher AllArgs(const InnerMatcher &matcher)
Definition gmock-matchers.h:4382
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
Definition gmock-matchers.h:3984
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
Definition gmock-matchers.h:3795
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe(const internal::string &str)
Definition gmock-matchers.h:3976
internal::WhenSortedByMatcher< internal::LessComparator, ContainerMatcher > WhenSorted(const ContainerMatcher &container_matcher)
Definition gmock-matchers.h:4172
internal::FloatingEqMatcher< float > NanSensitiveFloatEq(float rhs)
Definition gmock-matchers.h:3849
internal::FloatingEqMatcher< float > NanSensitiveFloatNear(float rhs, float max_abs_error)
Definition gmock-matchers.h:3864
internal::EachMatcher< M > Each(M matcher)
Definition gmock-matchers.h:4314
internal::Lt2Matcher Lt()
Definition gmock-matchers.h:4098
internal::Gt2Matcher Gt()
Definition gmock-matchers.h:4090
internal::FloatingEqMatcher< double > DoubleNear(double rhs, double max_abs_error)
Definition gmock-matchers.h:3828
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
Definition gmock-matchers.h:4005
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly(Predicate pred)
Definition gmock-matchers.h:4116
const internal::AnythingMatcher _
Definition gmock-matchers.h:3729
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
Definition gmock-matchers.h:4150
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
Definition gmock-matchers.h:3815
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
Definition gmock-generated-matchers.h:1002
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
Definition gmock-generated-matchers.h:481
Matcher< T > A()
Definition gmock-matchers.h:3732
internal::ResultOfMatcher< Callable > ResultOf(Callable callable, const ResultOfMatcher &matcher)
Definition gmock-matchers.h:3939
bool StaticAssertTypeEq()
Definition gtest.h:2150
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe(const internal::string &str)
Definition gmock-matchers.h:3962
bool ExplainMatchResult(M matcher, const T &value, MatchResultListener *listener)
Definition gmock-matchers.h:4354
internal::ElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > ElementsAreArray(Iter first, Iter last)
Definition gmock-matchers.h:3646
GTEST_API_ AssertionResult AssertionFailure()
Definition gtest.cc:1015
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq(double rhs)
Definition gmock-matchers.h:3821
internal::FloatingEqMatcher< float > FloatNear(float rhs, float max_abs_error)
Definition gmock-matchers.h:3856
internal::Ge2Matcher Ge()
Definition gmock-matchers.h:4086
PolymorphicMatcher< internal::WhenDynamicCastToMatcher< To > > WhenDynamicCastTo(const Matcher< To > &inner_matcher)
Definition gmock-matchers.h:3885
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex(const internal::RE *regex)
Definition gmock-matchers.h:4016
internal::KeyMatcher< M > Key(M inner_matcher)
Definition gmock-matchers.h:4322
internal::SizeIsMatcher< SizeMatcher > SizeIs(const SizeMatcher &size_matcher)
Definition gmock-matchers.h:4128
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq(const internal::string &str)
Definition gmock-matchers.h:3969
::std::string PrintToString(const T &value)
Definition gtest-printers.h:980
internal::ContainsMatcher< M > Contains(M matcher)
Definition gmock-matchers.h:4282
internal::Eq2Matcher Eq()
Definition gmock-matchers.h:4082
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
Definition gmock-matchers.h:3913
internal::PairMatcher< FirstMatcher, SecondMatcher > Pair(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition gmock-matchers.h:4333
PolymorphicMatcher< Impl > MakePolymorphicMatcher(const Impl &impl)
Definition gmock-matchers.h:496
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith(const internal::string &suffix)
Definition gmock-matchers.h:3998
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field(FieldType Class::*field, const FieldMatcher &matcher)
Definition gmock-matchers.h:3896
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
Definition gmock-more-actions.h:114
GTEST_API_ AssertionResult AssertionSuccess()
Definition gtest.cc:1010
internal::FloatingEqMatcher< double > NanSensitiveDoubleNear(double rhs, double max_abs_error)
Definition gmock-matchers.h:3836
internal::BeginEndDistanceIsMatcher< DistanceMatcher > BeginEndDistanceIs(const DistanceMatcher &distance_matcher)
Definition gmock-matchers.h:4139
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
Definition gmock-matchers.h:484
internal::UnorderedElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > UnorderedElementsAreArray(Iter first, Iter last)
Definition gmock-matchers.h:3688
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
Definition gmock-generated-matchers.h:1085
Matcher< T > MatcherCast(const M &matcher)
Definition gmock-matchers.h:610
Matcher< T > SafeMatcherCast(const M &polymorphic_matcher)
Definition gmock-matchers.h:665
bool Value(const T &value, M matcher)
Definition gmock-matchers.h:4347
internal::RefMatcher< T & > Ref(T &x)
Definition gmock-matchers.h:3809
internal::UnorderedElementsAreArrayMatcher< typename internal::BoundSecondMatcher< Tuple2Matcher, typename internal::StlContainerView< GTEST_REMOVE_CONST_(RhsContainer)>::type::value_type > > UnorderedPointwise(const Tuple2Matcher &tuple2_matcher, const RhsContainer &rhs_container)
Definition gmock-matchers.h:4223
internal::MatcherAsPredicate< M > Matches(M matcher)
Definition gmock-matchers.h:4341
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
Definition gmock-matchers.h:3872
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
Definition gmock-matchers.h:3955
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1225
const GenericPointer< typename T::ValueType > & pointer
Definition pointer.h:1124
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1124
const char *const str
Definition portlistingparse.c:23
#define M(w0, w14, w9, w1)
Definition sha512-blocks.c:41
tools::wallet2::message_signature_result_t result
Definition signature.cpp:62
Definition gmock-matchers.h:202
bool operator()(const A &a, const B &b) const
Definition gmock-matchers.h:204
Definition gmock-matchers.h:222
bool operator()(const A &a, const B &b) const
Definition gmock-matchers.h:224
Definition gmock-matchers.h:214
bool operator()(const A &a, const B &b) const
Definition gmock-matchers.h:216
Definition gmock-matchers.h:218
bool operator()(const A &a, const B &b) const
Definition gmock-matchers.h:220
Definition gmock-matchers.h:210
bool operator()(const A &a, const B &b) const
Definition gmock-matchers.h:212
Definition gmock-matchers.h:206
bool operator()(const A &a, const B &b) const
Definition gmock-matchers.h:208
Definition gmock-internal-utils.h:505
ResType(* StorageType)(ArgType)
Definition gmock-matchers.h:2322
static void CheckIsValid(ResType(*f)(ArgType))
Definition gmock-matchers.h:2324
ResType ResultType
Definition gmock-matchers.h:2321
static ResType Invoke(ResType(*f)(ArgType), T arg)
Definition gmock-matchers.h:2329
Definition gmock-matchers.h:2309
Functor StorageType
Definition gmock-matchers.h:2311
Functor::result_type ResultType
Definition gmock-matchers.h:2310
static void CheckIsValid(Functor)
Definition gmock-matchers.h:2313
static ResultType Invoke(Functor f, T arg)
Definition gmock-matchers.h:2315
Definition gmock-matchers.h:2606
bool operator()(const T &lhs, const U &rhs) const
Definition gmock-matchers.h:2608
Definition gmock-generated-internal-utils.h:69
Definition gmock-internal-utils.h:63
Definition gmock-internal-utils.h:492
static const bool value
Definition gtest-port.h:2205
Definition gtest-port.h:2213