Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::any_cast_matcher::AnyCastMatcher< T > Class Template Reference

#include <gmock-matchers.h>

Public Member Functions

 AnyCastMatcher (const ::testing::Matcher< const T & > &matcher)
 
template<typename AnyType >
bool MatchAndExplain (const AnyType &value, ::testing::MatchResultListener *listener) const
 
void DescribeTo (std::ostream *os) const
 
void DescribeNegationTo (std::ostream *os) const
 

Detailed Description

template<typename T>
class testing::internal::any_cast_matcher::AnyCastMatcher< T >

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

Constructor & Destructor Documentation

◆ AnyCastMatcher()

template<typename T >
testing::internal::any_cast_matcher::AnyCastMatcher< T >::AnyCastMatcher ( const ::testing::Matcher< const T & > & matcher)
inlineexplicit

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

4126 : matcher_(matcher) {}

Member Function Documentation

◆ DescribeNegationTo()

template<typename T >
void testing::internal::any_cast_matcher::AnyCastMatcher< T >::DescribeNegationTo ( std::ostream * os) const
inline

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

4156 {
4157 *os << "is an 'any' type with value of type other than '" << GetTypeName()
4158 << "' or the value ";
4159 matcher_.DescribeNegationTo(os);
4160 }
void DescribeNegationTo(::std::ostream *os) const
os_t os
Here is the call graph for this function:

◆ DescribeTo()

template<typename T >
void testing::internal::any_cast_matcher::AnyCastMatcher< T >::DescribeTo ( std::ostream * os) const
inline

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

4150 {
4151 *os << "is an 'any' type with value of type '" << GetTypeName()
4152 << "' and the value ";
4153 matcher_.DescribeTo(os);
4154 }
void DescribeTo(::std::ostream *os) const
Here is the call graph for this function:

◆ MatchAndExplain()

template<typename T >
template<typename AnyType >
bool testing::internal::any_cast_matcher::AnyCastMatcher< T >::MatchAndExplain ( const AnyType & value,
::testing::MatchResultListener * listener ) const
inline

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

4130 {
4131 if (!listener->IsInterested()) {
4132 const T* ptr = any_cast<T>(&value);
4133 return ptr != NULL && matcher_.Matches(*ptr);
4134 }
4135
4136 const T* elem = any_cast<T>(&value);
4137 if (elem == NULL) {
4138 *listener << "whose value is not of type '" << GetTypeName() << "'";
4139 return false;
4140 }
4141
4142 StringMatchResultListener elem_listener;
4143 const bool match = matcher_.MatchAndExplain(*elem, &elem_listener);
4144 *listener << "whose value " << PrintToString(*elem)
4145 << (match ? " matches" : " doesn't match");
4146 PrintIfNotEmpty(elem_listener.str(), listener->stream());
4147 return match;
4148 }
bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x, MatchResultListener *listener) const
bool Matches(GTEST_REFERENCE_TO_CONST_(T) x) const
void PrintIfNotEmpty(const std::string &explanation, ::std::ostream *os)
::std::string PrintToString(const T &value)
#define value
Definition pkcs11.h:157
#define T(meth, val, expected)
Here is the call graph for this function:

The documentation for this class was generated from the following file: