Electroneum
Loading...
Searching...
No Matches
testing::internal::BothOfMatcherImpl< T > Class Template Reference

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::BothOfMatcherImpl< T >:
Collaboration diagram for testing::internal::BothOfMatcherImpl< T >:

Public Member Functions

 BothOfMatcherImpl (const Matcher< T > &matcher1, const Matcher< T > &matcher2)
virtual void DescribeTo (::std::ostream *os) const
virtual void DescribeNegationTo (::std::ostream *os) const
virtual bool MatchAndExplain (T x, MatchResultListener *listener) const
Public Member Functions inherited from testing::MatcherDescriberInterface
virtual ~MatcherDescriberInterface ()

Detailed Description

template<typename T>
class testing::internal::BothOfMatcherImpl< T >

Definition at line 1492 of file gmock-matchers.h.

Constructor & Destructor Documentation

◆ BothOfMatcherImpl()

template<typename T>
testing::internal::BothOfMatcherImpl< T >::BothOfMatcherImpl ( const Matcher< T > & matcher1,
const Matcher< T > & matcher2 )
inline

Definition at line 1494 of file gmock-matchers.h.

Member Function Documentation

◆ DescribeNegationTo()

template<typename T>
virtual void testing::internal::BothOfMatcherImpl< T >::DescribeNegationTo ( ::std::ostream * os) const
inlinevirtual

Reimplemented from testing::MatcherDescriberInterface.

Definition at line 1505 of file gmock-matchers.h.

1505 {
1506 *os << "(";
1507 matcher1_.DescribeNegationTo(os);
1508 *os << ") or (";
1509 matcher2_.DescribeNegationTo(os);
1510 *os << ")";
1511 }
virtual void DescribeNegationTo(::std::ostream *os) const

◆ DescribeTo()

template<typename T>
virtual void testing::internal::BothOfMatcherImpl< T >::DescribeTo ( ::std::ostream * os) const
inlinevirtual

Implements testing::MatcherDescriberInterface.

Definition at line 1497 of file gmock-matchers.h.

1497 {
1498 *os << "(";
1499 matcher1_.DescribeTo(os);
1500 *os << ") and (";
1501 matcher2_.DescribeTo(os);
1502 *os << ")";
1503 }
virtual void DescribeTo(::std::ostream *os) const

◆ MatchAndExplain()

template<typename T>
virtual bool testing::internal::BothOfMatcherImpl< T >::MatchAndExplain ( T x,
MatchResultListener * listener ) const
inlinevirtual

Implements testing::MatcherInterface< T >.

Definition at line 1513 of file gmock-matchers.h.

1513 {
1514 // If either matcher1_ or matcher2_ doesn't match x, we only need
1515 // to explain why one of them fails.
1517 if (!matcher1_.MatchAndExplain(x, &listener1)) {
1518 *listener << listener1.str();
1519 return false;
1520 }
1521
1523 if (!matcher2_.MatchAndExplain(x, &listener2)) {
1524 *listener << listener2.str();
1525 return false;
1526 }
1527
1528 // Otherwise we need to explain why *both* of them match.
1529 const internal::string s1 = listener1.str();
1530 const internal::string s2 = listener2.str();
1531
1532 if (s1 == "") {
1533 *listener << s2;
1534 } else {
1535 *listener << s1;
1536 if (s2 != "") {
1537 *listener << ", and " << s2;
1538 }
1539 }
1540 return true;
1541 }
Here is the call graph for this function:

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h