Lines Matching defs:const

64 GTEST_API_ string JoinAsTuple(const Strings& fields);
166 virtual void DescribeTo(ostream* os) const {
171 MatchResultListener* listener) const {
172 const int diff = lhs - rhs_;
192 string OfType(const string& type_name) {
202 string Describe(const Matcher<T>& m) {
210 string DescribeNegation(const Matcher<T>& m) {
218 string Explain(const MatcherType& m, const Value& x) {
260 MatchResultListener* /* listener */) const {
264 virtual void DescribeTo(ostream* os) const {
282 virtual bool MatchAndExplain(int x, MatchResultListener* listener) const {
283 const bool match = x % 2 == 0;
294 virtual void DescribeTo(ostream* os) const {
314 const MatcherInterface<int>* impl = new EvenMatcherImpl;
368 // Matcher<string> or Matcher<const string&>.
374 Matcher<const string&> m2 = "hi";
380 // Matcher<string> or Matcher<const string&>.
386 Matcher<const string&> m2 = string("hi");
393 // Matcher<StringPiece> or Matcher<const StringPiece&>.
399 Matcher<const StringPiece&> m2 = "cats";
405 // Matcher<StringPiece> or Matcher<const StringPiece&>.
411 Matcher<const StringPiece&> m2 = string("cats");
417 // Matcher<StringPiece> or Matcher<const StringPiece&>.
423 Matcher<const StringPiece&> m2 = StringPiece("cats");
433 const MatcherInterface<int>* dummy_impl = NULL;
439 const int g_bar = 1;
443 bool MatchAndExplain(const T& x,
444 MatchResultListener* /* listener */) const {
445 const void* p = &x;
449 void DescribeTo(ostream* os) const { *os << "g_bar or zero"; }
451 void DescribeNegationTo(ostream* os) const {
464 Matcher<const int&> m1 = ReferencesBarOrIsZero();
482 void DescribeTo(ostream* os) const { *os << "is even"; }
484 void DescribeNegationTo(ostream* os) const {
489 bool MatchAndExplain(const T& x, MatchResultListener* listener) const {
507 const Matcher<int> m1 = PolymorphicIsEven();
512 const Matcher<int> not_m1 = Not(m1);
518 const Matcher<char> m2 = PolymorphicIsEven();
523 const Matcher<char> not_m2 = Not(m2);
543 int value() const { return value_; }
549 bool IsPositiveIntValue(const IntValue& foo) {
570 // Tests that MatcherCast<T>(m) works when m is a Matcher<const T&>.
572 Matcher<const int&> m1 = Eq(0);
586 // Tests that MatcherCast<const T&>(m) works when m is a Matcher<T>.
589 Matcher<const int&> m2 = MatcherCast<const int&>(m1);
616 explicit ConvertibleFromAny(const T& /*a_value*/) : value(-1) {
622 bool operator==(const ConvertibleFromAny& a, const ConvertibleFromAny& b) {
626 ostream& operator<<(ostream& os, const ConvertibleFromAny& a) {
644 IntReferenceWrapper(const int& a_value) : value(&a_value) {}
645 const int* value;
648 bool operator==(const IntReferenceWrapper& a, const IntReferenceWrapper& b) {
711 // Tests that SafeMatcherCast<T&>(m) works when m is a Matcher<const T&>.
714 Matcher<const int&> m1 = Ref(n);
721 // Tests that MatcherCast<const T&>(m) works when m is a Matcher<T>.
724 Matcher<const int&> m2 = SafeMatcherCast<const int&>(m1);
841 const bool b = true;
842 Matcher<const bool&> m2 = _;
856 const char a1[] = "hi";
857 const char a2[] = "hi";
859 Matcher<const char*> m1 = Eq(a1);
874 inline bool operator==(const Unprintable& /* lhs */,
875 const Unprintable& /* rhs */) {
915 // is a "bare" type (i.e. not in the form of const U or U&). If v's
920 static bool IsTypeOf(const T& /* v */) { return true; }
976 Matcher<const string&> m1 = Lt("Hello");
1010 Matcher<const char*> m2 = IsNull();
1011 const char* p2 = NULL;
1019 // gmock-matchers.h: 'testing::Matcher<void *>::Matcher(const testing::
1032 const Matcher<linked_ptr<int> > m = IsNull();
1033 const linked_ptr<int> null_p;
1034 const linked_ptr<int> non_null_p(new int);
1041 const Matcher<const linked_ptr<double>&> m = IsNull();
1042 const linked_ptr<double> null_p;
1043 const linked_ptr<double> non_null_p(new double);
1051 const Matcher<std::function<void()>> m = IsNull();
1073 Matcher<const char*> m2 = NotNull();
1074 const char* p2 = NULL;
1080 const Matcher<linked_ptr<int> > m = NotNull();
1081 const linked_ptr<int> null_p;
1082 const linked_ptr<int> non_null_p(new int);
1089 const Matcher<const linked_ptr<double>&> m = NotNull();
1090 const linked_ptr<double> null_p;
1091 const linked_ptr<double> non_null_p(new double);
1099 const Matcher<std::function<void()>> m = NotNull();
1132 // const reference.
1136 Matcher<const int&> m = Ref(a);
1148 Matcher<const Base&> m1 = Ref(base);
1161 EXPECT_THAT(Explain(Matcher<const int&>(Ref(n)), n),
1165 EXPECT_THAT(Explain(Matcher<const int&>(Ref(n)), m),
1172 Matcher<const char*> m = StrEq(string("Hello"));
1177 Matcher<const string&> m2 = StrEq("Hello");
1197 Matcher<const char*> m = StrNe("Hello");
1208 Matcher<const char*> m = StrNe("Hi");
1213 Matcher<const char*> m = StrCaseEq(string("Hello"));
1219 Matcher<const string&> m2 = StrCaseEq("Hello");
1227 Matcher<const string&> m0 = StrCaseEq(str1);
1231 Matcher<const string&> m1 = StrCaseEq(str1);
1236 Matcher<const string&> m2 = StrCaseEq(str1);
1240 Matcher<const string&> m3 = StrCaseEq(str1);
1255 Matcher<const char*> m = StrCaseNe("Hello");
1267 Matcher<const char*> m = StrCaseNe("Hi");
1273 const Matcher<string> m1 = HasSubstr("foo");
1277 const Matcher<const std::string&> m2 = HasSubstr("foo");
1284 const Matcher<char*> m1 = HasSubstr("foo");
1289 const Matcher<const char*> m2 = HasSubstr("foo");
1302 Matcher<const pair<std::string, int>&> m = Key("foo");
1358 Matcher<const pair<const char*, int>&> m1 = Pair("foo", 42);
1359 Matcher<const pair<const char*, int> > m2 = Pair("foo", 42);
1360 Matcher<pair<const char*, int> > m3 = Pair("foo", 42);
1362 Matcher<pair<int, const std::string> > m4 = Pair(25, "42");
1363 Matcher<pair<const std::string, int> > m5 = Pair("25", 42);
1367 Matcher<const pair<std::string, int>&> m1 = Pair("foo", 42);
1375 Matcher<const pair<int, int>&> m2 = Not(Pair(Not(13), 42));
1384 const Matcher<pair<int, int> > m = Pair(GreaterThan(0), GreaterThan(0));
1406 const Matcher<pair<int, int> > explain_first = Pair(GreaterThan(0), 0);
1413 const Matcher<pair<int, int> > explain_second = Pair(0, GreaterThan(0));
1463 const Matcher<const char*> m1 = StartsWith(string(""));
1468 const Matcher<const string&> m2 = StartsWith("Hi");
1477 Matcher<const std::string> m = StartsWith("Hi");
1484 const Matcher<const char*> m1 = EndsWith("");
1489 const Matcher<const string&> m2 = EndsWith(string("Hi"));
1498 Matcher<const std::string> m = EndsWith("Hi");
1505 const Matcher<const char*> m1 = MatchesRegex("a.*z");
1510 const Matcher<const string&> m2 = MatchesRegex(new RE("a.*z"));
1517 Matcher<const std::string> m1 = MatchesRegex(string("Hi.*"));
1520 Matcher<const char*> m2 = MatchesRegex(new RE("a.*"));
1527 const Matcher<const char*> m1 = ContainsRegex(string("a.*z"));
1532 const Matcher<const string&> m2 = ContainsRegex(new RE("a.*z"));
1539 Matcher<const std::string> m1 = ContainsRegex("Hi.*");
1542 Matcher<const char*> m2 = ContainsRegex(new RE("a.*"));
1549 Matcher<const wchar_t*> m = StrEq(::std::wstring(L"Hello"));
1554 Matcher<const ::std::wstring&> m2 = StrEq(L"Hello");
1558 Matcher<const ::std::wstring&> m3 = StrEq(L"\xD3\x576\x8D3\xC74D");
1564 Matcher<const ::std::wstring&> m4 = StrEq(str);
1567 Matcher<const ::std::wstring&> m5 = StrEq(str);
1582 Matcher<const ::std::wstring&> m4 = StrEq(str);
1585 Matcher<const ::std::wstring&> m5 = StrEq(str);
1590 Matcher<const wchar_t*> m = StrNe(L"Hello");
1601 Matcher<const wchar_t*> m = StrNe(L"Hi");
1606 Matcher<const wchar_t*> m = StrCaseEq(::std::wstring(L"Hello"));
1612 Matcher<const ::std::wstring&> m2 = StrCaseEq(L"Hello");
1620 Matcher<const ::std::wstring&> m0 = StrCaseEq(str1);
1624 Matcher<const ::std::wstring&> m1 = StrCaseEq(str1);
1629 Matcher<const ::std::wstring&> m2 = StrCaseEq(str1);
1633 Matcher<const ::std::wstring&> m3 = StrCaseEq(str1);
1648 Matcher<const wchar_t*> m = StrCaseNe(L"Hello");
1660 Matcher<const wchar_t*> m = StrCaseNe(L"Hi");
1666 const Matcher< ::std::wstring> m1 = HasSubstr(L"foo");
1670 const Matcher<const ::std::wstring&> m2 = HasSubstr(L"foo");
1677 const Matcher<wchar_t*> m1 = HasSubstr(L"foo");
1682 const Matcher<const wchar_t*> m2 = HasSubstr(L"foo");
1697 const Matcher<const wchar_t*> m1 = StartsWith(::std::wstring(L""));
1702 const Matcher<const ::std::wstring&> m2 = StartsWith(L"Hi");
1711 Matcher<const ::std::wstring> m = StartsWith(L"Hi");
1718 const Matcher<const wchar_t*> m1 = EndsWith(L"");
1723 const Matcher<const ::std::wstring&> m2 = EndsWith(::std::wstring(L"Hi"));
1732 Matcher<const ::std::wstring> m = EndsWith(L"Hi");
1740 Matcher<const wchar_t*> m = StrEq(::wstring(L"Hello"));
1745 Matcher<const ::wstring&> m2 = StrEq(L"Hello");
1749 Matcher<const ::wstring&> m3 = StrEq(L"\xD3\x576\x8D3\xC74D");
1755 Matcher<const ::wstring&> m4 = StrEq(str);
1758 Matcher<const ::wstring&> m5 = StrEq(str);
1773 Matcher<const ::wstring&> m4 = StrEq(str);
1776 Matcher<const ::wstring&> m5 = StrEq(str);
1781 Matcher<const wchar_t*> m = StrNe(L"Hello");
1792 Matcher<const wchar_t*> m = StrNe(L"Hi");
1797 Matcher<const wchar_t*> m = StrCaseEq(::wstring(L"Hello"));
1803 Matcher<const ::wstring&> m2 = StrCaseEq(L"Hello");
1811 Matcher<const ::wstring&> m0 = StrCaseEq(str1);
1815 Matcher<const ::wstring&> m1 = StrCaseEq(str1);
1820 Matcher<const ::wstring&> m2 = StrCaseEq(str1);
1824 Matcher<const ::wstring&> m3 = StrCaseEq(str1);
1839 Matcher<const wchar_t*> m = StrCaseNe(L"Hello");
1851 Matcher<const wchar_t*> m = StrCaseNe(L"Hi");
1857 const Matcher< ::wstring> m1 = HasSubstr(L"foo");
1861 const Matcher<const ::wstring&> m2 = HasSubstr(L"foo");
1868 const Matcher<wchar_t*> m1 = HasSubstr(L"foo");
1873 const Matcher<const wchar_t*> m2 = HasSubstr(L"foo");
1888 const Matcher<const wchar_t*> m1 = StartsWith(::wstring(L""));
1893 const Matcher<const ::wstring&> m2 = StartsWith(L"Hi");
1902 Matcher<const ::wstring> m = StartsWith(L"Hi");
1909 const Matcher<const wchar_t*> m1 = EndsWith(L"");
1914 const Matcher<const ::wstring&> m2 = EndsWith(::wstring(L"Hi"));
1923 Matcher<const ::wstring> m = EndsWith(L"Hi");
1935 Matcher<const Tuple2&> m = Eq();
1942 Matcher<const Tuple2&> m = Eq();
1949 Matcher<const Tuple2&> m = Ge();
1957 Matcher<const Tuple2&> m = Ge();
1964 Matcher<const Tuple2&> m = Gt();
1972 Matcher<const Tuple2&> m = Gt();
1979 Matcher<const Tuple2&> m = Le();
1987 Matcher<const Tuple2&> m = Le();
1994 Matcher<const Tuple2&> m = Lt();
2002 Matcher<const Tuple2&> m = Lt();
2009 Matcher<const Tuple2&> m = Ne();
2017 Matcher<const Tuple2&> m = Ne();
2040 Matcher<const int&> m = Not(greater_than_5);
2046 void AllOfMatches(int num, const Matcher<int>& m) {
2191 Matcher<const int&> m = AllOf(greater_than_5, less_than_10);
2196 Matcher<const int&> m4 = AllOf(greater_than_5, less_than_10, less_than_10);
2244 void AnyOfMatches(int num, const Matcher<int>& m) {
2376 Matcher<const int&> m = AnyOf(greater_than_5, less_than_10);
2381 Matcher<const int&> m4 = AnyOf(greater_than_5, less_than_10, less_than_10);
2445 bool operator()(int n) const { return n > threshold_; }
2452 const int foo = 0;
2456 bool ReferencesFooAndIsZero(const int& n) {
2479 operator bool() const { return number_ != 0; }
2508 Matcher<const int&> m = Truly(ReferencesFooAndIsZero);
2546 const Matcher<int> is_zero = Eq(0);
2551 const Matcher<const int&> ref_n = Ref(n);
2567 const Matcher<int> is_even = PolymorphicIsEven();
2572 const Matcher<const double&> is_zero = Eq(0);
2677 // virtual bool MatchAndExplain(T x, ...) const {
2679 // with U == string and T == const char*
2685 Matcher<const char*> starts_with_he = StartsWith("he");
2688 Matcher<const string&> ends_with_ok = EndsWith("ok");
2690 const string bad = "bad";
2763 // matcher_maker can produce a Matcher<const RawType&>, which is needed in
2765 Matcher<const RawType&> m6 = matcher_maker(0.0);
2781 const size_t max_ulps_;
2783 const Bits zero_bits_; // The bits that represent 0.0.
2784 const Bits one_bits_; // The bits that represent 1.0.
2785 const Bits infinity_bits_; // The bits that represent +infinity.
2788 const RawType close_to_positive_zero_;
2789 const RawType close_to_negative_zero_;
2790 const RawType further_from_negative_zero_;
2793 const RawType close_to_one_;
2794 const RawType further_from_one_;
2797 const RawType infinity_;
2798 const RawType close_to_infinity_;
2799 const RawType further_from_infinity_;
2802 const RawType max_;
2805 const RawType nan1_;
2806 const RawType nan2_;
2876 // matcher_maker can produce a Matcher<const RawType&>, which is needed in
2878 Matcher<const RawType&> m10 = matcher_maker(0.0, 1.0);
3102 const string explanation = Explain(DoubleNear(2.1, 1e-10), 2.1 + 1.2e-10);
3143 const Matcher<int*> m = Pointee(Ge(0));
3153 const Matcher<const double*> m = Pointee(Ge(0));
3163 const Matcher<int* const &> m = Pointee(Ge(0));
3173 const Matcher<double* &> m = Pointee(Ge(0));
3247 const string prefix =
3263 Matcher<const Base&> ref_matcher = WhenDynamicCastTo<const OtherDerived&>(_);
3272 EXPECT_THAT(as_base_ref, WhenDynamicCastTo<const Derived&>(FieldIIs(4)));
3273 EXPECT_THAT(as_base_ref, WhenDynamicCastTo<const Derived&>(Not(FieldIIs(5))));
3279 EXPECT_THAT(as_base_ref, Not(WhenDynamicCastTo<const OtherDerived&>(_)));
3284 // Minimal const-propagating pointer.
3292 ConstPropagatingPtr(const ConstPropagatingPtr& other) : val_(other.val_) {}
3296 // Most smart pointers return non-const T* and T& from the next methods.
3297 const T* get() const { return val_; }
3298 const T& operator*() const { return *val_; }
3305 const Matcher< ConstPropagatingPtr<int> > m = Pointee(Lt(5));
3307 const ConstPropagatingPtr<int> co(&three);
3317 const Matcher<const char*> m = Pointee(_);
3323 const Matcher<int*> m = Pointee(5);
3333 const Matcher<int*> m = Pointee(Gt(3));
3340 const Matcher<const string*> m = Pointee(StartsWith("Hi"));
3342 EXPECT_EQ("", Explain(m, static_cast<const string*>(NULL)));
3344 const Matcher<long*> m2 = Pointee(GreaterThan(1)); // NOLINT
3351 const Matcher<int*> m = Pointee(0);
3362 int value() const { return value_; }
3371 bool ValueIsPositive(const Uncopyable& x) { return x.value() > 0; }
3380 AStruct(const AStruct& rhs)
3383 int x; // A non-const field.
3384 const double y; // A const field.
3386 const char* p; // A pointer field.
3400 // Tests that Field(&Foo::field, ...) works when field is non-const.
3410 // Tests that Field(&Foo::field, ...) works when field is const.
3433 Matcher<AStruct> m = Field(&AStruct::p, static_cast<const char*>(NULL));
3449 Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
3462 Matcher<const DerivedStruct&> m = Field(&AStruct::x, Ge(0));
3474 Matcher<const AStruct&> m = Field(&AStruct::x,
3485 Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
3493 Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
3505 // Tests that Field() works when the argument is a pointer to const.
3507 Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
3515 // Tests that Field() works when the argument is a pointer to non-const.
3525 // Tests that Field() works when the argument is a reference to a const pointer.
3527 Matcher<AStruct* const&> m = Field(&AStruct::x, Ge(0));
3537 Matcher<const AStruct*> m = Field(&AStruct::x, _);
3542 // is a sub-type of const Foo*.
3556 Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
3564 Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
3568 EXPECT_EQ("", Explain(m, static_cast<const AStruct*>(NULL)));
3583 int n() const { return n_; }
3587 // A getter that returns a reference to const.
3588 const string& s() const { return s_; }
3590 void set_s(const string& new_s) { s_ = new_s; }
3592 // A getter that returns a reference to non-const.
3593 double& x() const { return x_; }
3606 int k() const { return k_; }
3614 Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
3625 // returns a reference to const.
3627 Matcher<const AClass&> m = Property(&AClass::s, StartsWith("hi"));
3638 // returns a reference to non-const.
3643 Matcher<const AClass&> m = Property(&AClass::x, Ref(x));
3668 Matcher<const DerivedClass&> m = Property(&AClass::n, Ge(0));
3682 Matcher<const AClass&> m = Property(&AClass::n,
3693 Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
3702 Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
3714 // Tests that Property() works when the argument is a pointer to const.
3716 Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
3726 // Tests that Property() works when the argument is a pointer to non-const.
3739 // const pointer.
3741 Matcher<AClass* const&> m = Property(&AClass::s, StartsWith("hi"));
3753 Matcher<const AClass*> m = Property(&AClass::x, _);
3758 // type is a sub-type of const Foo*.
3762 Matcher<const DerivedClass*> m = Property(&AClass::n, Ge(0));
3774 Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
3783 Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
3787 EXPECT_EQ("", Explain(m, static_cast<const AClass*>(NULL)));
3844 // returns a reference to non-const.
3870 // returns a reference to const.
3871 const string& StringFunction(const string& input) { return input; }
3876 Matcher<const string&> matcher = ResultOf(&StringFunction, Ref(s));
3911 result_type operator()(argument_type input) const {
3929 int operator()(const char* s) { return static_cast<int>(strlen(s)); }
3938 Matcher<const char*> matcher_string = ResultOf(PolymorphicFunctor(), Ge(5));
3944 const int* ReferencingFunction(const int& n) { return &n; }
3947 typedef const int* result_type;
3948 result_type operator()(const int& n) { return &n; }
3952 const int n = 1;
3953 const int n2 = 1;
3954 Matcher<const int&> matcher2 = ResultOf(ReferencingFunction, Eq(&n));
3958 Matcher<const int&> matcher3 = ResultOf(ReferencingFunctor(), Eq(&n));
3969 bool MatchAndExplain(const T& n, MatchResultListener* listener) const {
3975 void DescribeTo(ostream* os) const {
3979 void DescribeNegationTo(ostream* os) const {
3984 int divider() const { return divider_; }
3997 const Matcher<int> m = AllOf(DivisibleBy(4), DivisibleBy(3));
4004 const Matcher<int> m = AllOf(DivisibleBy(4), DivisibleBy(3));
4011 const Matcher<int> m = AllOf(Ge(1), DivisibleBy(3));
4018 const Matcher<int> m = AllOf(DivisibleBy(2), DivisibleBy(3));
4023 const Matcher<int> m = AllOf(Ge(2), Le(3));
4028 const Matcher<int> m = GreaterThan(5);
4040 int value() const { return value_; }
4042 bool operator==(const NotCopyable& rhs) const {
4046 bool operator>=(const NotCopyable& rhs) const {
4056 const NotCopyable const_value1(1);
4057 const Matcher<const NotCopyable&> m = Eq(ByRef(const_value1));
4059 const NotCopyable n1(1), n2(2);
4066 const Matcher<NotCopyable&> m = Ge(ByRef(value2));
4131 Matcher<const vector<int>&> m = SizeIs(1);
4181 static const int vals[] = {1, 1, 2, 3, 5, 8};
4183 const Matcher<TypeParam> m = ContainerEq(my_set);
4190 static const int vals[] = {1, 1, 2, 3, 5, 8};
4191 static const int test_vals[] = {2, 1, 8, 5};
4194 const Matcher<TypeParam> m = ContainerEq(my_set);
4202 static const int vals[] = {1, 1, 2, 3, 5, 8};
4203 static const int test_vals[] = {1, 2, 3, 5, 8, 46};
4206 const Matcher<const TypeParam&> m = ContainerEq(my_set);
4213 static const int vals[] = {1, 1, 2, 3, 5, 8};
4214 static const int test_vals[] = {1, 2, 3, 8, 46};
4217 const Matcher<TypeParam> m = ContainerEq(my_set);
4226 static const int vals[] = {1, 1, 2, 3, 5, 8};
4227 static const int test_vals[] = {1, 2, 3, 5, 8};
4230 const Matcher<const TypeParam&> m = ContainerEq(my_set);
4240 static const int vals[] = {1, 1, 2, 3, 5, 8};
4241 static const int test_vals[] = {2, 1, 5};
4244 const Matcher<vector<int> > m = ContainerEq(my_set);
4253 static const int vals[] = {1, 1, 2, 3, 5, 8};
4254 static const int test_vals[] = {1, 2, 92, 3, 5, 8, 46};
4257 const Matcher<const list<size_t>&> m = ContainerEq(my_set);
4265 static const int vals[] = {1, 1, 2, 3, 5, 8};
4266 static const int test_vals[] = {1, 2, 3, 92, 46};
4269 const Matcher<const list<size_t> > m = ContainerEq(my_set);
4279 static const int vals[] = {1, 1, 2, 3, 5, 8};
4280 static const int test_vals[] = {1, 2, 3, 5, 8};
4283 const Matcher<vector<int> > m = ContainerEq(my_set);
4301 const Matcher<const map<int, std::string>&> m = ContainerEq(my_map);
4320 const char a1[][3] = {"hi", "lo"};
4321 const char a2[][3] = {"hi", "lo"};
4322 const char b[][3] = {"lo", "hi"};
4334 const int a1[] = {1, 2, 3};
4335 const int a2[] = {1, 2, 3};
4336 const int b[] = {1, 2, 3, 4};
4338 const int* const p1 = a1;
4342 const int c[] = {1, 3, 2};
4357 const Matcher<const std::string(&)[2][3]> m = ContainerEq(a2);
4365 const vector<int> numbers;
4394 const int numbers[] = {1, 3, 2, 4};
4395 const int sorted_numbers[] = {1, 2, 3, 4};
4403 const Matcher<vector<int> > m = WhenSortedBy(less<int>(), ElementsAre(1, 2));
4415 const int a[] = {2, 1};
4426 const vector<int> numbers;
4486 Matcher<const std::vector<int>&> vector_match = ElementsAre(1, 2);
4488 Matcher<const std::vector<int>&> not_vector_match = ElementsAre(2, 1);
4505 const_iterator begin() const {
4508 const_iterator end() const {
4516 const value_type*,
4517 const value_type&> {
4519 ConstIter(const Streamlike* s,
4523 const value_type& operator*() const { return *pos_; }
4524 const value_type* operator->() const { return &*pos_; }
4534 explicit PostIncrProxy(const value_type& value) : value_(value) {}
4535 value_type operator*() const { return value_; }
4545 friend bool operator==(const ConstIter& a, const ConstIter& b) {
4548 friend bool operator!=(const ConstIter& a, const ConstIter& b) {
4553 const Streamlike* s_;
4557 friend std::ostream& operator<<(std::ostream& os, const Streamlike& s) {
4560 const char* sep = "";
4573 const int a[5] = {2, 1, 4, 5, 3};
4576 const int* ip = a;
4598 const int a[5] = {1, 2, 3, 4, 5};
4643 const int a[5] = {2, 1, 4, 5, 3};
4650 const int a[] = {2, 1, 4, 5, 3};
4652 Matcher<const std::vector<int>&> vector_match = ElementsAre(1, 2, 3, 4, 5);
4661 const int a[5] = {1, 2, 3, 4, 5};
4668 const int a[5] = {1, 2, 3, 4, 5};
4691 const int actual[] = {3, 1, 2};
4706 const int a[] = {0, 1, 2, 3, 4};
4716 const bool a[] = {0, 1, 0, 1, 1};
4717 const bool b[] = {1, 0, 1, 1, 0};
4729 const int a[5] = {2, 1, 4, 5, 3};
4745 const int actual[] = {3, 1, 2};
4760 const int a[5] = {2, 1, 4, 5, 3};
4766 const string a[5] = {"a", "b", "c", "d", "e"};
4772 const int a[5] = {2, 1, 4, 5, 3};
4781 const int a[5] = {2, 1, 4, 5, 3};
4807 const int a[] = {1, 2, 3};
4817 const int a[] = {1, 2, 3};
4833 const int a[5] = {2, 1, 4, 5, 3};
5016 explicit BacktrackingMaxBPMState(const Graph* g) : graph_(g) { }
5034 static const size_t kUnused = static_cast<size_t>(-1);
5046 const ElementMatcherPair& back = matches_.back();
5075 const Graph* graph_; // not owned
5083 const size_t BacktrackingMaxBPMState<Graph>::kUnused;
5091 FindBacktrackingMaxBPM(const Graph& g) {
5144 static const int kEdges[][2] = {{0, 2}, {1, 1}, {2, 1}, {3, 0}};
5220 EXPECT_TRUE(IsReadableTypeName("const unsigned char*"));
5248 const char* fields[] = {"1"};
5253 const char* fields[] = {"1", "a"};
5258 const char* fields[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};
5271 const char* params[] = {"5"};
5276 const char* params2[] = {"5", "8"};
5294 const PolymorphicMatcher<DivisibleByImpl> m(DivisibleByImpl(42));
5295 const DivisibleByImpl& impl = m.impl();
5331 Matcher<const int(&)[1]> n = Each(1); // NOLINT
5333 const int b[1] = {1};
5379 map<const char*, int> my_map;
5380 const char* bar = "a string";
5397 const int a[] = {1, 2, 3};
5403 const int a[] = {1, 2};
5404 const int* const pointer = a;
5413 bool MatchAndExplain(const tuple<T1, T2>& a_pair,
5414 MatchResultListener* listener) const {
5424 void DescribeTo(ostream* os) const {
5428 void DescribeNegationTo(ostream* os) const {
5442 const Matcher<const vector<int>&> m = Pointwise(IsHalfOf(), rhs);
5458 const Matcher<const int (&)[2]> m = Pointwise(IsHalfOf(), rhs);
5467 const int lhs[] = {1, 2, 3};
5477 const int rhs[] = {1, 2, 3};
5489 const vector<int> lhs{2, 4, 6};
5497 const double lhs[2] = {1, 2};
5498 const int rhs[1] = {0};
5503 const int rhs2[3] = {0, 1, 2};
5508 const double lhs[3] = {1, 2, 3};
5509 const int rhs[3] = {2, 6, 4};
5517 const double lhs[3] = {1, 2, 3};
5518 const int rhs[3] = {2, 4, 6};
5524 const double lhs[3] = {1, 2, 3};
5525 const int rhs[3] = {2, 4, 6};
5526 const Matcher<tuple<const double&, const int&> > m1 = IsHalfOf();
5530 // This type works as a tuple<const double&, const int&> can be
5532 const Matcher<tuple<double, int> > m2 = IsHalfOf();
5542 const Matcher<const vector<int>&> m = UnorderedPointwise(IsHalfOf(), rhs);
5569 const Matcher<const int (&)[2]> m = UnorderedPointwise(IsHalfOf(), rhs);
5578 const int lhs[] = {1, 2, 3};
5588 const int rhs[] = {1, 2, 3};
5600 const vector<int> lhs{2, 4, 6};
5608 const double lhs[2] = {1, 2};
5609 const int rhs[1] = {0};
5614 const int rhs2[3] = {0, 1, 2};
5619 const double lhs[3] = {1, 2, 3};
5620 const int rhs[3] = {2, 6, 6};
5628 const double lhs[3] = {1, 2, 3};
5629 const int rhs[3] = {2, 4, 6};
5634 const double lhs[3] = {1, 2, 3};
5635 const int rhs[3] = {6, 4, 2};
5640 const double lhs[3] = {1, 2, 3};
5641 const int rhs[3] = {4, 6, 2};
5642 const Matcher<tuple<const double&, const int&> > m1 = IsHalfOf();
5645 // This type works as a tuple<const double&, const int&> can be
5647 const Matcher<tuple<double, int> > m2 = IsHalfOf();