38 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ 39 #define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ 55 #if GTEST_HAS_STD_INITIALIZER_LIST_ 56 # include <initializer_list> 98 ::std::ostream*
stream() {
return stream_; }
107 ::std::ostream*
const stream_;
126 virtual void DescribeTo(::std::ostream* os)
const = 0;
142 template <
typename T>
195 ::std::stringstream ss_;
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>
251 template <
typename T>
257 return impl_->MatchAndExplain(x, listener);
263 return MatchAndExplain(x, &dummy);
267 void DescribeTo(::std::ostream* os)
const { impl_->DescribeTo(os); }
271 impl_->DescribeNegationTo(os);
277 MatchAndExplain(x, &listener);
318 template <
typename T>
328 : internal::MatcherBase<T>(impl) {}
345 : internal::MatcherBase<
const internal::
string&>(impl) {}
362 : internal::MatcherBase<internal::
string>(impl) {}
372 #if GTEST_HAS_STRING_PIECE_ 390 Matcher(
const char* s);
393 Matcher(StringPiece s);
410 Matcher(
const char* s);
413 Matcher(StringPiece s);
415 #endif // GTEST_HAS_STRING_PIECE_ 429 template <
class Impl>
440 const Impl&
impl()
const {
return impl_; }
442 template <
typename T>
444 return Matcher<T>(
new MonomorphicImpl<T>(impl_));
448 template <
typename T>
451 explicit MonomorphicImpl(
const Impl& impl) : impl_(impl) {}
453 virtual void DescribeTo(::std::ostream* os)
const {
454 impl_.DescribeTo(os);
457 virtual void DescribeNegationTo(::std::ostream* os)
const {
458 impl_.DescribeNegationTo(os);
462 return impl_.MatchAndExplain(x, listener);
483 template <
typename T>
495 template <
class Impl>
514 template <
typename T,
typename M>
532 polymorphic_matcher_or_value,
545 static Matcher<T> CastImpl(
const M& polymorphic_matcher_or_value,
555 return polymorphic_matcher_or_value;
562 template <
typename T,
typename U>
572 explicit Impl(
const Matcher<U>& source_matcher)
573 : source_matcher_(source_matcher) {}
577 return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
580 virtual void DescribeTo(::std::ostream* os)
const {
581 source_matcher_.DescribeTo(os);
584 virtual void DescribeNegationTo(::std::ostream* os)
const {
585 source_matcher_.DescribeNegationTo(os);
597 template <
typename T>
609 template <
typename T,
typename M>
621 template <
typename T>
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);
660 return MatcherCast<T>(matcher);
664 template <
typename T,
typename M>
670 template <
typename T>
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);
700 template <
typename Value,
typename T>
714 const string& type_name = GetTypeName<Value>();
716 *listener->
stream() <<
" (of type " << type_name <<
")";
731 template <
typename MatcherTuple,
typename ValueTuple>
733 const ValueTuple& value_tuple) {
735 &&
get<N - 1>(matcher_tuple).
Matches(get<N - 1>(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;
754 Value value =
get<N - 1>(values);
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>
795 template <
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);
809 template <
typename MatcherTuple,
typename ValueTuple>
811 const ValueTuple& values,
812 ::std::ostream* os) {
814 matchers, values, os);
821 template <
typename Tuple,
typename Func,
typename OutIter>
824 typedef ::testing::tuple_size<Tuple> TupleSize;
829 static OutIter
Run(Func f,
const Tuple& t, OutIter out) {
830 return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);
834 template <
typename Tup,
size_t kRemainingSize>
835 struct IterateOverTuple {
836 OutIter operator() (Func f,
const Tup& t, OutIter out)
const {
837 *out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t));
838 return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
841 template <
typename Tup>
842 struct IterateOverTuple<Tup, 0> {
843 OutIter operator() (Func ,
const Tup& , OutIter out)
const {
852 template <
typename Tuple,
typename Func,
typename OutIter>
858 template <
typename T>
863 virtual void DescribeTo(::std::ostream* os)
const { *os <<
"is anything"; }
868 *os <<
"never matches";
878 template <
typename T>
892 template <
typename D,
typename Rhs,
typename Op>
896 template <
typename Lhs>
902 template <
typename Lhs>
905 explicit Impl(
const Rhs& rhs) : rhs_(rhs) {}
906 virtual bool MatchAndExplain(
908 return Op()(lhs, rhs_);
910 virtual void DescribeTo(::std::ostream* os)
const {
911 *os << D::Desc() <<
" ";
914 virtual void DescribeNegationTo(::std::ostream* os)
const {
915 *os << D::NegatedDesc() <<
" ";
926 template <
typename Rhs>
931 static const char*
Desc() {
return "is equal to"; }
934 template <
typename Rhs>
939 static const char*
Desc() {
return "isn't equal to"; }
942 template <
typename Rhs>
947 static const char*
Desc() {
return "is <"; }
950 template <
typename Rhs>
955 static const char*
Desc() {
return "is >"; }
958 template <
typename Rhs>
963 static const char*
Desc() {
return "is <="; }
966 template <
typename Rhs>
971 static const char*
Desc() {
return "is >="; }
979 template <
typename Po
inter>
984 #else // GTEST_LANG_CXX11 986 #endif // GTEST_LANG_CXX11 989 void DescribeTo(::std::ostream* os)
const { *os <<
"is NULL"; }
999 template <
typename Po
inter>
1002 #if GTEST_LANG_CXX11 1003 return p !=
nullptr;
1004 #else // GTEST_LANG_CXX11 1006 #endif // GTEST_LANG_CXX11 1009 void DescribeTo(::std::ostream* os)
const { *os <<
"isn't NULL"; }
1028 template <
typename T>
1031 template <
typename T>
1044 template <
typename Super>
1055 template <
typename Super>
1058 explicit Impl(Super& x) : object_(x) {}
1062 virtual bool MatchAndExplain(
1064 *listener <<
"which is located @" <<
static_cast<const void*
>(&x);
1065 return &x == &object_;
1068 virtual void DescribeTo(::std::ostream* os)
const {
1069 *os <<
"references the variable ";
1073 virtual void DescribeNegationTo(::std::ostream* os)
const {
1074 *os <<
"does not reference the variable ";
1079 const Super& object_;
1095 const wchar_t* rhs) {
1096 return String::CaseInsensitiveWideCStringEquals(lhs, rhs);
1101 template <
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) {
1125 template <
typename StringType>
1129 bool case_sensitive)
1130 : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}
1137 template <
typename CharType>
1142 return MatchAndExplain(StringType(s), listener);
1149 template <
typename MatcheeStringType>
1152 const StringType& s2(s);
1153 const bool eq = case_sensitive_ ? s2 == string_ :
1155 return expect_eq_ == eq;
1159 DescribeToHelper(expect_eq_, os);
1163 DescribeToHelper(!expect_eq_, os);
1167 void DescribeToHelper(
bool expect_eq, ::std::ostream* os)
const {
1168 *os << (expect_eq ?
"is " :
"isn't ");
1170 if (!case_sensitive_) {
1171 *os <<
"(ignoring case) ";
1176 const StringType string_;
1177 const bool expect_eq_;
1178 const bool case_sensitive_;
1186 template <
typename StringType>
1190 : substring_(substring) {}
1197 template <
typename CharType>
1199 return s != NULL && MatchAndExplain(StringType(s), listener);
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 ";
1225 const StringType substring_;
1233 template <
typename StringType>
1244 template <
typename CharType>
1246 return s != NULL && MatchAndExplain(StringType(s), listener);
1253 template <
typename MatcheeStringType>
1256 const StringType& s2(s);
1257 return s2.length() >= prefix_.length() &&
1258 s2.substr(0, prefix_.length()) == prefix_;
1262 *os <<
"starts with ";
1267 *os <<
"doesn't start with ";
1272 const StringType prefix_;
1280 template <
typename StringType>
1290 template <
typename CharType>
1292 return s != NULL && MatchAndExplain(StringType(s), listener);
1299 template <
typename MatcheeStringType>
1302 const StringType& s2(s);
1303 return s2.length() >= suffix_.length() &&
1304 s2.substr(s2.length() - suffix_.length()) == suffix_;
1308 *os <<
"ends with ";
1313 *os <<
"doesn't end with ";
1318 const StringType suffix_;
1329 : regex_(regex), full_match_(full_match) {}
1336 template <
typename CharType>
1345 template <
class MatcheeStringType>
1349 return full_match_ ? RE::FullMatch(s2, *regex_) :
1350 RE::PartialMatch(s2, *regex_);
1354 *os << (full_match_ ?
"matches" :
"contains")
1355 <<
" regular expression ";
1360 *os <<
"doesn't " << (full_match_ ?
"match" :
"contain")
1361 <<
" regular expression ";
1367 const bool full_match_;
1380 template <
typename D,
typename Op>
1383 template <
typename T1,
typename T2>
1385 return MakeMatcher(
new Impl< ::testing::tuple<T1, T2> >);
1387 template <
typename T1,
typename T2>
1389 return MakeMatcher(
new Impl<const ::testing::tuple<T1, T2>&>);
1393 static ::std::ostream& GetDesc(::std::ostream& os) {
1394 return os << D::Desc();
1397 template <
typename Tuple>
1400 virtual bool MatchAndExplain(
1403 return Op()(::testing::get<0>(
args), ::testing::get<1>(args));
1405 virtual void DescribeTo(::std::ostream* os)
const {
1406 *os <<
"are " << GetDesc;
1408 virtual void DescribeNegationTo(::std::ostream* os)
const {
1409 *os <<
"aren't " << GetDesc;
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"; }
1443 template <
typename T>
1447 : matcher_(matcher) {}
1450 return !matcher_.MatchAndExplain(x, listener);
1454 matcher_.DescribeNegationTo(os);
1458 matcher_.DescribeTo(os);
1469 template <
typename InnerMatcher>
1476 template <
typename T>
1482 InnerMatcher matcher_;
1491 template <
typename T>
1495 : matcher1_(matcher1), matcher2_(matcher2) {}
1499 matcher1_.DescribeTo(os);
1501 matcher2_.DescribeTo(os);
1507 matcher1_.DescribeNegationTo(os);
1509 matcher2_.DescribeNegationTo(os);
1517 if (!matcher1_.MatchAndExplain(x, &listener1)) {
1518 *listener << listener1.
str();
1523 if (!matcher2_.MatchAndExplain(x, &listener2)) {
1524 *listener << listener2.
str();
1537 *listener <<
", and " << s2;
1550 #if GTEST_LANG_CXX11 1558 template <
int kSize,
typename Head,
typename... Tail>
1559 struct MatcherList {
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>
1576 static Matcher<T> CreateMatcher(const ListType& matchers) {
1578 SafeMatcherCast<T>(matchers.first),
1579 MatcherListTail::template CreateMatcher<T, CombiningMatcher>(
1586 template <
typename Matcher1,
typename Matcher2>
1587 struct 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) {
1598 SafeMatcherCast<T>(matchers.first),
1599 SafeMatcherCast<T>(matchers.second)));
1607 template <
template <
typename T>
class CombiningMatcher,
typename...
Args>
1608 class VariadicMatcher {
1610 VariadicMatcher(
const Args&... matchers)
1611 : matchers_(MatcherListType::BuildList(matchers...)) {}
1616 template <
typename T>
1618 return MatcherListType::template CreateMatcher<T, CombiningMatcher>(
1623 typedef MatcherList<
sizeof...(Args),
Args...> MatcherListType;
1625 const typename MatcherListType::ListType matchers_;
1630 template <
typename...
Args>
1633 #endif // GTEST_LANG_CXX11 1637 template <
typename Matcher1,
typename Matcher2>
1641 : matcher1_(matcher1), matcher2_(matcher2) {}
1646 template <
typename T>
1649 SafeMatcherCast<T>(matcher2_)));
1663 template <
typename T>
1667 : matcher1_(matcher1), matcher2_(matcher2) {}
1671 matcher1_.DescribeTo(os);
1673 matcher2_.DescribeTo(os);
1679 matcher1_.DescribeNegationTo(os);
1681 matcher2_.DescribeNegationTo(os);
1689 if (matcher1_.MatchAndExplain(x, &listener1)) {
1690 *listener << listener1.
str();
1695 if (matcher2_.MatchAndExplain(x, &listener2)) {
1696 *listener << listener2.
str();
1709 *listener <<
", and " << s2;
1722 #if GTEST_LANG_CXX11 1724 template <
typename...
Args>
1727 #endif // GTEST_LANG_CXX11 1732 template <
typename Matcher1,
typename Matcher2>
1736 : matcher1_(matcher1), matcher2_(matcher2) {}
1741 template <
typename T>
1744 SafeMatcherCast<T>(matcher1_), SafeMatcherCast<T>(matcher2_)));
1756 template <
typename Predicate>
1765 template <
typename T>
1780 *os <<
"satisfies the given predicate";
1784 *os <<
"doesn't satisfy the given predicate";
1788 Predicate predicate_;
1795 template <
typename M>
1806 template <
typename T>
1822 return MatcherCast<const T&>(matcher_).
Matches(x);
1833 template <
typename M>
1841 template <
typename T>
1859 ::std::stringstream ss;
1860 ss <<
"Value of: " << value_text <<
"\n" 1863 ss <<
"\n Actual: " << listener.str();
1877 template <
typename M>
1887 template <
typename FloatType>
1897 expected_(expected), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {
1904 FloatType max_abs_error)
1905 : expected_(expected),
1906 nan_eq_nan_(nan_eq_nan),
1907 max_abs_error_(max_abs_error) {
1909 <<
", where max_abs_error is" << max_abs_error;
1913 template <
typename T>
1917 : expected_(expected),
1918 nan_eq_nan_(nan_eq_nan),
1919 max_abs_error_(max_abs_error) {}
1926 if (actual.is_nan() || expected.
is_nan()) {
1927 if (actual.is_nan() && expected.
is_nan()) {
1933 if (HasMaxAbsError()) {
1938 if (value == expected_) {
1942 const FloatType diff = value - expected_;
1943 if (fabs(diff) <= max_abs_error_) {
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_;
1970 if (HasMaxAbsError()) {
1971 *os <<
" (absolute error <= " << max_abs_error_ <<
")";
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_;
1989 if (HasMaxAbsError()) {
1990 *os <<
" (absolute error > " << max_abs_error_ <<
")";
1994 os->precision(old_precision);
1998 bool HasMaxAbsError()
const {
1999 return max_abs_error_ >= 0;
2002 const FloatType expected_;
2003 const bool nan_eq_nan_;
2005 const FloatType max_abs_error_;
2032 const FloatType expected_;
2033 const bool nan_eq_nan_;
2035 const FloatType max_abs_error_;
2042 template <
typename InnerMatcher>
2055 template <
typename Po
inter>
2062 template <
typename Po
inter>
2068 explicit Impl(
const InnerMatcher& matcher)
2069 : matcher_(MatcherCast<const Pointee&>(matcher)) {}
2071 virtual void DescribeTo(::std::ostream* os)
const {
2072 *os <<
"points to a value that ";
2073 matcher_.DescribeTo(os);
2076 virtual void DescribeNegationTo(::std::ostream* os)
const {
2077 *os <<
"does not point to a value that ";
2078 matcher_.DescribeTo(os);
2081 virtual bool MatchAndExplain(Pointer pointer,
2086 *listener <<
"which points to ";
2096 const InnerMatcher matcher_;
2107 template <
typename To>
2111 : matcher_(matcher) {}
2114 GetCastTypeDescription(os);
2115 matcher_.DescribeTo(os);
2119 GetCastTypeDescription(os);
2120 matcher_.DescribeNegationTo(os);
2128 return GetTypeName<To>();
2129 #else // GTEST_HAS_RTTI 2130 return "the target type";
2131 #endif // GTEST_HAS_RTTI 2135 static void GetCastTypeDescription(::std::ostream* os) {
2136 *os <<
"when dynamic_cast to " << GetToName() <<
", ";
2144 template <
typename To>
2150 template <
typename From>
2153 To to =
dynamic_cast<To>(from);
2160 template <
typename To>
2166 template <
typename From>
2169 To* to =
dynamic_cast<To*
>(&from);
2171 *listener <<
"which cannot be dynamic_cast to " << this->GetToName();
2180 template <
typename Class,
typename FieldType>
2185 : field_(field), matcher_(matcher) {}
2188 *os <<
"is an object whose given field ";
2189 matcher_.DescribeTo(os);
2193 *os <<
"is an object whose given field ";
2194 matcher_.DescribeNegationTo(os);
2197 template <
typename T>
2199 return MatchAndExplainImpl(
2200 typename ::testing::internal::
2209 bool MatchAndExplainImpl(
false_type ,
const Class& obj,
2211 *listener <<
"whose given field is ";
2215 bool MatchAndExplainImpl(
true_type ,
const Class* p,
2220 *listener <<
"which points to an object ";
2224 return MatchAndExplainImpl(
false_type(), *p, listener);
2227 const FieldType Class::*field_;
2235 template <
typename Class,
typename PropertyType>
2246 : property_(property), matcher_(matcher) {}
2249 *os <<
"is an object whose given property ";
2250 matcher_.DescribeTo(os);
2254 *os <<
"is an object whose given property ";
2255 matcher_.DescribeNegationTo(os);
2258 template <
typename T>
2260 return MatchAndExplainImpl(
2261 typename ::testing::internal::
2270 bool MatchAndExplainImpl(
false_type ,
const Class& obj,
2272 *listener <<
"whose given property is ";
2275 #if defined(_PREFAST_ ) && _MSC_VER == 1800 2281 RefToConstProperty result = (obj.*property_)();
2286 bool MatchAndExplainImpl(
true_type ,
const Class* p,
2291 *listener <<
"which points to an object ";
2295 return MatchAndExplainImpl(
false_type(), *p, listener);
2298 PropertyType (Class::*property_)()
const;
2308 template <
typename Functor>
2314 template <
typename T>
2315 static ResultType
Invoke(Functor f, T arg) {
return f(arg); }
2319 template <
typename ArgType,
typename ResType>
2322 typedef ResType(*StorageType)(ArgType);
2326 <<
"NULL function pointer is passed into ResultOf().";
2328 template <
typename T>
2329 static ResType
Invoke(ResType(*f)(ArgType), T arg) {
2336 template <
typename Callable>
2342 : callable_(callable), matcher_(matcher) {
2346 template <
typename T>
2348 return Matcher<T>(
new Impl<T>(callable_, matcher_));
2354 template <
typename T>
2358 : callable_(callable), matcher_(matcher) {}
2360 virtual void DescribeTo(::std::ostream* os)
const {
2361 *os <<
"is mapped by the given callable to a value that ";
2362 matcher_.DescribeTo(os);
2365 virtual void DescribeNegationTo(::std::ostream* os)
const {
2366 *os <<
"is mapped by the given callable to a value that ";
2367 matcher_.DescribeNegationTo(os);
2371 *listener <<
"which is mapped by the given callable to ";
2385 mutable CallableStorageType callable_;
2391 const CallableStorageType callable_;
2398 template <
typename SizeMatcher>
2402 : size_matcher_(size_matcher) {
2405 template <
typename Container>
2410 template <
typename Container>
2415 typedef typename ContainerView::type::size_type
SizeType;
2416 explicit Impl(
const SizeMatcher& size_matcher)
2417 : size_matcher_(
MatcherCast<SizeType>(size_matcher)) {}
2421 size_matcher_.DescribeTo(os);
2425 size_matcher_.DescribeNegationTo(os);
2430 SizeType size = container.size();
2432 const bool result = size_matcher_.MatchAndExplain(size, &size_listener);
2434 <<
"whose size " << size << (result ?
" matches" :
" doesn't match");
2445 const SizeMatcher size_matcher_;
2451 template <
typename DistanceMatcher>
2455 : distance_matcher_(distance_matcher) {}
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() ";
2475 distance_matcher_.DescribeTo(os);
2478 *os <<
"distance between begin() and end() ";
2479 distance_matcher_.DescribeNegationTo(os);
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());
2493 distance_matcher_.MatchAndExplain(distance, &distance_listener);
2494 *listener <<
"whose distance between begin() and end() " << distance
2495 << (result ?
" matches" :
" doesn't match");
2506 const DistanceMatcher distance_matcher_;
2520 template <
typename Container>
2530 : expected_(View::Copy(expected)) {
2542 *os <<
"does not equal ";
2546 template <
typename LhsContainer>
2554 StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
2555 if (lhs_stl_container == expected_)
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();
2580 it != expected_.end(); ++it) {
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;
2600 const StlContainer expected_;
2607 template <
typename T,
typename U>
2608 bool operator()(
const T& lhs,
const U& rhs)
const {
return lhs < rhs; }
2612 template <
typename Comparator,
typename ContainerMatcher>
2616 const ContainerMatcher& matcher)
2617 : comparator_(comparator), matcher_(matcher) {}
2619 template <
typename LhsContainer>
2624 template <
typename LhsContainer>
2636 Impl(
const Comparator& comparator,
const ContainerMatcher& matcher)
2637 : comparator_(comparator), matcher_(matcher) {}
2640 *os <<
"(when sorted) ";
2641 matcher_.DescribeTo(os);
2645 *os <<
"(when sorted) ";
2646 matcher_.DescribeNegationTo(os);
2651 LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
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,
2675 const Comparator comparator_;
2682 const Comparator comparator_;
2683 const ContainerMatcher matcher_;
2692 template <
typename TupleMatcher,
typename RhsContainer>
2702 : tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {
2709 template <
typename LhsContainer>
2714 template <
typename LhsContainer>
2728 Impl(
const TupleMatcher& tuple_matcher,
const RhsStlContainer& rhs)
2730 : mono_tuple_matcher_(
SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
2734 *os <<
"contains " << rhs_.size()
2735 <<
" values, where each value and its corresponding value in ";
2738 mono_tuple_matcher_.DescribeTo(os);
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 ";
2746 mono_tuple_matcher_.DescribeNegationTo(os);
2751 LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
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) {
2761 const InnerMatcherArg value_pair(*left, *right);
2765 if (!mono_tuple_matcher_.MatchAndExplain(
2766 value_pair, &inner_listener)) {
2767 *listener <<
"where the value pair (";
2771 *listener <<
") at index #" << i <<
" don't match";
2776 if (!mono_tuple_matcher_.Matches(value_pair))
2786 const RhsStlContainer rhs_;
2792 const TupleMatcher tuple_matcher_;
2793 const RhsStlContainer rhs_;
2799 template <
typename Container>
2806 typedef typename StlContainer::value_type
Element;
2808 template <
typename InnerMatcher>
2817 Container container,
2819 StlContainerReference stl_container = View::ConstReference(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;
2844 template <
typename Container>
2847 template <
typename InnerMatcher>
2853 *os <<
"contains at least one element that ";
2854 this->inner_matcher_.DescribeTo(os);
2858 *os <<
"doesn't contain any element that ";
2859 this->inner_matcher_.DescribeTo(os);
2864 return this->MatchAndExplainImpl(
false, container, listener);
2873 template <
typename Container>
2876 template <
typename InnerMatcher>
2882 *os <<
"only contains elements that ";
2883 this->inner_matcher_.DescribeTo(os);
2887 *os <<
"contains some element that ";
2888 this->inner_matcher_.DescribeNegationTo(os);
2893 return this->MatchAndExplainImpl(
true, container, listener);
2901 template <
typename M>
2906 template <
typename Container>
2912 const M inner_matcher_;
2918 template <
typename M>
2923 template <
typename Container>
2929 const M inner_matcher_;
2938 template <
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 ";
2966 inner_matcher_.DescribeTo(os);
2971 *os <<
"doesn't have a key that ";
2972 inner_matcher_.DescribeTo(os);
2982 template <
typename M>
2987 template <
typename PairType>
2993 const M matcher_for_key_;
3000 template <
typename PairType>
3007 template <
typename FirstMatcher,
typename SecondMatcher>
3017 *os <<
"has a first field that ";
3018 first_matcher_.DescribeTo(os);
3019 *os <<
", and has a second field that ";
3020 second_matcher_.DescribeTo(os);
3025 *os <<
"has a first field that ";
3026 first_matcher_.DescribeNegationTo(os);
3027 *os <<
", or has a second field that ";
3028 second_matcher_.DescribeNegationTo(os);
3038 return first_matcher_.Matches(a_pair.first) &&
3039 second_matcher_.Matches(a_pair.second);
3042 if (!first_matcher_.MatchAndExplain(a_pair.first,
3043 &first_inner_listener)) {
3044 *listener <<
"whose first field does not match";
3049 if (!second_matcher_.MatchAndExplain(a_pair.second,
3050 &second_inner_listener)) {
3051 *listener <<
"whose second field does not match";
3055 ExplainSuccess(first_inner_listener.
str(), second_inner_listener.
str(),
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;
3086 template <
typename FirstMatcher,
typename SecondMatcher>
3090 : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
3092 template <
typename PairType>
3096 first_matcher_, second_matcher_));
3100 const FirstMatcher first_matcher_;
3101 const SecondMatcher second_matcher_;
3107 template <
typename Container>
3114 typedef typename StlContainer::value_type
Element;
3118 template <
typename InputIter>
3120 while (first != last) {
3121 matchers_.push_back(MatcherCast<const Element&>(*first++));
3129 }
else if (
count() == 1) {
3130 *os <<
"has 1 element that ";
3131 matchers_[0].DescribeTo(os);
3133 *os <<
"has " << Elements(
count()) <<
" where\n";
3134 for (
size_t i = 0; i !=
count(); ++i) {
3135 *os <<
"element #" << i <<
" ";
3136 matchers_[i].DescribeTo(os);
3137 if (i + 1 <
count()) {
3147 *os <<
"isn't empty";
3151 *os <<
"doesn't have " << Elements(
count()) <<
", or\n";
3152 for (
size_t i = 0; i !=
count(); ++i) {
3153 *os <<
"element #" << i <<
" ";
3154 matchers_[i].DescribeNegationTo(os);
3155 if (i + 1 <
count()) {
3166 const bool listener_interested = listener->
IsInterested();
3169 ::std::vector<internal::string> explanations(
count());
3170 StlContainerReference stl_container = View::ConstReference(container);
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;
3243 return Message() << count << (count == 1 ?
" element" :
" elements");
3246 size_t count()
const {
return matchers_.size(); }
3248 ::std::vector<Matcher<const Element&> > matchers_;
3260 : num_elements_(num_elements),
3261 num_matchers_(num_matchers),
3262 matched_(num_elements_* num_matchers_, 0) {
3268 return matched_[SpaceIndex(ilhs, irhs)] == 1;
3271 matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0;
3281 string DebugString()
const;
3284 size_t SpaceIndex(
size_t ilhs,
size_t irhs)
const {
3285 return ilhs * num_matchers_ + irhs;
3288 size_t num_elements_;
3289 size_t num_matchers_;
3294 ::std::vector<char> matched_;
3319 void DescribeToImpl(::std::ostream* os)
const;
3322 void DescribeNegationToImpl(::std::ostream* os)
const;
3324 bool VerifyAllElementsAndMatchersAreMatched(
3325 const ::std::vector<string>& element_printouts,
3330 return matcher_describers_;
3334 return Message() << n <<
" element" << (n == 1 ?
"" :
"s");
3338 MatcherDescriberVec matcher_describers_;
3344 template <
typename Container>
3354 typedef typename StlContainer::value_type
Element;
3358 template <
typename InputIter>
3360 for (; first != last; ++first) {
3361 matchers_.push_back(MatcherCast<const Element&>(*first));
3362 matcher_describers().push_back(matchers_.back().GetDescriber());
3368 return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os);
3373 return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os);
3378 StlContainerReference stl_container = View::ConstReference(container);
3379 ::std::vector<string> element_printouts;
3380 MatchMatrix matrix = AnalyzeElements(stl_container.begin(),
3381 stl_container.end(),
3385 const size_t actual_count = matrix.
LhsSize();
3386 if (actual_count == 0 && matchers_.empty()) {
3389 if (actual_count != matchers_.size()) {
3395 *listener <<
"which has " << Elements(actual_count);
3400 return VerifyAllElementsAndMatchersAreMatched(element_printouts,
3401 matrix, listener) &&
3406 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
3408 template <
typename ElementIter>
3409 MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last,
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) {
3420 did_match.push_back(
Matches(matchers_[irhs])(*elem_first));
3424 MatchMatrix matrix(num_elements, matchers_.size());
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);
3434 MatcherVec matchers_;
3441 template <
typename Target>
3443 template <
typename Arg>
3445 return MatcherCast<Target>(a);
3450 template <
typename MatcherTuple>
3454 : matchers_(args) {}
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()));
3476 template <
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()));
3501 template <
typename T>
3506 template <
typename Iter>
3508 : matchers_(first, last) {}
3510 template <
typename Container>
3518 ::std::vector<T> matchers_;
3524 template <
typename T>
3527 template <
typename Iter>
3530 template <
typename Container>
3533 matchers_.begin(), matchers_.end()));
3537 const ::std::vector<T> matchers_;
3551 template <
typename Tuple2Matcher,
typename Second>
3555 : tuple2_matcher_(tm), second_value_(second) {}
3557 template <
typename T>
3559 return MakeMatcher(
new Impl<T>(tuple2_matcher_, second_value_));
3571 GTEST_LOG_(FATAL) <<
"BoundSecondMatcher should never be assigned.";
3575 template <
typename T>
3578 typedef ::testing::tuple<T, Second> ArgTuple;
3580 Impl(
const Tuple2Matcher& tm,
const Second& second)
3581 : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
3582 second_value_(second) {}
3584 virtual void DescribeTo(::std::ostream* os)
const {
3588 mono_tuple2_matcher_.DescribeTo(os);
3592 return mono_tuple2_matcher_.MatchAndExplain(ArgTuple(x, second_value_),
3598 const Second second_value_;
3603 const Tuple2Matcher tuple2_matcher_;
3604 const Second second_value_;
3611 template <
typename Tuple2Matcher,
typename Second>
3613 const Tuple2Matcher& tm,
const Second& second) {
3623 const char* matcher_name,
3643 template <
typename Iter>
3645 typename ::std::iterator_traits<Iter>::value_type>
3647 typedef typename ::std::iterator_traits<Iter>::value_type T;
3651 template <
typename T>
3653 const T* pointer,
size_t count) {
3657 template <
typename T,
size_t N>
3659 const T (&array)[N]) {
3663 template <
typename Container>
3669 #if GTEST_HAS_STD_INITIALIZER_LIST_ 3670 template <
typename T>
3685 template <
typename Iter>
3687 typename ::std::iterator_traits<Iter>::value_type>
3689 typedef typename ::std::iterator_traits<Iter>::value_type T;
3693 template <
typename T>
3699 template <
typename T,
size_t N>
3705 template <
typename Container>
3707 typename Container::value_type>
3712 #if GTEST_HAS_STD_INITIALIZER_LIST_ 3713 template <
typename T>
3731 template <
typename T>
3735 template <
typename T>
3741 template <
typename T>
3746 template <
typename T>
3761 template <
typename Lhs,
typename Rhs>
3765 template <
typename Rhs>
3771 template <
typename Rhs>
3777 template <
typename Rhs>
3783 template <
typename Rhs>
3789 template <
typename Rhs>
3808 template <
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) {
3871 template <
typename InnerMatcher>
3873 const InnerMatcher& inner_matcher) {
3883 template <
typename To>
3894 template <
typename Class,
typename FieldType,
typename FieldMatcher>
3897 FieldType Class::*field,
const FieldMatcher& matcher) {
3900 field, MatcherCast<const FieldType&>(matcher)));
3911 template <
typename Class,
typename PropertyType,
typename PropertyMatcher>
3914 PropertyType (Class::*property)()
const,
const PropertyMatcher& matcher) {
3938 template <
typename Callable,
typename ResultOfMatcher>
3940 Callable callable,
const ResultOfMatcher& matcher) {
3943 MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
3978 str,
false,
false));
4025 #if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING 4053 str,
false,
false));
4078 #endif // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING 4106 template <
typename InnerMatcher>
4114 template <
typename Predicate>
4126 template <
typename SizeMatcher>
4137 template <
typename DistanceMatcher>
4147 template <
typename Container>
4160 template <
typename Comparator,
typename ContainerMatcher>
4163 const ContainerMatcher& container_matcher) {
4165 comparator, container_matcher);
4170 template <
typename ContainerMatcher>
4184 template <
typename TupleMatcher,
typename Container>
4187 Pointwise(
const TupleMatcher& tuple_matcher,
const Container& rhs) {
4193 tuple_matcher, rhs);
4196 #if GTEST_HAS_STD_INITIALIZER_LIST_ 4199 template <
typename TupleMatcher,
typename T>
4201 const TupleMatcher& tuple_matcher, std::initializer_list<T> rhs) {
4202 return Pointwise(tuple_matcher, std::vector<T>(rhs));
4205 #endif // GTEST_HAS_STD_INITIALIZER_LIST_ 4218 template <
typename Tuple2Matcher,
typename RhsContainer>
4222 RhsContainer)>::type::value_type> >
4224 const RhsContainer& rhs_container) {
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_ 4253 template <
typename Tuple2Matcher,
typename T>
4257 std::initializer_list<T> rhs) {
4261 #endif // GTEST_HAS_STD_INITIALIZER_LIST_ 4281 template <
typename M>
4313 template <
typename M>
4321 template <
typename M>
4331 template <
typename FirstMatcher,
typename SecondMatcher>
4333 Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
4335 first_matcher, second_matcher);
4340 template <
typename M>
4346 template <
typename T,
typename M>
4347 inline bool Value(
const T& value, M matcher) {
4353 template <
typename T,
typename M>
4356 return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
4359 #if GTEST_LANG_CXX11 4362 template <
typename...
Args>
4363 inline internal::AllOfMatcher<
Args...>
AllOf(
const Args&... matchers) {
4364 return internal::AllOfMatcher<
Args...>(matchers...);
4367 template <
typename...
Args>
4368 inline internal::AnyOfMatcher<
Args...>
AnyOf(
const Args&... matchers) {
4369 return internal::AnyOfMatcher<
Args...>(matchers...);
4372 #endif // GTEST_LANG_CXX11 4381 template <
typename InnerMatcher>
4382 inline 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) 4399 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ Functor StorageType
Definition: gmock-matchers.h:2311
TrulyMatcher(Predicate pred)
Definition: gmock-matchers.h:1759
Definition: gmock-matchers.h:1430
WhenDynamicCastToMatcherBase(const Matcher< To > &matcher)
Definition: gmock-matchers.h:2110
static Matcher< T > Cast(const Matcher< U > &source_matcher)
Definition: gmock-matchers.h:565
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly(Predicate pred)
Definition: gmock-matchers.h:4116
Definition: gmock-matchers.h:3345
bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:256
UnorderedElementsAreArrayMatcher(Iter first, Iter last)
Definition: gmock-matchers.h:3507
virtual bool MatchAndExplain(PairType key_value, MatchResultListener *listener) const
Definition: gmock-matchers.h:2951
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe(const internal::string &str)
Definition: gmock-matchers.h:3976
bool operator()(const T &lhs, const U &rhs) const
Definition: gmock-matchers.h:2608
Definition: gtest-internal.h:855
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1457
#define GMOCK_KIND_OF_(type)
Definition: gmock-internal-utils.h:168
::std::ostream * stream()
Definition: gmock-matchers.h:98
Definition: gmock-matchers.h:2919
Definition: gmock-matchers.h:2613
virtual bool MatchAndExplain(T value, MatchResultListener *listener) const
Definition: gmock-matchers.h:1921
WhenDynamicCastToMatcher(const Matcher< To &> &matcher)
Definition: gmock-matchers.h:2163
static const char * Desc()
Definition: gmock-matchers.h:1428
Definition: gmock-matchers.h:1664
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1010
def args
Definition: android_test.py:111
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1158
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2537
Definition: gmock-matchers.h:1126
ContainerEqMatcher(const Container &expected)
Definition: gmock-matchers.h:2529
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith(const internal::string &suffix)
Definition: gmock-matchers.h:3998
Definition: gmock-actions.h:53
MatcherBase()
Definition: gmock-matchers.h:288
Definition: gmock-matchers.h:117
Matcher< T > SafeMatcherCast(const M &polymorphic_matcher)
Definition: gmock-matchers.h:665
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:3376
ContainsMatcher(M m)
Definition: gmock-matchers.h:2904
Definition: gmock-matchers.h:143
Definition: gmock-matchers.h:1434
Definition: gmock-matchers.h:1470
LhsView::type LhsStlContainer
Definition: gmock-matchers.h:2629
View::type StlContainer
Definition: gmock-matchers.h:3112
int * count
Definition: gmock_stress_test.cc:176
static const char * NegatedDesc()
Definition: gmock-matchers.h:940
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1669
EitherOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition: gmock-matchers.h:1666
EndsWithMatcher(const StringType &suffix)
Definition: gmock-matchers.h:1283
LhsView::type LhsStlContainer
Definition: gmock-matchers.h:2719
Definition: gmock-matchers.h:2411
void operator=(const BoundSecondMatcher &)
Definition: gmock-matchers.h:3570
KeyMatcher(M m)
Definition: gmock-matchers.h:2985
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1307
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1312
static const char * NegatedDesc()
Definition: gmock-matchers.h:948
::std::pair< size_t, size_t > ElementMatcherPair
Definition: gmock-matchers.h:3297
def Run(command)
Definition: gtest_break_on_failure_unittest.py:80
internal::GtMatcher< Rhs > Gt(Rhs x)
Definition: gmock-matchers.h:3772
internal::ElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > ElementsAreArray(Iter first, Iter last)
Definition: gmock-matchers.h:3646
PredicateFormatterFromMatcher< M > MakePredicateFormatterFromMatcher(M matcher)
Definition: gmock-matchers.h:1879
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:1449
MatchResultListener & operator<<(const T &x)
Definition: gmock-matchers.h:91
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2862
Definition: gmock-matchers.h:3108
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2482
bool MatchAndExplain(const LhsContainer &lhs, MatchResultListener *listener) const
Definition: gmock-matchers.h:2547
Definition: gmock-matchers.h:859
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:1513
static const char * NegatedDesc()
Definition: gmock-matchers.h:972
internal::StlContainerView< RhsContainer > RhsView
Definition: gmock-matchers.h:2695
static const char * Desc()
Definition: gmock-matchers.h:947
::std::string PrintToString(const T &value)
Definition: gtest-printers.h:980
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2644
internal::FloatingEqMatcher< double > DoubleNear(double rhs, double max_abs_error)
Definition: gmock-matchers.h:3828
Definition: gmock-matchers.h:3525
StrEqualityMatcher(const StringType &str, bool expect_eq, bool case_sensitive)
Definition: gmock-matchers.h:1128
internal::WhenSortedByMatcher< internal::LessComparator, ContainerMatcher > WhenSorted(const ContainerMatcher &container_matcher)
Definition: gmock-matchers.h:4172
static ResType Invoke(ResType(*f)(ArgType), T arg)
Definition: gmock-matchers.h:2329
Definition: gmock-matchers.h:1638
Definition: gmock-matchers.h:2521
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe(const internal::string &str)
Definition: gmock-matchers.h:3962
static const char * Desc()
Definition: gmock-matchers.h:1420
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:1150
static const char * Desc()
Definition: gmock-matchers.h:931
#define GTEST_LOG_(severity)
Definition: gtest-port.h:1271
virtual bool MatchAndExplain(LhsContainer lhs, MatchResultListener *listener) const
Definition: gmock-matchers.h:2649
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex(const internal::RE *regex)
Definition: gmock-matchers.h:4016
Definition: gmock-internal-utils.h:127
Definition: gmock-matchers.h:2108
Definition: gmock-internal-utils.h:406
internal::ResultOfMatcher< Callable > ResultOf(Callable callable, const ResultOfMatcher &matcher)
Definition: gmock-matchers.h:3939
Definition: gmock-matchers.h:977
::std::string string
Definition: gtest-port.h:1097
Definition: gtest-internal.h:262
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:1254
static void CheckIsValid(ResType(*f)(ArgType))
Definition: gmock-matchers.h:2324
GTEST_API_ bool FindPairing(const MatchMatrix &matrix, MatchResultListener *listener)
ResultOfMatcher(Callable callable, const Matcher< ResultType > &matcher)
Definition: gmock-matchers.h:2341
BothOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition: gmock-matchers.h:1494
internal::GeMatcher< Rhs > Ge(Rhs x)
Definition: gmock-matchers.h:3766
Definition: gmock-matchers.h:1029
GTEST_API_ AssertionResult AssertionFailure()
MatchesRegexMatcher(const RE *regex, bool full_match)
Definition: gmock-matchers.h:1328
Matcher(const MatcherInterface< internal::string > *impl)
Definition: gmock-matchers.h:361
Definition: gmock-matchers.h:1326
Definition: gtest-port.h:2213
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
Definition: gmock-generated-matchers.h:1085
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
::std::wstring wstring
Definition: gtest-port.h:1103
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1266
FloatingEqMatcher(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
Definition: gmock-matchers.h:1903
RefMatcher(T &x)
Definition: gmock-matchers.h:1042
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:3016
Definition: gmock-matchers.h:997
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:3024
Definition: gmock-matchers.h:2236
virtual bool MatchAndExplain(LhsContainer lhs, MatchResultListener *listener) const
Definition: gmock-matchers.h:2749
Definition: gmock-matchers.h:239
WhenDynamicCastToMatcher(const Matcher< To > &matcher)
Definition: gmock-matchers.h:2147
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1009
virtual bool MatchAndExplain(T, MatchResultListener *) const
Definition: gmock-matchers.h:861
StlContainer::value_type Element
Definition: gmock-matchers.h:3354
bool operator()(const A &a, const B &b) const
Definition: gmock-matchers.h:216
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1214
StlContainer::value_type Element
Definition: gmock-matchers.h:3114
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
Definition: gmock-matchers.h:627
internal::StlContainerView< RawContainer > View
Definition: gmock-matchers.h:3111
InnerMatcher AllArgs(const InnerMatcher &matcher)
Definition: gmock-matchers.h:4382
PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: gmock-matchers.h:3008
internal::StlContainerView< Container > View
Definition: gmock-matchers.h:2523
Definition: gmock-matchers.h:2181
RemoveConstFromKey< typename LhsStlContainer::value_type >::type LhsValue
Definition: gmock-matchers.h:2634
internal::FloatingEqMatcher< float > FloatEq(float rhs)
Definition: gmock-matchers.h:3843
Definition: gmock-matchers.h:3257
Definition: gmock-matchers.h:2463
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
Definition: gmock-matchers.h:701
Definition: gmock-matchers.h:2715
Definition: gmock-matchers.h:2399
Matcher< T > An()
Definition: gmock-matchers.h:3736
Definition: gmock-matchers.h:2800
const Matcher< const Element & > inner_matcher_
Definition: gmock-matchers.h:2837
virtual bool MatchAndExplain(PairType a_pair, MatchResultListener *listener) const
Definition: gmock-matchers.h:3033
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
Definition: gmock-matchers.h:3913
#define GTEST_API_
Definition: gtest-port.h:934
Definition: gmock-matchers.h:1796
RhsView::type RhsStlContainer
Definition: gmock-matchers.h:2696
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: gmock-matchers.h:796
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gmock-matchers.h:2983
const Matcher< To > matcher_
Definition: gmock-matchers.h:2124
Definition: gmock-matchers.h:2845
Definition: gmock-matchers.h:1444
Definition: gmock-matchers.h:2902
internal::FloatingEqMatcher< float > NanSensitiveFloatNear(float rhs, float max_abs_error)
Definition: gmock-matchers.h:3864
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith(const internal::string &prefix)
Definition: gmock-matchers.h:3991
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2639
internal::EqMatcher< T > Eq(T x)
Definition: gmock-matchers.h:3742
bool CaseInsensitiveCStringEquals(const wchar_t *lhs, const wchar_t *rhs)
Definition: gmock-matchers.h:1094
#define GTEST_REMOVE_REFERENCE_(T)
Definition: gtest-internal.h:788
UnorderedElementsAreArrayMatcher()
Definition: gmock-matchers.h:3504
View::const_reference StlContainerReference
Definition: gmock-matchers.h:3352
QuantifierMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2809
const MatcherDescriberInterface * GetDescriber() const
Definition: gmock-matchers.h:283
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2852
internal::BeginEndDistanceIsMatcher< DistanceMatcher > BeginEndDistanceIs(const DistanceMatcher &distance_matcher)
Definition: gmock-matchers.h:4139
internal::FloatingEqMatcher< double > NanSensitiveDoubleNear(double rhs, double max_abs_error)
Definition: gmock-matchers.h:3836
internal::FloatingEqMatcher< float > NanSensitiveFloatEq(float rhs)
Definition: gmock-matchers.h:3849
View::type StlContainer
Definition: gmock-matchers.h:2804
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:989
Definition: gmock-matchers.h:935
Definition: gmock-matchers.h:3451
Definition: gmock-internal-utils.h:505
View::type StlContainer
Definition: gmock-matchers.h:2524
::std::vector< const MatcherDescriberInterface * > MatcherDescriberVec
Definition: gmock-matchers.h:3316
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2881
static const char * Desc()
Definition: gmock-matchers.h:939
LeMatcher(const Rhs &rhs)
Definition: gmock-matchers.h:961
bool MatchAndExplain(T &x, MatchResultListener *) const
Definition: gmock-matchers.h:1766
ContainsMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2848
internal::SizeIsMatcher< SizeMatcher > SizeIs(const SizeMatcher &size_matcher)
Definition: gmock-matchers.h:4128
PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: gmock-matchers.h:3089
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
Definition: gmock-generated-matchers.h:481
#define GTEST_DISALLOW_ASSIGN_(type)
Definition: gtest-port.h:869
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
Definition: gmock-matchers.h:4005
StartsWithMatcher(const StringType &prefix)
Definition: gmock-matchers.h:1236
Definition: gmock-matchers.h:515
Definition: gmock-matchers.h:876
EachMatcher(M m)
Definition: gmock-matchers.h:2921
Definition: gmock-matchers.h:2939
Matcher()
Definition: gmock-matchers.h:324
bool_constant< false > false_type
Definition: gtest-port.h:2209
Definition: gmock-matchers.h:3311
bool operator()(const A &a, const B &b) const
Definition: gmock-matchers.h:208
PolymorphicMatcher< internal::NotNullMatcher > NotNull()
Definition: gmock-matchers.h:3802
RawPairType::second_type SecondType
Definition: gmock-matchers.h:3005
PolymorphicMatcher< internal::WhenDynamicCastToMatcher< To > > WhenDynamicCastTo(const Matcher< To > &inner_matcher)
Definition: gmock-matchers.h:3885
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2541
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2253
static const char * NegatedDesc()
Definition: gmock-matchers.h:932
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2964
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: gmock-matchers.h:1685
Impl & mutable_impl()
Definition: gmock-matchers.h:436
BoundSecondMatcher< Tuple2Matcher, Second > MatcherBindSecond(const Tuple2Matcher &tm, const Second &second)
Definition: gmock-matchers.h:3612
static bool Matches(const MatcherTuple &, const ValueTuple &)
Definition: gmock-matchers.h:779
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition: gmock-matchers.h:2259
WhenSortedByMatcher(const Comparator &comparator, const ContainerMatcher &matcher)
Definition: gmock-matchers.h:2615
#define GTEST_REFERENCE_TO_CONST_(T)
Definition: gtest-internal.h:848
Definition: gmock-matchers.h:252
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
Definition: gmock-matchers.h:2414
Definition: gmock-matchers.h:222
Matcher()
Definition: gmock-matchers.h:359
Definition: gmock-matchers.h:228
StringMatchResultListener()
Definition: gmock-matchers.h:186
internal::PointwiseMatcher< TupleMatcher, GTEST_REMOVE_CONST_(Container)> Pointwise(const TupleMatcher &tuple_matcher, const Container &rhs)
Definition: gmock-matchers.h:4187
static const char * NegatedDesc()
Definition: gmock-matchers.h:956
Definition: gmock-matchers.h:430
Matcher(const MatcherInterface< const internal::string &> *impl)
Definition: gmock-matchers.h:344
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:134
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1353
Definition: gmock-matchers.h:1032
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1505
Definition: gmock-matchers.h:3502
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq(const internal::string &str)
Definition: gmock-matchers.h:3969
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2970
Definition: gmock-matchers.h:1381
const type & const_reference
Definition: gmock-internal-utils.h:409
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:1032
void SetEdge(size_t ilhs, size_t irhs, bool b)
Definition: gmock-matchers.h:3270
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2423
Definition: gmock-matchers.h:1418
MatcherBase(const MatcherInterface< T > *impl)
Definition: gmock-matchers.h:291
CallableTraits< Callable >::ResultType ResultType
Definition: gmock-matchers.h:2339
Definition: gtest-linked_ptr.h:146
PointwiseMatcher(const TupleMatcher &tuple_matcher, const RhsContainer &rhs)
Definition: gmock-matchers.h:2701
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2419
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2248
PolymorphicMatcher< Impl > MakePolymorphicMatcher(const Impl &impl)
Definition: gmock-matchers.h:496
Definition: gmock-matchers.h:943
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2113
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
View::type StlContainer
Definition: gmock-matchers.h:3351
bool operator()(const A &a, const B &b) const
Definition: gmock-matchers.h:224
string Print(const T &value)
Definition: gtest-printers_test.cc:235
internal::string str() const
Definition: gmock-matchers.h:189
ElementsAreArrayMatcher(Iter first, Iter last)
Definition: gmock-matchers.h:3528
ContainerView::type::size_type SizeType
Definition: gmock-matchers.h:2415
Definition: gmock-matchers.h:3477
MatchMatrix(size_t num_elements, size_t num_matchers)
Definition: gmock-matchers.h:3259
Definition: gmock-matchers.h:1187
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1977
Definition: gmock-matchers.h:959
Definition: gmock-matchers.h:218
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1956
LhsView::const_reference LhsStlContainerReference
Definition: gmock-matchers.h:2630
std::mutex m
Definition: AlexaPresentationTest.cpp:91
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:4347
bool MatchAndExplain(From from, MatchResultListener *listener) const
Definition: gmock-matchers.h:2151
LhsView::const_reference LhsStlContainerReference
Definition: gmock-matchers.h:2720
internal::MatcherAsPredicate< M > Matches(M matcher)
Definition: gmock-matchers.h:4341
Impl(const TupleMatcher &tuple_matcher, const RhsStlContainer &rhs)
Definition: gmock-matchers.h:2728
static const char * NegatedDesc()
Definition: gmock-matchers.h:964
Definition: gmock-matchers.h:2606
def Iter(n, format, sep='')
Definition: gen_gtest_pred_impl.py:189
Definition: gmock-matchers.h:1757
Definition: gmock-matchers.h:80
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2886
HasSubstrMatcher(const StringType &substring)
Definition: gmock-matchers.h:1189
Functor::result_type ResultType
Definition: gmock-matchers.h:2310
const Impl & impl() const
Definition: gmock-matchers.h:440
bool operator()(const A &a, const B &b) const
Definition: gmock-matchers.h:220
PolymorphicMatcher(const Impl &an_impl)
Definition: gmock-matchers.h:432
EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition: gmock-matchers.h:1735
LhsStlContainer::value_type LhsValue
Definition: gmock-matchers.h:2721
Definition: gmock-matchers.h:202
Matcher()
Definition: gmock-matchers.h:342
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: gmock-matchers.h:1245
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1261
Definition: gmock-matchers.h:3087
GTEST_API_ string FormatMatcherDescription(bool negation, const char *matcher_name, const Strings ¶m_values)
bool MatchAndExplainImpl(bool all_elements_should_match, Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2816
Definition: gmock-matchers.h:967
internal::LeMatcher< Rhs > Le(Rhs x)
Definition: gmock-matchers.h:3778
Definition: gmock-matchers.h:1414
PropertyMatcher(PropertyType(Class::*property)() const, const Matcher< RefToConstProperty > &matcher)
Definition: gmock-matchers.h:2244
bool HasEdge(size_t ilhs, size_t irhs) const
Definition: gmock-matchers.h:3267
static Message Elements(size_t n)
Definition: gmock-matchers.h:3333
Definition: gmock-matchers.h:927
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1783
Definition: gtest-port.h:1156
Definition: gmock-matchers.h:206
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
Definition: gmock-matchers.h:517
Definition: gmock-matchers.h:210
ElementsAreMatcher(const MatcherTuple &args)
Definition: gmock-matchers.h:3479
internal::WhenSortedByMatcher< Comparator, ContainerMatcher > WhenSortedBy(const Comparator &comparator, const ContainerMatcher &container_matcher)
Definition: gmock-matchers.h:4162
Definition: gmock-internal-utils.h:340
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:1300
Impl(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
Definition: gmock-matchers.h:1916
Definition: gmock-matchers.h:1422
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:863
Definition: gmock-matchers.h:622
Definition: gtest-port.h:2203
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: gmock-matchers.h:1198
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1162
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
Definition: gmock-matchers.h:3795
size_t LhsSize() const
Definition: gmock-matchers.h:3265
Definition: gmock-matchers.h:2625
View::const_reference StlContainerReference
Definition: gmock-matchers.h:2805
GeMatcher(const Rhs &rhs)
Definition: gmock-matchers.h:969
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: gmock-matchers.h:1138
StreamMatchResultListener(::std::ostream *os)
Definition: gmock-matchers.h:241
static const char * Desc()
Definition: gmock-matchers.h:955
Definition: gmock-matchers.h:951
UnorderedElementsAreMatcher(const MatcherTuple &args)
Definition: gmock-matchers.h:3453
Definition: gmock-matchers.h:1888
internal::PairMatcher< FirstMatcher, SecondMatcher > Pair(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: gmock-matchers.h:4333
::testing::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
Definition: gmock-matchers.h:2726
MatchResultListener(::std::ostream *os)
Definition: gmock-matchers.h:85
static void ExplainMatchFailuresTo(const MatcherTuple &, const ValueTuple &, ::std::ostream *)
Definition: gmock-matchers.h:785
NotMatcher(InnerMatcher matcher)
Definition: gmock-matchers.h:1472
Matcher(const MatcherInterface< T > *impl)
Definition: gmock-matchers.h:327
bool MatchAndExplain(From &from, MatchResultListener *listener) const
Definition: gmock-matchers.h:2167
Definition: gmock-internal-utils.h:63
Definition: gmock-generated-internal-utils.h:69
static Matcher< T > Cast(const Matcher< U > &matcher)
Definition: gmock-matchers.h:641
virtual ~MatchResultListener()=0
Definition: gmock-matchers.h:112
Definition: gmock-matchers.h:1733
size_t RhsSize() const
Definition: gmock-matchers.h:3266
static const char * Desc()
Definition: gmock-matchers.h:963
Definition: gmock-matchers.h:1426
Definition: gmock-matchers.h:1234
Definition: gmock-matchers.h:3001
Definition: gmock-matchers.h:2043
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
Definition: gmock-matchers.h:4150
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
Definition: gmock-matchers.h:2718
bool ExplainMatchResult(M matcher, const T &value, MatchResultListener *listener)
Definition: gmock-matchers.h:4354
static const char * Desc()
Definition: gmock-matchers.h:1436
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:3126
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:270
virtual ~MatcherBase()
Definition: gmock-matchers.h:294
View::const_reference StlContainerReference
Definition: gmock-matchers.h:3113
::std::vector< ElementMatcherPair > ElementMatcherPairs
Definition: gmock-matchers.h:3298
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:3367
Definition: gmock-matchers.h:214
MatcherDescriberVec & matcher_describers()
Definition: gmock-matchers.h:3329
static const char * Desc()
Definition: gmock-matchers.h:1432
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
Definition: gmock-matchers.h:2466
UnorderedElementsAreMatcherImpl(InputIter first, InputIter last)
Definition: gmock-matchers.h:3359
virtual ~MatcherDescriberInterface()
Definition: gmock-matchers.h:119
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
Definition: gmock-matchers.h:484
GtMatcher(const Rhs &rhs)
Definition: gmock-matchers.h:953
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:990
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:3145
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: gmock-matchers.h:1337
static void CheckIsValid(Functor)
Definition: gmock-matchers.h:2313
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:1346
static const char * Desc()
Definition: gmock-matchers.h:971
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: gmock-matchers.h:1207
RawPairType::first_type FirstType
Definition: gmock-matchers.h:3004
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1497
void ExplainMatchResultTo(T x, ::std::ostream *os) const
Definition: gmock-matchers.h:275
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1677
Matcher< T > A()
Definition: gmock-matchers.h:3732
ResType ResultType
Definition: gmock-matchers.h:2321
type
Definition: upload.py:443
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
Definition: gmock-matchers.h:2628
::std::vector< string > Strings
Definition: gtest-printers.h:859
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
Definition: gmock-matchers.h:678
Definition: gmock-matchers.h:1914
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:3161
LtMatcher(const Rhs &rhs)
Definition: gmock-matchers.h:945
GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching(const MatchMatrix &g)
Definition: gmock-matchers.h:726
bool IsReadableTypeName(const string &type_name)
Definition: gmock-matchers.h:688
static string GetToName()
Definition: gmock-matchers.h:2126
OutIter TransformTupleValues(Func f, const Tuple &t, OutIter out)
Definition: gmock-matchers.h:853
RawPairType::first_type KeyType
Definition: gmock-matchers.h:2942
static void ExplainMatchFailuresTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition: gmock-matchers.h:743
Matcher< Lhs > TypedEq(const Rhs &rhs)
Definition: gmock-matchers.h:3762
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2733
NotMatcherImpl(const Matcher< T > &matcher)
Definition: gmock-matchers.h:1446
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1219
void Abort()
Definition: gtest-port.h:2410
Matcher< T > MatcherCast(const M &matcher)
Definition: gmock-matchers.h:610
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
Definition: gmock-matchers.h:3984
const
Definition: upload.py:398
Definition: gmock-matchers.h:2337
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2187
ElementsAreMatcherImpl(InputIter first, InputIter last)
Definition: gmock-matchers.h:3119
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: gtest-port.h:874
internal::ContainsMatcher< M > Contains(M matcher)
Definition: gmock-matchers.h:4282
internal::FloatingEqMatcher< float > FloatNear(float rhs, float max_abs_error)
Definition: gmock-matchers.h:3856
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:267
bool operator()(const A &a, const B &b) const
Definition: gmock-matchers.h:212
BeginEndDistanceIsMatcher(const DistanceMatcher &distance_matcher)
Definition: gmock-matchers.h:2454
bool StaticAssertTypeEq()
Definition: gtest.h:2150
bool CaseInsensitiveStringEquals(const StringType &s1, const StringType &s2)
Definition: gmock-matchers.h:1102
EqMatcher(const Rhs &rhs)
Definition: gmock-matchers.h:929
const internal::AnythingMatcher _
Definition: gmock-matchers.h:3729
StlContainer::value_type Element
Definition: gmock-matchers.h:2806
Definition: gmock-matchers.h:2693
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: gmock-matchers.h:1291
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
Definition: gmock-matchers.h:3955
Definition: gmock-matchers.h:3552
std::iterator_traits< typename ContainerView::type::const_iterator >::difference_type DistanceType
Definition: gmock-matchers.h:2469
bool Matches(T x) const
Definition: gmock-matchers.h:261
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:864
Definition: gmock-matchers.h:1281
NeMatcher(const Rhs &rhs)
Definition: gmock-matchers.h:937
#define GTEST_REMOVE_CONST_(T)
Definition: gtest-internal.h:819
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2891
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:2473
void Clear()
Definition: gmock-matchers.h:192
SizeIsMatcher(const SizeMatcher &size_matcher)
Definition: gmock-matchers.h:2401
internal::StlContainerView< RawContainer > View
Definition: gmock-matchers.h:3350
static bool Matches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: gmock-matchers.h:732
Definition: gmock-matchers.h:893
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition: gmock-matchers.h:980
DummyMatchResultListener()
Definition: gmock-matchers.h:230
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
Definition: gmock-matchers.h:3815
Impl(const SizeMatcher &size_matcher)
Definition: gmock-matchers.h:2416
Definition: gtest-port_test.cc:202
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2857
RhsStlContainer::value_type RhsValue
Definition: gmock-matchers.h:2697
Definition: gmock-matchers.h:319
Definition: gmock-matchers.h:2452
Iter ArrayAwareFind(Iter begin, Iter end, const Element &elem)
Definition: gtest-internal.h:983
Definition: gmock-matchers.h:2309
EachMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2877
Definition: gmock-internal-utils.h:492
static Matcher< T > Cast(const Matcher< T > &matcher)
Definition: gmock-matchers.h:600
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
Definition: gmock-matchers.h:3872
bool IsInterested() const
Definition: gmock-matchers.h:104
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: gmock-matchers.h:2428
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field(FieldType Class::*field, const FieldMatcher &matcher)
Definition: gmock-matchers.h:3896
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition: gmock-matchers.h:2198
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition: gmock-matchers.h:1000
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition: gmock-matchers.h:810
internal::KeyMatcher< M > Key(M inner_matcher)
Definition: gmock-matchers.h:4322
internal::UnorderedElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > UnorderedElementsAreArray(Iter first, Iter last)
Definition: gmock-matchers.h:3688
const Pointer::element_type * GetRawPointer(const Pointer &p)
Definition: gmock-internal-utils.h:76
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)
Definition: gmock-matchers.h:4107
ComparisonBase(const Rhs &rhs)
Definition: gmock-matchers.h:895
internal::LtMatcher< Rhs > Lt(Rhs x)
Definition: gmock-matchers.h:3784
Definition: gmock-matchers.h:1492
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq(double rhs)
Definition: gmock-matchers.h:3821
FloatingEqMatcher(FloatType expected, bool nan_eq_nan)
Definition: gmock-matchers.h:1896
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:1359
PointeeMatcher(const InnerMatcher &matcher)
Definition: gmock-matchers.h:2045
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2192
StlContainerView< RawContainer > View
Definition: gmock-matchers.h:2803
const T & move(const T &t)
Definition: gtest-port.h:1317
Impl(const Comparator &comparator, const ContainerMatcher &matcher)
Definition: gmock-matchers.h:2636
bool operator()(const A &a, const B &b) const
Definition: gmock-matchers.h:204
std::pair< bool, std::string > expected(bool result, std::string value)
Definition: SettingStringConversionTest.cpp:144
bool operator()(const T &x) const
Definition: gmock-matchers.h:1807
Definition: gtest-message.h:85
void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2118
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2740
KeyMatcherImpl(InnerMatcher inner_matcher)
Definition: gmock-matchers.h:2945
View::const_reference StlContainerReference
Definition: gmock-matchers.h:2525
RawContainer type
Definition: gmock-internal-utils.h:408
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
Definition: gtest-internal.h:823
Definition: gmock-matchers.h:2145
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:2477
BoundSecondMatcher(const Tuple2Matcher &tm, const Second &second)
Definition: gmock-matchers.h:3554
Definition: gmock-matchers.h:184
void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1779
void UniversalPrint(const T &value, ::std::ostream *os)
Definition: gtest-printers.h:852
virtual void DescribeTo(::std::ostream *os) const
Definition: gmock-matchers.h:1453
StlContainer::const_iterator StlContainerConstIterator
Definition: gmock-matchers.h:3353
internal::RefMatcher< T & > Ref(T &x)
Definition: gmock-matchers.h:3809
MatcherAsPredicate(M matcher)
Definition: gmock-matchers.h:1798
static ResultType Invoke(Functor f, T arg)
Definition: gmock-matchers.h:2315
static const char * Desc()
Definition: gmock-matchers.h:1416
Impl(const DistanceMatcher &distance_matcher)
Definition: gmock-matchers.h:2470
internal::EachMatcher< M > Each(M matcher)
Definition: gmock-matchers.h:4314
static const char * Desc()
Definition: gmock-matchers.h:1424
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: gmock-matchers.h:3372
Definition: gmock-matchers.h:2874
internal::NeMatcher< Rhs > Ne(Rhs x)
Definition: gmock-matchers.h:3790
bool is_nan() const
Definition: gtest-internal.h:346
FieldMatcher(FieldType Class::*field, const Matcher< const FieldType &> &matcher)
Definition: gmock-matchers.h:2183
BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition: gmock-matchers.h:1640
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
Definition: gmock-generated-matchers.h:1002