38 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ 39 #define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ 51 #include "gmock/internal/gmock-internal-utils.h" 52 #include "gmock/internal/gmock-port.h" 53 #include "gtest/gtest.h" 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_;
226 template <
typename T>
232 return impl_->MatchAndExplain(x, listener);
242 void DescribeTo(::std::ostream* os)
const { impl_->DescribeTo(os); }
246 impl_->DescribeNegationTo(os);
293 template <
typename T>
320 : internal::MatcherBase<const internal::
string&>(impl) {}
337 : internal::MatcherBase<internal::
string>(impl) {}
347 #if GTEST_HAS_STRING_PIECE_ 353 :
public internal::MatcherBase<const StringPiece&> {
357 explicit Matcher(
const MatcherInterface<const StringPiece&>* impl)
358 : internal::MatcherBase<const StringPiece&>(impl) {}
365 Matcher(
const char* s);
368 Matcher(StringPiece s);
373 :
public internal::MatcherBase<StringPiece> {
377 explicit Matcher(
const MatcherInterface<StringPiece>* impl)
378 : internal::MatcherBase<StringPiece>(impl) {}
385 Matcher(
const char* s);
388 Matcher(StringPiece s);
390 #endif // GTEST_HAS_STRING_PIECE_ 404 template <
class Impl>
415 const Impl&
impl()
const {
return impl_; }
417 template <
typename T>
419 return Matcher<T>(
new MonomorphicImpl<T>(impl_));
423 template <
typename T>
426 explicit MonomorphicImpl(
const Impl&
impl) : impl_(
impl) {}
428 virtual void DescribeTo(::std::ostream* os)
const {
429 impl_.DescribeTo(os);
432 virtual void DescribeNegationTo(::std::ostream* os)
const {
433 impl_.DescribeNegationTo(os);
436 virtual bool MatchAndExplain(T x, MatchResultListener* listener)
const {
437 return impl_.MatchAndExplain(x, listener);
458 template <
typename T>
470 template <
class Impl>
489 template <
typename T,
typename M>
507 polymorphic_matcher_or_value,
520 static Matcher<T> CastImpl(M polymorphic_matcher_or_value,
521 BooleanConstant<true>) {
530 return polymorphic_matcher_or_value;
537 template <
typename T,
typename U>
547 explicit Impl(
const Matcher<U>& source_matcher)
548 : source_matcher_(source_matcher) {}
552 return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
555 virtual void DescribeTo(::std::ostream* os)
const {
556 source_matcher_.DescribeTo(os);
559 virtual void DescribeNegationTo(::std::ostream* os)
const {
560 source_matcher_.DescribeNegationTo(os);
564 const Matcher<U> source_matcher_;
572 template <
typename T>
584 template <
typename T,
typename M>
596 template <
typename T>
601 template <
typename M>
615 template <
typename U>
619 T_must_be_implicitly_convertible_to_U);
624 cannot_convert_non_referentce_arg_to_reference);
632 kTIsOther || kUIsOther ||
633 (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
634 conversion_of_arithmetic_types_must_be_lossless);
635 return MatcherCast<T>(matcher);
639 template <
typename T,
typename M>
645 template <
typename T>
654 ::std::ostream* os) {
655 if (explanation !=
"" && os != NULL) {
656 *os <<
", " << explanation;
666 return (type_name.length() <= 20 ||
667 type_name.find_first_of(
"<(") == string::npos);
675 template <
typename Value,
typename T>
689 const string& type_name = GetTypeName<Value>();
691 *listener->
stream() <<
" (of type " << type_name <<
")";
706 template <
typename MatcherTuple,
typename ValueTuple>
708 const ValueTuple& value_tuple) {
709 using ::std::tr1::get;
711 &&
get<N - 1>(matcher_tuple).
Matches(get<N - 1>(value_tuple));
718 template <
typename MatcherTuple,
typename ValueTuple>
720 const ValueTuple& values,
721 ::std::ostream* os) {
722 using ::std::tr1::tuple_element;
723 using ::std::tr1::get;
730 typename tuple_element<N - 1,
MatcherTuple>::type matcher =
731 get<N - 1>(matchers);
732 typedef typename tuple_element<N - 1, ValueTuple>::type
Value;
733 Value value =
get<N - 1>(values);
735 if (!matcher.MatchAndExplain(value, &listener)) {
738 *os <<
" Expected arg #" << N - 1 <<
": ";
739 get<N - 1>(matchers).DescribeTo(os);
740 *os <<
"\n Actual: ";
757 template <
typename MatcherTuple,
typename ValueTuple>
759 const ValueTuple& ) {
763 template <
typename MatcherTuple,
typename ValueTuple>
774 template <
typename MatcherTuple,
typename ValueTuple>
776 const ValueTuple& value_tuple) {
777 using ::std::tr1::tuple_size;
781 tuple_size<ValueTuple>::value,
782 matcher_and_value_have_different_numbers_of_fields);
784 Matches(matcher_tuple, value_tuple);
789 template <
typename MatcherTuple,
typename ValueTuple>
791 const ValueTuple& values,
792 ::std::ostream* os) {
793 using ::std::tr1::tuple_size;
795 matchers, values, os);
802 template <
typename Tuple,
typename Func,
typename OutIter>
805 typedef typename ::std::tr1::tuple_size<Tuple>
TupleSize;
810 static OutIter
Run(Func f,
const Tuple& t, OutIter out) {
811 return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);
815 template <
typename Tup,
size_t kRemainingSize>
816 struct IterateOverTuple {
817 OutIter operator() (Func f,
const Tup& t, OutIter out)
const {
818 *out++ = f(::std::tr1::get<TupleSize::value - kRemainingSize>(t));
819 return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
822 template <
typename Tup>
823 struct IterateOverTuple<Tup, 0> {
824 OutIter operator() (Func ,
const Tup& , OutIter out)
const {
833 template <
typename Tuple,
typename Func,
typename OutIter>
839 template <
typename T>
844 virtual void DescribeTo(::std::ostream* os)
const { *os <<
"is anything"; }
849 *os <<
"never matches";
859 template <
typename T>
876 #define GMOCK_IMPLEMENT_COMPARISON_MATCHER_( \ 877 name, op, relation, negated_relation) \ 878 template <typename Rhs> class name##Matcher { \ 880 explicit name##Matcher(const Rhs& rhs) : rhs_(rhs) {} \ 881 template <typename Lhs> \ 882 operator Matcher<Lhs>() const { \ 883 return MakeMatcher(new Impl<Lhs>(rhs_)); \ 886 template <typename Lhs> \ 887 class Impl : public MatcherInterface<Lhs> { \ 889 explicit Impl(const Rhs& rhs) : rhs_(rhs) {} \ 890 virtual bool MatchAndExplain(\ 891 Lhs lhs, MatchResultListener* ) const { \ 892 return lhs op rhs_; \ 894 virtual void DescribeTo(::std::ostream* os) const { \ 895 *os << relation " "; \ 896 UniversalPrint(rhs_, os); \ 898 virtual void DescribeNegationTo(::std::ostream* os) const { \ 899 *os << negated_relation " "; \ 900 UniversalPrint(rhs_, os); \ 904 GTEST_DISALLOW_ASSIGN_(Impl); \ 907 GTEST_DISALLOW_ASSIGN_(name##Matcher); \ 919 #undef GMOCK_IMPLEMENT_COMPARISON_MATCHER_ 925 template <
typename Po
inter>
931 void DescribeTo(::std::ostream* os)
const { *os <<
"is NULL"; }
941 template <
typename Po
inter>
947 void DescribeTo(::std::ostream* os)
const { *os <<
"isn't NULL"; }
966 template <
typename T>
969 template <
typename T>
982 template <
typename Super>
993 template <
typename Super>
996 explicit Impl(Super& x) : object_(x) {}
1000 virtual bool MatchAndExplain(
1002 *listener <<
"which is located @" <<
static_cast<const void*
>(&x);
1003 return &x == &object_;
1006 virtual void DescribeTo(::std::ostream* os)
const {
1007 *os <<
"references the variable ";
1011 virtual void DescribeNegationTo(::std::ostream* os)
const {
1012 *os <<
"does not reference the variable ";
1017 const Super& object_;
1033 const wchar_t* rhs) {
1039 template <
typename StringType>
1041 const StringType& s2) {
1048 const typename StringType::value_type nul = 0;
1049 const size_t i1 = s1.find(nul), i2 = s2.find(nul);
1052 if (i1 == StringType::npos || i2 == StringType::npos) {
1063 template <
typename StringType>
1067 bool case_sensitive)
1068 : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}
1075 template <
typename CharType>
1087 template <
typename MatcheeStringType>
1090 const StringType& s2(s);
1091 const bool eq = case_sensitive_ ? s2 == string_ :
1093 return expect_eq_ == eq;
1097 DescribeToHelper(expect_eq_, os);
1101 DescribeToHelper(!expect_eq_, os);
1105 void DescribeToHelper(
bool expect_eq, ::std::ostream* os)
const {
1106 *os << (expect_eq ?
"is " :
"isn't ");
1108 if (!case_sensitive_) {
1109 *os <<
"(ignoring case) ";
1114 const StringType string_;
1115 const bool expect_eq_;
1116 const bool case_sensitive_;
1124 template <
typename StringType>
1128 : substring_(substring) {}
1135 template <
typename CharType>
1144 template <
typename MatcheeStringType>
1147 const StringType& s2(s);
1148 return s2.find(substring_) != StringType::npos;
1153 *os <<
"has substring ";
1158 *os <<
"has no substring ";
1163 const StringType substring_;
1171 template <
typename StringType>
1182 template <
typename CharType>
1191 template <
typename MatcheeStringType>
1194 const StringType& s2(s);
1195 return s2.length() >= prefix_.length() &&
1196 s2.substr(0, prefix_.length()) == prefix_;
1200 *os <<
"starts with ";
1205 *os <<
"doesn't start with ";
1210 const StringType prefix_;
1218 template <
typename StringType>
1228 template <
typename CharType>
1237 template <
typename MatcheeStringType>
1240 const StringType& s2(s);
1241 return s2.length() >= suffix_.length() &&
1242 s2.substr(s2.length() - suffix_.length()) == suffix_;
1246 *os <<
"ends with ";
1251 *os <<
"doesn't end with ";
1256 const StringType suffix_;
1267 : regex_(regex), full_match_(full_match) {}
1274 template <
typename CharType>
1283 template <
class MatcheeStringType>
1292 *os << (full_match_ ?
"matches" :
"contains")
1293 <<
" regular expression ";
1298 *os <<
"doesn't " << (full_match_ ?
"match" :
"contain")
1299 <<
" regular expression ";
1305 const bool full_match_;
1321 #define GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(name, op, relation) \ 1322 class name##2Matcher { \ 1324 template <typename T1, typename T2> \ 1325 operator Matcher< ::std::tr1::tuple<T1, T2> >() const { \ 1326 return MakeMatcher(new Impl< ::std::tr1::tuple<T1, T2> >); \ 1328 template <typename T1, typename T2> \ 1329 operator Matcher<const ::std::tr1::tuple<T1, T2>&>() const { \ 1330 return MakeMatcher(new Impl<const ::std::tr1::tuple<T1, T2>&>); \ 1333 template <typename Tuple> \ 1334 class Impl : public MatcherInterface<Tuple> { \ 1336 virtual bool MatchAndExplain( \ 1338 MatchResultListener* ) const { \ 1339 return ::std::tr1::get<0>(args) op ::std::tr1::get<1>(args); \ 1341 virtual void DescribeTo(::std::ostream* os) const { \ 1342 *os << "are " relation; \ 1344 virtual void DescribeNegationTo(::std::ostream* os) const { \ 1345 *os << "aren't " relation; \ 1353 Ge, >=,
"a pair where the first >= the second");
1355 Gt, >,
"a pair where the first > the second");
1357 Le, <=,
"a pair where the first <= the second");
1359 Lt, <,
"a pair where the first < the second");
1362 #undef GMOCK_IMPLEMENT_COMPARISON2_MATCHER_ 1368 template <
typename T>
1372 : matcher_(matcher) {}
1375 return !matcher_.MatchAndExplain(x, listener);
1379 matcher_.DescribeNegationTo(os);
1383 matcher_.DescribeTo(os);
1394 template <
typename InnerMatcher>
1401 template <
typename T>
1407 InnerMatcher matcher_;
1416 template <
typename T>
1420 : matcher1_(matcher1), matcher2_(matcher2) {}
1424 matcher1_.DescribeTo(os);
1426 matcher2_.DescribeTo(os);
1432 matcher1_.DescribeNegationTo(os);
1434 matcher2_.DescribeNegationTo(os);
1442 if (!matcher1_.MatchAndExplain(x, &listener1)) {
1443 *listener << listener1.
str();
1448 if (!matcher2_.MatchAndExplain(x, &listener2)) {
1449 *listener << listener2.
str();
1462 *listener <<
", and " << s2;
1475 #if GTEST_LANG_CXX11 1483 template <
int kSize,
typename Head,
typename... Tail>
1484 struct MatcherList {
1485 typedef MatcherList<kSize - 1, Tail...> MatcherListTail;
1486 typedef ::std::pair<Head, typename MatcherListTail::ListType> ListType;
1492 static ListType BuildList(
const Head& matcher,
const Tail&... tail) {
1493 return ListType(matcher, MatcherListTail::BuildList(tail...));
1500 template <
typename T,
template <
typename >
class CombiningMatcher>
1501 static Matcher<T> CreateMatcher(const ListType& matchers) {
1502 return Matcher<T>(
new CombiningMatcher<T>(
1503 SafeMatcherCast<T>(matchers.first),
1504 MatcherListTail::template CreateMatcher<T, CombiningMatcher>(
1511 template <
typename Matcher1,
typename Matcher2>
1512 struct MatcherList<2, Matcher1, Matcher2> {
1513 typedef ::std::pair<Matcher1, Matcher2> ListType;
1515 static ListType BuildList(
const Matcher1& matcher1,
1516 const Matcher2& matcher2) {
1517 return ::std::pair<Matcher1, Matcher2>(matcher1, matcher2);
1520 template <
typename T,
template <
typename >
class CombiningMatcher>
1521 static Matcher<T> CreateMatcher(const ListType& matchers) {
1522 return Matcher<T>(
new CombiningMatcher<T>(
1523 SafeMatcherCast<T>(matchers.first),
1524 SafeMatcherCast<T>(matchers.second)));
1532 template <
template <
typename T>
class CombiningMatcher,
typename...
Args>
1533 class VariadicMatcher {
1535 VariadicMatcher(
const Args&... matchers)
1536 : matchers_(MatcherListType::BuildList(matchers...)) {}
1541 template <
typename T>
1542 operator Matcher<T>()
const {
1543 return MatcherListType::template CreateMatcher<T, CombiningMatcher>(
1548 typedef MatcherList<
sizeof...(Args),
Args...> MatcherListType;
1550 const typename MatcherListType::ListType matchers_;
1555 template <
typename...
Args>
1556 using AllOfMatcher = VariadicMatcher<BothOfMatcherImpl,
Args...>;
1558 #endif // GTEST_LANG_CXX11 1562 template <
typename Matcher1,
typename Matcher2>
1566 : matcher1_(matcher1), matcher2_(matcher2) {}
1571 template <
typename T>
1574 SafeMatcherCast<T>(matcher2_)));
1588 template <
typename T>
1592 : matcher1_(matcher1), matcher2_(matcher2) {}
1596 matcher1_.DescribeTo(os);
1598 matcher2_.DescribeTo(os);
1604 matcher1_.DescribeNegationTo(os);
1606 matcher2_.DescribeNegationTo(os);
1614 if (matcher1_.MatchAndExplain(x, &listener1)) {
1615 *listener << listener1.
str();
1620 if (matcher2_.MatchAndExplain(x, &listener2)) {
1621 *listener << listener2.
str();
1634 *listener <<
", and " << s2;
1647 #if GTEST_LANG_CXX11 1649 template <
typename...
Args>
1650 using AnyOfMatcher = VariadicMatcher<EitherOfMatcherImpl,
Args...>;
1652 #endif // GTEST_LANG_CXX11 1657 template <
typename Matcher1,
typename Matcher2>
1661 : matcher1_(matcher1), matcher2_(matcher2) {}
1666 template <
typename T>
1669 SafeMatcherCast<T>(matcher1_), SafeMatcherCast<T>(matcher2_)));
1681 template <
typename Predicate>
1690 template <
typename T>
1705 *os <<
"satisfies the given predicate";
1709 *os <<
"doesn't satisfy the given predicate";
1713 Predicate predicate_;
1720 template <
typename M>
1731 template <
typename T>
1747 return MatcherCast<const T&>(matcher_).
Matches(x);
1758 template <
typename M>
1766 template <
typename T>
1784 ::std::stringstream ss;
1785 ss <<
"Value of: " << value_text <<
"\n" 1788 ss <<
"\n Actual: " << listener.str();
1801 template <
typename M>
1802 inline PredicateFormatterFromMatcher<M>
1811 template <
typename FloatType>
1821 rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {
1828 rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) {
1830 <<
", where max_abs_error is" << max_abs_error;
1834 template <
typename T>
1837 Impl(FloatType rhs,
bool nan_eq_nan, FloatType max_abs_error) :
1838 rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) {}
1845 if (lhs.is_nan() || rhs.
is_nan()) {
1846 if (lhs.is_nan() && rhs.
is_nan()) {
1852 if (HasMaxAbsError()) {
1857 return value == rhs_ || fabs(value - rhs_) <= max_abs_error_;
1859 return lhs.AlmostEquals(rhs);
1867 const ::std::streamsize old_precision = os->precision(
1868 ::std::numeric_limits<FloatType>::digits10 + 2);
1873 *os <<
"never matches";
1876 *os <<
"is approximately " << rhs_;
1877 if (HasMaxAbsError()) {
1878 *os <<
" (absolute error <= " << max_abs_error_ <<
")";
1881 os->precision(old_precision);
1886 const ::std::streamsize old_precision = os->precision(
1887 ::std::numeric_limits<FloatType>::digits10 + 2);
1892 *os <<
"is anything";
1895 *os <<
"isn't approximately " << rhs_;
1896 if (HasMaxAbsError()) {
1897 *os <<
" (absolute error > " << max_abs_error_ <<
")";
1901 os->precision(old_precision);
1905 bool HasMaxAbsError()
const {
1906 return max_abs_error_ >= 0;
1909 const FloatType rhs_;
1910 const bool nan_eq_nan_;
1912 const FloatType max_abs_error_;
1914 GTEST_DISALLOW_ASSIGN_(
Impl);
1937 const FloatType rhs_;
1938 const bool nan_eq_nan_;
1940 const FloatType max_abs_error_;
1947 template <
typename InnerMatcher>
1960 template <
typename Po
inter>
1967 template <
typename Po
inter>
1973 explicit Impl(
const InnerMatcher& matcher)
1976 virtual void DescribeTo(::std::ostream* os)
const {
1977 *os <<
"points to a value that ";
1978 matcher_.DescribeTo(os);
1981 virtual void DescribeNegationTo(::std::ostream* os)
const {
1982 *os <<
"does not point to a value that ";
1983 matcher_.DescribeTo(os);
1986 virtual bool MatchAndExplain(Pointer pointer,
1987 MatchResultListener* listener)
const {
1991 *listener <<
"which points to ";
1996 const Matcher<const Pointee&> matcher_;
2001 const InnerMatcher matcher_;
2008 template <
typename Class,
typename FieldType>
2013 : field_(field), matcher_(matcher) {}
2016 *os <<
"is an object whose given field ";
2021 *os <<
"is an object whose given field ";
2025 template <
typename T>
2027 return MatchAndExplainImpl(
2028 typename ::testing::internal::
2037 bool MatchAndExplainImpl(
false_type ,
const Class& obj,
2039 *listener <<
"whose given field is ";
2043 bool MatchAndExplainImpl(
true_type ,
const Class* p,
2048 *listener <<
"which points to an object ";
2052 return MatchAndExplainImpl(
false_type(), *p, listener);
2055 const FieldType Class::*field_;
2056 const Matcher<const FieldType&> matcher_;
2063 template <
typename Class,
typename PropertyType>
2074 : property_(property), matcher_(matcher) {}
2077 *os <<
"is an object whose given property ";
2082 *os <<
"is an object whose given property ";
2086 template <
typename T>
2088 return MatchAndExplainImpl(
2089 typename ::testing::internal::
2098 bool MatchAndExplainImpl(
false_type ,
const Class& obj,
2100 *listener <<
"whose given property is ";
2103 RefToConstProperty result = (obj.*property_)();
2107 bool MatchAndExplainImpl(
true_type ,
const Class* p,
2112 *listener <<
"which points to an object ";
2116 return MatchAndExplainImpl(
false_type(), *p, listener);
2119 PropertyType (Class::*property_)()
const;
2120 const Matcher<RefToConstProperty> matcher_;
2129 template <
typename Functor>
2135 template <
typename T>
2140 template <
typename ArgType,
typename ResType>
2143 typedef ResType(*StorageType)(ArgType);
2147 <<
"NULL function pointer is passed into ResultOf().";
2149 template <
typename T>
2150 static ResType
Invoke(ResType(*f)(ArgType), T arg) {
2157 template <
typename Callable>
2163 : callable_(callable), matcher_(matcher) {
2167 template <
typename T>
2169 return Matcher<T>(
new Impl<T>(callable_, matcher_));
2175 template <
typename T>
2179 : callable_(callable), matcher_(matcher) {}
2181 virtual void DescribeTo(::std::ostream* os)
const {
2182 *os <<
"is mapped by the given callable to a value that ";
2183 matcher_.DescribeTo(os);
2186 virtual void DescribeNegationTo(::std::ostream* os)
const {
2187 *os <<
"is mapped by the given callable to a value that ";
2188 matcher_.DescribeNegationTo(os);
2191 virtual bool MatchAndExplain(T obj, MatchResultListener* listener)
const {
2192 *listener <<
"which is mapped by the given callable to ";
2196 CallableTraits<Callable>::template Invoke<T>(callable_, obj);
2206 mutable CallableStorageType callable_;
2207 const Matcher<ResultType> matcher_;
2212 const CallableStorageType callable_;
2213 const Matcher<ResultType> matcher_;
2219 template <
typename SizeMatcher>
2223 : size_matcher_(size_matcher) {
2226 template <
typename Container>
2231 template <
typename Container>
2236 typedef typename ContainerView::type::size_type
SizeType;
2237 explicit Impl(
const SizeMatcher& size_matcher)
2253 const bool result = size_matcher_.
MatchAndExplain(size, &size_listener);
2255 <<
"whose size " << size << (result ?
" matches" :
" doesn't match");
2262 GTEST_DISALLOW_ASSIGN_(
Impl);
2266 const SizeMatcher size_matcher_;
2280 template <
typename Container>
2301 *os <<
"does not equal ";
2305 template <
typename LhsContainer>
2312 typedef typename LhsView::type LhsStlContainer;
2314 if (lhs_stl_container == rhs_)
2317 ::std::ostream*
const os = listener->
stream();
2320 bool printed_header =
false;
2321 for (
typename LhsStlContainer::const_iterator it =
2322 lhs_stl_container.begin();
2323 it != lhs_stl_container.end(); ++it) {
2326 if (printed_header) {
2329 *os <<
"which has these unexpected elements: ";
2330 printed_header =
true;
2337 bool printed_header2 =
false;
2338 for (
typename StlContainer::const_iterator it = rhs_.begin();
2339 it != rhs_.end(); ++it) {
2341 lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==
2342 lhs_stl_container.end()) {
2343 if (printed_header2) {
2346 *os << (printed_header ?
",\nand" :
"which")
2347 <<
" doesn't have these expected elements: ";
2348 printed_header2 =
true;
2366 template <
typename T,
typename U>
2367 bool operator()(
const T& lhs,
const U& rhs)
const {
return lhs < rhs; }
2371 template <
typename Comparator,
typename ContainerMatcher>
2375 const ContainerMatcher& matcher)
2376 : comparator_(comparator), matcher_(matcher) {}
2378 template <
typename LhsContainer>
2383 template <
typename LhsContainer>
2395 Impl(
const Comparator& comparator,
const ContainerMatcher& matcher)
2396 : comparator_(comparator), matcher_(matcher) {}
2399 *os <<
"(when sorted) ";
2404 *os <<
"(when sorted) ";
2411 ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
2412 lhs_stl_container.end());
2414 sorted_container.begin(), sorted_container.end(), comparator_);
2419 return matcher_.
Matches(sorted_container);
2422 *listener <<
"which is ";
2424 *listener <<
" when sorted";
2434 const Comparator comparator_;
2437 GTEST_DISALLOW_COPY_AND_ASSIGN_(
Impl);
2441 const Comparator comparator_;
2442 const ContainerMatcher matcher_;
2451 template <
typename TupleMatcher,
typename RhsContainer>
2461 : tuple_matcher_(tuple_matcher), rhs_(
RhsView::Copy(rhs)) {
2468 template <
typename LhsContainer>
2473 template <
typename LhsContainer>
2493 *os <<
"contains " << rhs_.size()
2494 <<
" values, where each value and its corresponding value in ";
2497 mono_tuple_matcher_.DescribeTo(os);
2500 *os <<
"doesn't contain exactly " << rhs_.size()
2501 <<
" values, or contains a value x at some index i" 2502 <<
" where x and the i-th value of ";
2505 mono_tuple_matcher_.DescribeNegationTo(os);
2511 const size_t actual_size = lhs_stl_container.size();
2512 if (actual_size != rhs_.size()) {
2513 *listener <<
"which contains " << actual_size <<
" values";
2517 typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
2518 typename RhsStlContainer::const_iterator right = rhs_.begin();
2519 for (
size_t i = 0; i != actual_size; ++i, ++left, ++right) {
2524 if (!mono_tuple_matcher_.MatchAndExplain(
2525 value_pair, &inner_listener)) {
2526 *listener <<
"where the value pair (";
2530 *listener <<
") at index #" << i <<
" don't match";
2535 if (!mono_tuple_matcher_.Matches(value_pair))
2547 GTEST_DISALLOW_ASSIGN_(
Impl);
2551 const TupleMatcher tuple_matcher_;
2558 template <
typename Container>
2565 typedef typename StlContainer::value_type
Element;
2567 template <
typename InnerMatcher>
2576 Container container,
2580 for (
typename StlContainer::const_iterator it = stl_container.begin();
2581 it != stl_container.end(); ++it, ++i) {
2585 if (matches != all_elements_should_match) {
2586 *listener <<
"whose element #" << i
2587 << (matches ?
" matches" :
" doesn't match");
2589 return !all_elements_should_match;
2592 return all_elements_should_match;
2603 template <
typename Container>
2606 template <
typename InnerMatcher>
2612 *os <<
"contains at least one element that ";
2617 *os <<
"doesn't contain any element that ";
2632 template <
typename Container>
2635 template <
typename InnerMatcher>
2641 *os <<
"only contains elements that ";
2646 *os <<
"contains some element that ";
2660 template <
typename M>
2665 template <
typename Container>
2671 const M inner_matcher_;
2677 template <
typename M>
2682 template <
typename Container>
2688 const M inner_matcher_;
2697 template <
typename PairType>
2703 template <
typename InnerMatcher>
2716 if (explanation !=
"") {
2717 *listener <<
"whose first field is a value " << explanation;
2724 *os <<
"has a key that ";
2730 *os <<
"doesn't have a key that ";
2741 template <
typename M>
2746 template <
typename PairType>
2752 const M matcher_for_key_;
2759 template <
typename PairType>
2766 template <
typename FirstMatcher,
typename SecondMatcher>
2776 *os <<
"has a first field that ";
2778 *os <<
", and has a second field that ";
2784 *os <<
"has a first field that ";
2786 *os <<
", or has a second field that ";
2797 return first_matcher_.
Matches(a_pair.first) &&
2798 second_matcher_.
Matches(a_pair.second);
2802 &first_inner_listener)) {
2803 *listener <<
"whose first field does not match";
2809 &second_inner_listener)) {
2810 *listener <<
"whose second field does not match";
2814 ExplainSuccess(first_inner_listener.
str(), second_inner_listener.
str(),
2823 *listener <<
"whose both fields match";
2824 if (first_explanation !=
"") {
2825 *listener <<
", where the first field is a value " << first_explanation;
2827 if (second_explanation !=
"") {
2829 if (first_explanation !=
"") {
2830 *listener <<
"and ";
2832 *listener <<
"where ";
2834 *listener <<
"the second field is a value " << second_explanation;
2838 const Matcher<const FirstType&> first_matcher_;
2839 const Matcher<const SecondType&> second_matcher_;
2845 template <
typename FirstMatcher,
typename SecondMatcher>
2849 : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
2851 template <
typename PairType>
2855 first_matcher_, second_matcher_));
2859 const FirstMatcher first_matcher_;
2860 const SecondMatcher second_matcher_;
2866 template <
typename Container>
2873 typedef typename StlContainer::value_type
Element;
2877 template <
typename InputIter>
2879 while (first != last) {
2880 matchers_.push_back(MatcherCast<const Element&>(*first++));
2888 }
else if (count() == 1) {
2889 *os <<
"has 1 element that ";
2890 matchers_[0].DescribeTo(os);
2892 *os <<
"has " << Elements(count()) <<
" where\n";
2893 for (
size_t i = 0; i != count(); ++i) {
2894 *os <<
"element #" << i <<
" ";
2895 matchers_[i].DescribeTo(os);
2896 if (i + 1 < count()) {
2906 *os <<
"isn't empty";
2910 *os <<
"doesn't have " << Elements(count()) <<
", or\n";
2911 for (
size_t i = 0; i != count(); ++i) {
2912 *os <<
"element #" << i <<
" ";
2913 matchers_[i].DescribeNegationTo(os);
2914 if (i + 1 < count()) {
2925 const bool listener_interested = listener->
IsInterested();
2928 ::std::vector<internal::string> explanations(count());
2930 typename StlContainer::const_iterator it = stl_container.begin();
2931 size_t exam_pos = 0;
2932 bool mismatch_found =
false;
2937 for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_pos) {
2939 if (listener_interested) {
2941 match = matchers_[exam_pos].MatchAndExplain(*it, &s);
2942 explanations[exam_pos] = s.
str();
2944 match = matchers_[exam_pos].Matches(*it);
2948 mismatch_found =
true;
2957 size_t actual_count = exam_pos;
2958 for (; it != stl_container.end(); ++it) {
2962 if (actual_count != count()) {
2967 if (listener_interested && (actual_count != 0)) {
2968 *listener <<
"which has " << Elements(actual_count);
2973 if (mismatch_found) {
2975 if (listener_interested) {
2976 *listener <<
"whose element #" << exam_pos <<
" doesn't match";
2984 if (listener_interested) {
2985 bool reason_printed =
false;
2986 for (
size_t i = 0; i != count(); ++i) {
2989 if (reason_printed) {
2990 *listener <<
",\nand ";
2992 *listener <<
"whose element #" << i <<
" matches, " << s;
2993 reason_printed =
true;
3001 static Message Elements(
size_t count) {
3002 return Message() << count << (count == 1 ?
" element" :
" elements");
3005 size_t count()
const {
return matchers_.size(); }
3007 ::std::vector<Matcher<const Element&> > matchers_;
3019 : num_elements_(num_elements),
3020 num_matchers_(num_matchers),
3021 matched_(num_elements_* num_matchers_, 0) {
3027 return matched_[SpaceIndex(ilhs, irhs)] == 1;
3030 matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0;
3040 string DebugString()
const;
3043 size_t SpaceIndex(
size_t ilhs,
size_t irhs)
const {
3044 return ilhs * num_matchers_ + irhs;
3047 size_t num_elements_;
3048 size_t num_matchers_;
3053 ::std::vector<char> matched_;
3078 void DescribeToImpl(::std::ostream* os)
const;
3081 void DescribeNegationToImpl(::std::ostream* os)
const;
3083 bool VerifyAllElementsAndMatchersAreMatched(
3084 const ::std::vector<string>& element_printouts,
3089 return matcher_describers_;
3093 return Message() << n <<
" element" << (n == 1 ?
"" :
"s");
3097 MatcherDescriberVec matcher_describers_;
3103 template <
typename Container>
3113 typedef typename StlContainer::value_type
Element;
3117 template <
typename InputIter>
3119 for (; first != last; ++first) {
3120 matchers_.push_back(MatcherCast<const Element&>(*first));
3138 ::std::vector<string> element_printouts;
3139 MatchMatrix matrix = AnalyzeElements(stl_container.begin(),
3140 stl_container.end(),
3144 const size_t actual_count = matrix.
LhsSize();
3145 if (actual_count == 0 && matchers_.empty()) {
3148 if (actual_count != matchers_.size()) {
3154 *listener <<
"which has " <<
Elements(actual_count);
3160 matrix, listener) &&
3165 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
3167 template <
typename ElementIter>
3168 MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last,
3169 ::std::vector<string>* element_printouts,
3171 element_printouts->clear();
3172 ::std::vector<char> did_match;
3173 size_t num_elements = 0;
3174 for (; elem_first != elem_last; ++num_elements, ++elem_first) {
3178 for (
size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
3179 did_match.push_back(
Matches(matchers_[irhs])(*elem_first));
3183 MatchMatrix matrix(num_elements, matchers_.size());
3184 ::std::vector<char>::const_iterator did_match_iter = did_match.begin();
3185 for (
size_t ilhs = 0; ilhs != num_elements; ++ilhs) {
3186 for (
size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
3187 matrix.SetEdge(ilhs, irhs, *did_match_iter++ != 0);
3193 MatcherVec matchers_;
3200 template <
typename Target>
3202 template <
typename Arg>
3204 return MatcherCast<Target>(a);
3209 template <
typename MatcherTuple>
3213 : matchers_(args) {}
3215 template <
typename Container>
3219 typedef typename View::value_type Element;
3220 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
3221 MatcherVec matchers;
3224 ::std::back_inserter(matchers));
3226 matchers.begin(), matchers.end()));
3235 template <
typename MatcherTuple>
3240 template <
typename Container>
3244 typedef typename View::value_type Element;
3245 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
3246 MatcherVec matchers;
3249 ::std::back_inserter(matchers));
3251 matchers.begin(), matchers.end()));
3260 template <
typename T>
3265 template <
typename Iter>
3267 : matchers_(first, last) {}
3269 template <
typename Container>
3277 ::std::vector<T> matchers_;
3283 template <
typename T>
3286 template <
typename Iter>
3289 template <
typename Container>
3292 matchers_.begin(), matchers_.end()));
3296 const ::std::vector<T> matchers_;
3307 const char* matcher_name,
3308 const Strings& param_values);
3327 template <
typename Iter>
3328 inline internal::ElementsAreArrayMatcher<
3329 typename ::std::iterator_traits<Iter>::value_type>
3331 typedef typename ::std::iterator_traits<Iter>::value_type T;
3335 template <
typename T>
3337 const T* pointer,
size_t count) {
3341 template <
typename T,
size_t N>
3343 const T (&array)[N]) {
3347 template <
typename T,
typename A>
3349 const ::std::vector<T, A>& vec) {
3353 #if GTEST_LANG_CXX11 3354 template <
typename T>
3355 inline internal::ElementsAreArrayMatcher<T>
3369 template <
typename Iter>
3370 inline internal::UnorderedElementsAreArrayMatcher<
3371 typename ::std::iterator_traits<Iter>::value_type>
3373 typedef typename ::std::iterator_traits<Iter>::value_type T;
3377 template <
typename T>
3378 inline internal::UnorderedElementsAreArrayMatcher<T>
3383 template <
typename T,
size_t N>
3384 inline internal::UnorderedElementsAreArrayMatcher<T>
3389 template <
typename T,
typename A>
3390 inline internal::UnorderedElementsAreArrayMatcher<T>
3395 #if GTEST_LANG_CXX11 3396 template <
typename T>
3397 inline internal::UnorderedElementsAreArrayMatcher<T>
3414 template <
typename T>
3418 template <
typename T>
3424 template <
typename T>
3425 inline internal::EqMatcher<T>
Eq(T x) {
return internal::EqMatcher<T>(x); }
3429 template <
typename T>
3444 template <
typename Lhs,
typename Rhs>
3448 template <
typename Rhs>
3449 inline internal::GeMatcher<Rhs>
Ge(Rhs x) {
3450 return internal::GeMatcher<Rhs>(x);
3454 template <
typename Rhs>
3455 inline internal::GtMatcher<Rhs>
Gt(Rhs x) {
3456 return internal::GtMatcher<Rhs>(x);
3460 template <
typename Rhs>
3461 inline internal::LeMatcher<Rhs>
Le(Rhs x) {
3462 return internal::LeMatcher<Rhs>(x);
3466 template <
typename Rhs>
3467 inline internal::LtMatcher<Rhs>
Lt(Rhs x) {
3468 return internal::LtMatcher<Rhs>(x);
3472 template <
typename Rhs>
3473 inline internal::NeMatcher<Rhs>
Ne(Rhs x) {
3474 return internal::NeMatcher<Rhs>(x);
3491 template <
typename T>
3512 double rhs,
double max_abs_error) {
3520 double rhs,
double max_abs_error) {
3540 float rhs,
float max_abs_error) {
3548 float rhs,
float max_abs_error) {
3554 template <
typename InnerMatcher>
3556 const InnerMatcher& inner_matcher) {
3564 template <
typename Class,
typename FieldType,
typename FieldMatcher>
3565 inline PolymorphicMatcher<
3567 FieldType Class::*field,
const FieldMatcher& matcher) {
3570 field, MatcherCast<const FieldType&>(matcher)));
3581 template <
typename Class,
typename PropertyType,
typename PropertyMatcher>
3582 inline PolymorphicMatcher<
3584 PropertyType (Class::*property)()
const,
const PropertyMatcher& matcher) {
3608 template <
typename Callable,
typename ResultOfMatcher>
3610 Callable callable,
const ResultOfMatcher& matcher) {
3613 MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
3624 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3631 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3638 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3645 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
3648 str,
false,
false));
3653 inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::string> >
3660 inline PolymorphicMatcher<internal::StartsWithMatcher<internal::string> >
3667 inline PolymorphicMatcher<internal::EndsWithMatcher<internal::string> >
3695 #if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING 3699 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
3706 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
3713 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
3720 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
3723 str,
false,
false));
3728 inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::wstring> >
3735 inline PolymorphicMatcher<internal::StartsWithMatcher<internal::wstring> >
3742 inline PolymorphicMatcher<internal::EndsWithMatcher<internal::wstring> >
3748 #endif // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING 3752 inline internal::Eq2Matcher
Eq() {
return internal::Eq2Matcher(); }
3756 inline internal::Ge2Matcher
Ge() {
return internal::Ge2Matcher(); }
3760 inline internal::Gt2Matcher
Gt() {
return internal::Gt2Matcher(); }
3764 inline internal::Le2Matcher
Le() {
return internal::Le2Matcher(); }
3768 inline internal::Lt2Matcher
Lt() {
return internal::Lt2Matcher(); }
3772 inline internal::Ne2Matcher
Ne() {
return internal::Ne2Matcher(); }
3776 template <
typename InnerMatcher>
3784 template <
typename Predicate>
3785 inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> >
3796 template <
typename SizeMatcher>
3797 inline internal::SizeIsMatcher<SizeMatcher>
3806 template <
typename Container>
3807 inline PolymorphicMatcher<internal::ContainerEqMatcher<
3819 template <
typename Comparator,
typename ContainerMatcher>
3820 inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher>
3822 const ContainerMatcher& container_matcher) {
3824 comparator, container_matcher);
3829 template <
typename ContainerMatcher>
3830 inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>
3843 template <
typename TupleMatcher,
typename Container>
3844 inline internal::PointwiseMatcher<TupleMatcher,
3846 Pointwise(
const TupleMatcher& tuple_matcher,
const Container& rhs) {
3851 tuple_matcher, rhs);
3872 template <
typename M>
3904 template <
typename M>
3912 template <
typename M>
3922 template <
typename FirstMatcher,
typename SecondMatcher>
3923 inline internal::PairMatcher<FirstMatcher, SecondMatcher>
3924 Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
3926 first_matcher, second_matcher);
3931 template <
typename M>
3937 template <
typename T,
typename M>
3938 inline bool Value(
const T& value, M matcher) {
3944 template <
typename T,
typename M>
3947 return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
3950 #if GTEST_LANG_CXX11 3953 template <
typename...
Args>
3954 inline internal::AllOfMatcher<
Args...>
AllOf(
const Args&... matchers) {
3955 return internal::AllOfMatcher<
Args...>(matchers...);
3958 template <
typename...
Args>
3959 inline internal::AnyOfMatcher<
Args...>
AnyOf(
const Args&... matchers) {
3960 return internal::AnyOfMatcher<
Args...>(matchers...);
3963 #endif // GTEST_LANG_CXX11 3972 template <
typename InnerMatcher>
3973 inline InnerMatcher
AllArgs(
const InnerMatcher& matcher) {
return matcher; }
3979 #define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\ 3980 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value) 3981 #define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\ 3982 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value) 3986 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ LhsView::const_reference LhsStlContainerReference
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2389
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2384
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3478
Matcher()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:299
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2611
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3016
View::type StlContainer
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2284
internal::GtMatcher< Rhs > Gt(Rhs x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3455
typedef GTEST_REFERENCE_TO_CONST_(PropertyType) RefToConstProperty
Matcher()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:334
virtual void DescribeTo(::std::ostream *os) const =0
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3210
StartsWithMatcher(const StringType &prefix)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1174
StrEqualityMatcher(const StringType &str, bool expect_eq, bool case_sensitive)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1066
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2076
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1199
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2760
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:840
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:845
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3675
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const =0
static bool FullMatch(const ::std::string &str, const RE &re)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:954
static Matcher< T > Cast(M polymorphic_matcher_or_value)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:492
internal::NeMatcher< Rhs > Ne(Rhs x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3473
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:242
Definition: dsd/test/gmock/include/gmock/gmock-actions.h:49
#define GTEST_REMOVE_REFERENCE_(T)
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:712
Matcher< T > An()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3419
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2640
PolymorphicMatcher< internal::NotNullMatcher > NotNull()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3485
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1812
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2621
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1602
internal::StlContainerView< RhsContainer > RhsView
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2454
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2742
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3126
EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1660
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith(const internal::string &prefix)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3661
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:80
bool MatchAndExplain(const LhsContainer &lhs, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2306
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1835
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1245
virtual bool MatchAndExplain(T value, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1840
static void CheckIsValid(Functor)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2134
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2130
MatchResultListener(::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:85
BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1565
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3070
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:597
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1136
internal::ElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > ElementsAreArray(Iter first, Iter last)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3330
virtual bool MatchAndExplain(T, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:842
internal::EqMatcher< T > Eq(T x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3425
size_t RhsSize() const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3025
::std::string string
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:872
::std::tr1::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2485
::std::string PrintToString(const T &value)
Definition: dsd/test/gtest/include/gtest/gtest-printers.h:847
LhsView::type LhsStlContainer
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2478
static Matcher< T > Cast(const Matcher< U > &source_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:540
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2477
::std::ostream * stream()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:98
internal::StlContainerView< RawContainer > View
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2870
bool MatchAndExplain(T &x, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1691
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1064
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2559
static void Print(const T &value, ::std::ostream *os)
Definition: dsd/test/gtest/include/gtest/gtest-printers.h:591
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1610
internal::SizeIsMatcher< SizeMatcher > SizeIs(const SizeMatcher &size_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3798
static const_reference ConstReference(const RawContainer &container)
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:398
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1297
RawPairType::second_type SecondType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2764
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2087
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2220
Functor StorageType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2132
ElementsAreArrayMatcher(Iter first, Iter last)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3287
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:480
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2249
GTEST_API_ bool FindPairing(const MatchMatrix &matrix, MatchResultListener *listener)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2064
GTEST_API_ AssertionResult AssertionFailure()
StlContainer::value_type Element
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3113
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2015
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1621
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3131
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:947
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex(const internal::RE *regex)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3686
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1100
static Matcher< T > Cast(const Matcher< U > &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:616
bool MatchAndExplain(const T &value, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2026
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3104
internal::KeyMatcher< M > Key(M inner_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3913
const MatcherDescriberInterface * GetDescriber() const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:258
#define GTEST_API_
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:768
EndsWithMatcher(const StringType &suffix)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1221
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3284
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:939
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1145
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:63
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:493
Definition: dsd/test/gtest/include/gtest/internal/gtest-tuple.h:111
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3236
InnerMatcher AllArgs(const InnerMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3973
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2387
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1395
NotMatcherImpl(const Matcher< T > &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1371
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:676
EachMatcherImpl(InnerMatcher inner_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2636
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:948
bool HasEdge(size_t ilhs, size_t irhs) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3026
internal::PointwiseMatcher< TupleMatcher, GTEST_REMOVE_CONST_(Container)> Pointwise(const TupleMatcher &tuple_matcher, const Container &rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3846
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq(double rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3504
QuantifierMatcherImpl(InnerMatcher inner_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2568
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-generated-matchers.h:492
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:775
GTEST_API_ AssertionResult AssertionSuccess()
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith(const internal::string &suffix)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3668
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1430
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2300
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2281
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2372
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3809
static bool PartialMatch(const ::std::string &str, const RE &re)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:957
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2885
MatcherBase()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:263
virtual bool MatchAndExplain(LhsContainer lhs, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2508
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1284
static Matcher< T > Cast(M polymorphic_matcher_or_value)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:602
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:393
size_t LhsSize() const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3024
View::const_reference StlContainerReference
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2285
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1275
Definition: dsd/test/gtest/include/gtest/gtest-message.h:85
bool is_nan() const
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:316
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
Definition: dsd/test/gmock/include/gmock/gmock-generated-matchers.h:1013
internal::RefMatcher< T & > Ref(T &x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3492
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:701
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2729
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1374
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:294
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1219
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3625
bool VerifyAllElementsAndMatchersAreMatched(const ::std::vector< string > &element_printouts, const MatchMatrix &matrix, MatchResultListener *listener) const
bool_constant< true > true_type
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1618
virtual bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1438
View::type StlContainer
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2871
::std::vector< ElementMatcherPair > ElementMatcherPairs
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3057
Impl(const SizeMatcher &size_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2237
virtual ~MatcherDescriberInterface()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:119
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2009
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2365
PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2848
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1422
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1125
internal::LtMatcher< Rhs > Lt(Rhs x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3467
StreamMatchResultListener(::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:216
ElementsAreMatcher(const MatcherTuple &args)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3238
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1369
virtual bool MatchAndExplain(PairType key_value, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2710
MatcherBase(const MatcherInterface< T > *impl)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:266
internal::FloatingEqMatcher< double > DoubleNear(double rhs, double max_abs_error)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3511
bool MatchAndExplain(T x, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:231
FloatingEqMatcher(FloatType rhs, bool nan_eq_nan)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1820
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1238
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1594
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3498
NotMatcher(InnerMatcher matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1397
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1382
Matcher(const MatcherInterface< T > *impl)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:302
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1229
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2633
KeyMatcher(M m)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2744
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2403
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1721
bool operator()(const T &lhs, const U &rhs) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2367
View::type StlContainer
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2563
MatchMatrix(size_t num_elements, size_t num_matchers)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3018
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2846
internal::LeMatcher< Rhs > Le(Rhs x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3461
MatchesRegexMatcher(const RE *regex, bool full_match)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1266
RawPairType::first_type FirstType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2763
Definition: dsd/test/gtest/include/gtest/internal/gtest-linked_ptr.h:136
PolymorphicMatcher< Impl > MakePolymorphicMatcher(const Impl &impl)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:471
TrulyMatcher(Predicate pred)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1684
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2783
void DescribeNegationToImpl(::std::ostream *os) const
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe(const internal::string &str)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3646
StlContainer::const_iterator StlContainerConstIterator
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3112
BothOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1419
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3135
static void ExplainMatchFailuresTo(const MatcherTuple &, const ValueTuple &, ::std::ostream *)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:764
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2020
::std::wstring wstring
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:878
FieldMatcher(FieldType Class::*field, const Matcher< const FieldType &> &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2011
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:134
MatcherDescriberVec & matcher_describers()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3088
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:967
PolymorphicMatcher(const Impl &an_impl)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:407
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:227
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1948
MatchResultListener & operator<<(const T &x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:91
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2492
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:203
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:942
Definition: dsd/test/gmock/include/gmock/internal/gmock-generated-internal-utils.h:69
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3654
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2398
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1291
bool Value(const T &value, M matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3938
internal::PairMatcher< FirstMatcher, SecondMatcher > Pair(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3924
static Message Elements(size_t n)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3092
virtual ~MatcherBase()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:269
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3777
UnorderedElementsAreArrayMatcher(Iter first, Iter last)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3266
static bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:857
PropertyMatcher(PropertyType(Class::*property)() const, const Matcher< RefToConstProperty > &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2072
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
Definition: dsd/test/gmock/include/gmock/gmock-generated-matchers.h:1096
bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1028
internal::MatcherAsPredicate< M > Matches(M matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3932
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2650
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:459
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:923
Matcher< T > SafeMatcherCast(const M &polymorphic_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:640
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:747
UnorderedElementsAreMatcherImpl(InputIter first, InputIter last)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3118
::std::pair< size_t, size_t > ElementMatcherPair
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3056
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1417
internal::FloatingEqMatcher< float > NanSensitiveFloatEq(float rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3532
Functor::result_type ResultType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2131
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:970
bool operator()(const T &x) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1732
bool MatchAndExplainImpl(bool all_elements_should_match, Container container, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2575
DummyMatchResultListener()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:205
#define GMOCK_KIND_OF_(type)
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:168
GTEST_API_ string FormatMatcherDescription(bool negation, const char *matcher_name, const Strings ¶m_values)
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2244
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1250
#define GTEST_DISALLOW_ASSIGN_(type)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:721
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3555
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1183
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1152
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:245
RhsView::type RhsStlContainer
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2455
PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2767
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field(FieldType Class::*field, const FieldMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3566
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1658
#define GTEST_REMOVE_CONST_(T)
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:743
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:815
#define GTEST_CHECK_(condition)
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1060
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:779
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:340
ElementsAreMatcherImpl(InputIter first, InputIter last)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2878
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2499
View::const_reference StlContainerReference
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2564
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1157
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:405
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2296
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2232
ContainsMatcherImpl(InnerMatcher inner_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2607
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1088
static Matcher< T > Cast(const Matcher< T > &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:575
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1611
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2240
internal::FloatingEqMatcher< float > NanSensitiveFloatNear(float rhs, float max_abs_error)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3547
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2723
static bool Matches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:707
virtual bool MatchAndExplain(LhsContainer lhs, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2408
static ResType Invoke(ResType(*f)(ArgType), T arg)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2150
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe(const internal::string &str)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3632
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3583
PredicateFormatterFromMatcher< M > MakePredicateFormatterFromMatcher(const M &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1803
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:214
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType
ResType ResultType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2142
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:932
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2904
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:232
const type & const_reference
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:396
ResultOfMatcher(Callable callable, const Matcher< ResultType > &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2162
HasSubstrMatcher(const StringType &substring)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1127
GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(Eq,==, "an equal pair")
void SetEdge(size_t ilhs, size_t irhs, bool b)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3029
::std::vector< const MatcherDescriberInterface * > MatcherDescriberVec
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3075
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2452
RawContainer type
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:395
Matcher< Lhs > TypedEq(const Rhs &rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3445
bool MatchAndExplain(const MatcheeStringType &s, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1192
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:117
internal::WhenSortedByMatcher< internal::LessComparator, ContainerMatcher > WhenSorted(const ContainerMatcher &container_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3831
View::const_reference StlContainerReference
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2872
internal::FloatingEqMatcher< double > NanSensitiveDoubleNear(double rhs, double max_abs_error)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3519
bool ExplainMatchResult(M matcher, const T &value, MatchResultListener *listener)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3945
FloatingEqMatcher(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1827
RawPairType::first_type KeyType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2701
GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Eq,==, "is equal to", "isn't equal to")
Matcher< T > MatcherCast(M matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:585
static bool Matches(const MatcherTuple &, const ValueTuple &)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:758
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1682
ContainerView::type::size_type SizeType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2236
virtual ~MatchResultListener()=0
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:112
WhenSortedByMatcher(const Comparator &comparator, const ContainerMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2374
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2604
ContainsMatcher(M m)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2663
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:490
static bool CaseInsensitiveWideCStringEquals(const wchar_t *lhs, const wchar_t *rhs)
Impl(const TupleMatcher &tuple_matcher, const RhsStlContainer &rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2487
bool MatchAndExplain(const Pointer &p, MatchResultListener *) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:926
LhsView::const_reference LhsStlContainerReference
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2479
RefMatcher(T &x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:980
Matcher< T > A()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3415
const Matcher< const Element & > inner_matcher_
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2596
Definition: dsd/test/gtest/include/gtest/internal/gtest-tuple.h:730
Matcher(const MatcherInterface< const internal::string &> *impl)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:319
const Impl & impl() const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:415
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:653
internal::string str() const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:189
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType
GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching(const MatchMatrix &g)
StlContainer::value_type Element
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2873
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:127
internal::EachMatcher< M > Each(M matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3905
bool IsReadableTypeName(const string &type_name)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:663
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2867
OutIter TransformTupleValues(Func f, const Tuple &t, OutIter out)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:834
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1863
LhsStlContainer::value_type LhsValue
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2480
void Clear()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:192
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1096
internal::FloatingEqMatcher< float > FloatEq(float rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3526
#define GTEST_REFERENCE_TO_CONST_(T)
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:772
StlContainer::value_type Element
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2565
const Pointer::element_type * GetRawPointer(const Pointer &p)
Definition: dsd/test/gmock/include/gmock/internal/gmock-internal-utils.h:76
LhsView::type LhsStlContainer
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2388
bool_constant< false > false_type
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:1617
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2775
bool StaticAssertTypeEq()
Definition: dsd/test/gtest/include/gtest/gtest.h:2205
View::const_reference StlContainerReference
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3111
bool CaseInsensitiveStringEquals(const StringType &s1, const StringType &s2)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1040
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1704
bool Matches(T x) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:236
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2698
const internal::AnythingMatcher _
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3412
virtual bool MatchAndExplain(PairType a_pair, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2792
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer
PointeeMatcher(const InnerMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1950
Impl & mutable_impl()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:411
KeyMatcherImpl(InnerMatcher inner_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2704
CallableTraits< Callable >::ResultType ResultType
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2160
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2081
StlContainerView< RawContainer > View
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2562
UnorderedElementsAreArrayMatcher()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3263
UnorderedElementsAreMatcher(const MatcherTuple &args)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3212
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1563
ContainerEqMatcher(const Container &rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2289
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1589
internal::GeMatcher< Rhs > Ge(Rhs x)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3449
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2158
Iter ArrayAwareFind(Iter begin, Iter end, const Element &elem)
Definition: dsd/test/gtest/include/gtest/internal/gtest-internal.h:912
GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq(const internal::string &str)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3639
Definition: dsd/test/gtest/include/gtest/internal/gtest-port.h:926
Matcher()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:317
internal::StlContainerView< RawContainer > View
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3109
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1172
void DescribeToImpl(::std::ostream *os) const
bool IsInterested() const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:104
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:184
EitherOfMatcherImpl(const Matcher< T > &matcher1, const Matcher< T > &matcher2)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1591
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2678
internal::ContainsMatcher< M > Contains(M matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3873
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1264
Definition: dsd/test/gtest/include/gtest/gtest.h:256
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1076
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1204
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3261
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:790
void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1708
static void ExplainMatchFailuresTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:719
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:844
internal::UnorderedElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > UnorderedElementsAreArray(Iter first, Iter last)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3372
Impl(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1837
internal::StlContainerView< Container > View
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2283
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2645
static void CheckIsValid(ResType(*f)(ArgType))
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2145
internal::ResultOfMatcher< Callable > ResultOf(Callable callable, const ResultOfMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3609
virtual bool MatchAndExplain(Container container, MatchResultListener *listener) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2920
EachMatcher(M m)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2680
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly(Predicate pred)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3786
void ExplainMatchResultTo(T x, ::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:250
View::type StlContainer
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3110
PointwiseMatcher(const TupleMatcher &tuple_matcher, const RhsContainer &rhs)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2460
RemoveConstFromKey< typename LhsStlContainer::value_type >::type LhsValue
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2393
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:143
internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2235
virtual void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1378
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2661
void DescribeTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:931
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2474
MatcherAsPredicate(M matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1723
Matcher(const MatcherInterface< internal::string > *impl)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:336
SizeIsMatcher(const SizeMatcher &size_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2222
void UniversalPrint(const T &value, ::std::ostream *os)
Definition: dsd/test/gtest/include/gtest/gtest-printers.h:752
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2616
internal::WhenSortedByMatcher< Comparator, ContainerMatcher > WhenSortedBy(const Comparator &comparator, const ContainerMatcher &container_matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3821
StringMatchResultListener()
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:186
static ResultType Invoke(Functor f, T arg)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2136
virtual void DescribeNegationTo(::std::ostream *os) const
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:1884
RhsStlContainer::value_type RhsValue
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2456
Impl(const Comparator &comparator, const ContainerMatcher &matcher)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:2395
internal::FloatingEqMatcher< float > FloatNear(float rhs, float max_abs_error)
Definition: dsd/test/gmock/include/gmock/gmock-matchers.h:3539