Merge pull request #1577 from gennadiycivil/master
merging gmock generated matchers
This commit is contained in:
commit
4035d6ecc0
@ -779,6 +779,9 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
|
||||
|
||||
// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
|
||||
// that matches n elements in any order. We support up to n=10 arguments.
|
||||
//
|
||||
// If you have >10 elements, consider UnorderedElementsAreArray() or
|
||||
// UnorderedPointwise() instead.
|
||||
|
||||
inline internal::UnorderedElementsAreMatcher<
|
||||
::testing::tuple<> >
|
||||
@ -1268,7 +1271,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
// using testing::PrintToString;
|
||||
//
|
||||
// MATCHER_P2(InClosedRange, low, hi,
|
||||
// string(negation ? "is not" : "is") + " in range [" +
|
||||
// std::string(negation ? "is not" : "is") + " in range [" +
|
||||
// PrintToString(low) + ", " + PrintToString(hi) + "]") {
|
||||
// return low <= arg && arg <= hi;
|
||||
// }
|
||||
@ -1383,12 +1386,14 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##Matcher {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl()\
|
||||
{}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
@ -1396,17 +1401,15 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<>()));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -1416,14 +1419,13 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
name##Matcher() {\
|
||||
}\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##Matcher);\
|
||||
};\
|
||||
inline name##Matcher name() {\
|
||||
return name##Matcher();\
|
||||
}\
|
||||
template <typename arg_type>\
|
||||
bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1432,42 +1434,42 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
explicit gmock_Impl(p0##_type gmock_p0)\
|
||||
: p0(gmock_p0) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p0##_type const p0;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<p0##_type>(p0)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
return ::testing::Matcher<arg_type>(\
|
||||
new gmock_Impl<arg_type>(p0));\
|
||||
}\
|
||||
explicit name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
|
||||
explicit name##MatcherP(p0##_type gmock_p0) : \
|
||||
p0(::testing::internal::move(gmock_p0)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p0##_type const p0;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
|
||||
};\
|
||||
template <typename p0##_type>\
|
||||
inline name##MatcherP<p0##_type> name(p0##_type p0) {\
|
||||
@ -1476,7 +1478,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
template <typename p0##_type>\
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1485,45 +1487,46 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP2 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
|
||||
: p0(gmock_p0), p1(gmock_p1) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<p0##_type, p1##_type>(p0, p1)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
return ::testing::Matcher<arg_type>(\
|
||||
new gmock_Impl<arg_type>(p0, p1));\
|
||||
}\
|
||||
name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
|
||||
p1(gmock_p1) {\
|
||||
name##MatcherP2(p0##_type gmock_p0, \
|
||||
p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type>\
|
||||
inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
|
||||
@ -1534,7 +1537,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP2<p0##_type, \
|
||||
p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1543,34 +1546,36 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP3 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
|
||||
p2)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -1578,13 +1583,14 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
new gmock_Impl<arg_type>(p0, p1, p2));\
|
||||
}\
|
||||
name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
|
||||
p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type>\
|
||||
inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
|
||||
@ -1595,7 +1601,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP3<p0##_type, p1##_type, \
|
||||
p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1605,36 +1611,39 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP4 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<p0##_type, p1##_type, p2##_type, \
|
||||
p3##_type>(p0, p1, p2, p3)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -1642,15 +1651,17 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
new gmock_Impl<arg_type>(p0, p1, p2, p3));\
|
||||
}\
|
||||
name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
|
||||
p2(gmock_p2), p3(gmock_p3) {\
|
||||
p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type>\
|
||||
@ -1665,7 +1676,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
|
||||
p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1675,38 +1686,41 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP5 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
|
||||
p4(gmock_p4) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type>(p0, p1, p2, p3, p4)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -1715,16 +1729,18 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
}\
|
||||
name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, \
|
||||
p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
|
||||
p3(gmock_p3), p4(gmock_p4) {\
|
||||
p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type>\
|
||||
@ -1739,7 +1755,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1749,39 +1765,43 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP6 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
|
||||
p4(gmock_p4), p5(gmock_p5) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -1790,17 +1810,20 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
}\
|
||||
name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
|
||||
p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
|
||||
p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
|
||||
p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type>\
|
||||
@ -1815,7 +1838,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1826,34 +1849,40 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP7 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
|
||||
p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
@ -1861,7 +1890,6 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
|
||||
p6)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -1870,19 +1898,23 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
}\
|
||||
name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
|
||||
p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
|
||||
p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
|
||||
p6(gmock_p6) {\
|
||||
p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
@ -1900,7 +1932,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -1911,35 +1943,42 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP8 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6, p7##_type gmock_p7)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
|
||||
p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)), \
|
||||
p7(::testing::internal::move(gmock_p7)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
p7##_type const p7;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
@ -1947,7 +1986,6 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
|
||||
p3, p4, p5, p6, p7)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -1957,20 +1995,24 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
|
||||
p5##_type gmock_p5, p6##_type gmock_p6, \
|
||||
p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
|
||||
p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
|
||||
p7(gmock_p7) {\
|
||||
p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)), \
|
||||
p7(::testing::internal::move(gmock_p7)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
p7##_type const p7;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
@ -1990,7 +2032,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type, \
|
||||
p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -2001,37 +2043,44 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP9 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
|
||||
p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
|
||||
p8(gmock_p8) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)), \
|
||||
p7(::testing::internal::move(gmock_p7)), \
|
||||
p8(::testing::internal::move(gmock_p8)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
p7##_type const p7;\
|
||||
p8##_type const p8;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
@ -2039,7 +2088,6 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, \
|
||||
p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -2049,21 +2097,26 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
|
||||
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
|
||||
p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
|
||||
p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
|
||||
p8(gmock_p8) {\
|
||||
p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)), \
|
||||
p7(::testing::internal::move(gmock_p7)), \
|
||||
p8(::testing::internal::move(gmock_p8)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
p7##_type const p7;\
|
||||
p8##_type const p8;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
@ -2084,7 +2137,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type, p7##_type, \
|
||||
p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
@ -2096,39 +2149,47 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
class name##MatcherP10 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
|
||||
p9##_type gmock_p9)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
|
||||
p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
|
||||
p8(gmock_p8), p9(gmock_p9) {}\
|
||||
: p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)), \
|
||||
p7(::testing::internal::move(gmock_p7)), \
|
||||
p8(::testing::internal::move(gmock_p8)), \
|
||||
p9(::testing::internal::move(gmock_p9)) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p9##_type p9;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
p7##_type const p7;\
|
||||
p8##_type const p8;\
|
||||
p9##_type const p9;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
@ -2136,7 +2197,6 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
|
||||
p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -2146,22 +2206,29 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
|
||||
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
|
||||
p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
|
||||
p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
|
||||
p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
|
||||
p8##_type gmock_p8, \
|
||||
p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \
|
||||
p1(::testing::internal::move(gmock_p1)), \
|
||||
p2(::testing::internal::move(gmock_p2)), \
|
||||
p3(::testing::internal::move(gmock_p3)), \
|
||||
p4(::testing::internal::move(gmock_p4)), \
|
||||
p5(::testing::internal::move(gmock_p5)), \
|
||||
p6(::testing::internal::move(gmock_p6)), \
|
||||
p7(::testing::internal::move(gmock_p7)), \
|
||||
p8(::testing::internal::move(gmock_p8)), \
|
||||
p9(::testing::internal::move(gmock_p9)) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p9##_type p9;\
|
||||
p0##_type const p0;\
|
||||
p1##_type const p1;\
|
||||
p2##_type const p2;\
|
||||
p3##_type const p3;\
|
||||
p4##_type const p4;\
|
||||
p5##_type const p5;\
|
||||
p6##_type const p6;\
|
||||
p7##_type const p7;\
|
||||
p8##_type const p8;\
|
||||
p9##_type const p9;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
@ -2184,7 +2251,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
|
||||
p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
|
@ -303,6 +303,9 @@ $for j, [[
|
||||
|
||||
// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
|
||||
// that matches n elements in any order. We support up to n=$n arguments.
|
||||
//
|
||||
// If you have >$n elements, consider UnorderedElementsAreArray() or
|
||||
// UnorderedPointwise() instead.
|
||||
|
||||
$range i 0..n
|
||||
$for i [[
|
||||
@ -479,7 +482,7 @@ $$ // show up in the generated code.
|
||||
// using testing::PrintToString;
|
||||
//
|
||||
// MATCHER_P2(InClosedRange, low, hi,
|
||||
// string(negation ? "is not" : "is") + " in range [" +
|
||||
// std::string(negation ? "is not" : "is") + " in range [" +
|
||||
// PrintToString(low) + ", " + PrintToString(hi) + "]") {
|
||||
// return low <= arg && arg <= hi;
|
||||
// }
|
||||
@ -604,32 +607,34 @@ $var template = [[$if i==0 [[]] $else [[
|
||||
]]]]
|
||||
$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
|
||||
$var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
|
||||
$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
|
||||
$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
|
||||
$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]]
|
||||
$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]]
|
||||
$var params = [[$for j, [[p$j]]]]
|
||||
$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
|
||||
$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
|
||||
$var param_field_decls = [[$for j
|
||||
[[
|
||||
|
||||
p$j##_type p$j;\
|
||||
p$j##_type const p$j;\
|
||||
]]]]
|
||||
$var param_field_decls2 = [[$for j
|
||||
[[
|
||||
|
||||
p$j##_type p$j;\
|
||||
p$j##_type const p$j;\
|
||||
]]]]
|
||||
|
||||
#define $macro_name(name$for j [[, p$j]], description)\$template
|
||||
class $class_name {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type)> {\
|
||||
public:\
|
||||
[[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\
|
||||
$impl_inits {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
@ -637,17 +642,15 @@ $var param_field_decls2 = [[$for j
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\$param_field_decls
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty()) {\
|
||||
::std::string FormatDescription(bool negation) const {\
|
||||
::std::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
}\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
@ -657,14 +660,13 @@ $var param_field_decls2 = [[$for j
|
||||
[[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {\
|
||||
}\$param_field_decls2
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_($class_name);\
|
||||
};\$template
|
||||
inline $class_name$param_types name($param_types_and_names) {\
|
||||
return $class_name$param_types($params);\
|
||||
}\$template
|
||||
template <typename arg_type>\
|
||||
bool $class_name$param_types::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
]]
|
||||
|
@ -5202,15 +5202,29 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
|
||||
// Define variadic matcher versions. They are overloaded in
|
||||
// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
|
||||
template <typename... Args>
|
||||
inline internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) {
|
||||
internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) {
|
||||
return internal::AllOfMatcher<Args...>(matchers...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
inline internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {
|
||||
internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {
|
||||
return internal::AnyOfMatcher<Args...>(matchers...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
internal::ElementsAreMatcher<tuple<typename std::decay<Args>::type...>>
|
||||
ElementsAre(const Args&... matchers) {
|
||||
return internal::ElementsAreMatcher<
|
||||
tuple<typename std::decay<Args>::type...>>(make_tuple(matchers...));
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
internal::UnorderedElementsAreMatcher<tuple<typename std::decay<Args>::type...>>
|
||||
UnorderedElementsAre(const Args&... matchers) {
|
||||
return internal::UnorderedElementsAreMatcher<
|
||||
tuple<typename std::decay<Args>::type...>>(make_tuple(matchers...));
|
||||
}
|
||||
|
||||
#endif // GTEST_LANG_CXX11
|
||||
|
||||
// AllArgs(m) is a synonym of m. This is useful in
|
||||
|
@ -31,10 +31,19 @@
|
||||
//
|
||||
// This file tests the built-in matchers generated by a script.
|
||||
|
||||
// Silence warning C4244: 'initializing': conversion from 'int' to 'short',
|
||||
// possible loss of data and C4100, unreferenced local parameter
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4244)
|
||||
# pragma warning(disable:4100)
|
||||
#endif
|
||||
|
||||
#include "gmock/gmock-generated-matchers.h"
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@ -57,6 +66,8 @@ using testing::get;
|
||||
using testing::make_tuple;
|
||||
using testing::tuple;
|
||||
using testing::_;
|
||||
using testing::AllOf;
|
||||
using testing::AnyOf;
|
||||
using testing::Args;
|
||||
using testing::Contains;
|
||||
using testing::ElementsAre;
|
||||
@ -120,7 +131,7 @@ TEST(ArgsTest, AcceptsOneTemplateArg) {
|
||||
}
|
||||
|
||||
TEST(ArgsTest, AcceptsTwoTemplateArgs) {
|
||||
const tuple<short, int, long> t(static_cast<short>(4), 5, 6L); // NOLINT
|
||||
const tuple<short, int, long> t(4, 5, 6L); // NOLINT
|
||||
|
||||
EXPECT_THAT(t, (Args<0, 1>(Lt())));
|
||||
EXPECT_THAT(t, (Args<1, 2>(Lt())));
|
||||
@ -128,13 +139,13 @@ TEST(ArgsTest, AcceptsTwoTemplateArgs) {
|
||||
}
|
||||
|
||||
TEST(ArgsTest, AcceptsRepeatedTemplateArgs) {
|
||||
const tuple<short, int, long> t(static_cast<short>(4), 5, 6L); // NOLINT
|
||||
const tuple<short, int, long> t(4, 5, 6L); // NOLINT
|
||||
EXPECT_THAT(t, (Args<0, 0>(Eq())));
|
||||
EXPECT_THAT(t, Not(Args<1, 1>(Ne())));
|
||||
}
|
||||
|
||||
TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
|
||||
const tuple<short, int, long> t(static_cast<short>(4), 5, 6L); // NOLINT
|
||||
const tuple<short, int, long> t(4, 5, 6L); // NOLINT
|
||||
EXPECT_THAT(t, (Args<2, 0>(Gt())));
|
||||
EXPECT_THAT(t, Not(Args<2, 1>(Lt())));
|
||||
}
|
||||
@ -159,7 +170,7 @@ TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) {
|
||||
}
|
||||
|
||||
TEST(ArgsTest, CanBeNested) {
|
||||
const tuple<short, int, long, int> t(static_cast<short>(4), 5, 6L, 6); // NOLINT
|
||||
const tuple<short, int, long, int> t(4, 5, 6L, 6); // NOLINT
|
||||
EXPECT_THAT(t, (Args<1, 2, 3>(Args<1, 2>(Eq()))));
|
||||
EXPECT_THAT(t, (Args<0, 1, 3>(Args<0, 2>(Lt()))));
|
||||
}
|
||||
@ -1283,4 +1294,48 @@ TEST(AnyOfTest, DoesNotCallAnyOfUnqualified) {
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
|
||||
TEST(AllOfTest, WorksOnMoveOnlyType) {
|
||||
std::unique_ptr<int> p(new int(3));
|
||||
EXPECT_THAT(p, AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(5))));
|
||||
EXPECT_THAT(p, Not(AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(3)))));
|
||||
}
|
||||
|
||||
TEST(AnyOfTest, WorksOnMoveOnlyType) {
|
||||
std::unique_ptr<int> p(new int(3));
|
||||
EXPECT_THAT(p, AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Lt(5))));
|
||||
EXPECT_THAT(p, Not(AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Gt(5)))));
|
||||
}
|
||||
|
||||
MATCHER(IsNotNull, "") {
|
||||
return arg != nullptr;
|
||||
}
|
||||
|
||||
// Verifies that a matcher defined using MATCHER() can work on
|
||||
// move-only types.
|
||||
TEST(MatcherMacroTest, WorksOnMoveOnlyType) {
|
||||
std::unique_ptr<int> p(new int(3));
|
||||
EXPECT_THAT(p, IsNotNull());
|
||||
EXPECT_THAT(std::unique_ptr<int>(), Not(IsNotNull()));
|
||||
}
|
||||
|
||||
MATCHER_P(UniquePointee, pointee, "") {
|
||||
return *arg == pointee;
|
||||
}
|
||||
|
||||
// Verifies that a matcher defined using MATCHER_P*() can work on
|
||||
// move-only types.
|
||||
TEST(MatcherPMacroTest, WorksOnMoveOnlyType) {
|
||||
std::unique_ptr<int> p(new int(3));
|
||||
EXPECT_THAT(p, UniquePointee(3));
|
||||
EXPECT_THAT(p, Not(UniquePointee(2)));
|
||||
}
|
||||
|
||||
#endif // GTEST_LASNG_CXX11
|
||||
|
||||
} // namespace
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
@ -2742,6 +2742,24 @@ TEST(AnyOfTest, VariadicMatchesWhenAnyMatches) {
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50));
|
||||
}
|
||||
|
||||
// Tests the variadic version of the ElementsAreMatcher
|
||||
TEST(ElementsAreTest, HugeMatcher) {
|
||||
vector<int> test_vector{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
|
||||
|
||||
EXPECT_THAT(test_vector,
|
||||
ElementsAre(Eq(1), Eq(2), Lt(13), Eq(4), Eq(5), Eq(6), Eq(7),
|
||||
Eq(8), Eq(9), Eq(10), Gt(1), Eq(12)));
|
||||
}
|
||||
|
||||
// Tests the variadic version of the UnorderedElementsAreMatcher
|
||||
TEST(ElementsAreTest, HugeMatcherUnordered) {
|
||||
vector<int> test_vector{2, 1, 8, 5, 4, 6, 7, 3, 9, 12, 11, 10};
|
||||
|
||||
EXPECT_THAT(test_vector, UnorderedElementsAre(
|
||||
Eq(2), Eq(1), Gt(7), Eq(5), Eq(4), Eq(6), Eq(7),
|
||||
Eq(3), Eq(9), Eq(12), Eq(11), Ne(122)));
|
||||
}
|
||||
|
||||
#endif // GTEST_LANG_CXX11
|
||||
|
||||
// Tests that AnyOf(m1, ..., mn) describes itself properly.
|
||||
|
Loading…
Reference in New Issue
Block a user