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

#include <gmock-matchers.h>

Public Member Functions

 VariantMatcher (::testing::Matcher< const T & > matcher)
 
template<typename Variant >
bool MatchAndExplain (const Variant &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::variant_matcher::VariantMatcher< T >

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

Constructor & Destructor Documentation

◆ VariantMatcher()

template<typename T >
testing::internal::variant_matcher::VariantMatcher< T >::VariantMatcher ( ::testing::Matcher< const T & > matcher)
inlineexplicit

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

4066 : matcher_(internal::move(matcher)) {}
const T & move(const T &t)

Member Function Documentation

◆ DescribeNegationTo()

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

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

4095 {
4096 *os << "is a variant<> with value of type other than '" << GetTypeName()
4097 << "' or the value ";
4098 matcher_.DescribeNegationTo(os);
4099 }
void DescribeNegationTo(::std::ostream *os) const
os_t os
Here is the call graph for this function:

◆ DescribeTo()

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

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

4089 {
4090 *os << "is a variant<> with value of type '" << GetTypeName()
4091 << "' and the value ";
4092 matcher_.DescribeTo(os);
4093 }
void DescribeTo(::std::ostream *os) const
Here is the call graph for this function:

◆ MatchAndExplain()

template<typename T >
template<typename Variant >
bool testing::internal::variant_matcher::VariantMatcher< T >::MatchAndExplain ( const Variant & value,
::testing::MatchResultListener * listener ) const
inline

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

4070 {
4071 if (!listener->IsInterested()) {
4072 return holds_alternative<T>(value) && matcher_.Matches(get<T>(value));
4073 }
4074
4076 *listener << "whose value is not of type '" << GetTypeName() << "'";
4077 return false;
4078 }
4079
4080 const T& elem = get<T>(value);
4081 StringMatchResultListener elem_listener;
4082 const bool match = matcher_.MatchAndExplain(elem, &elem_listener);
4083 *listener << "whose value " << PrintToString(elem)
4084 << (match ? " matches" : " doesn't match");
4085 PrintIfNotEmpty(elem_listener.str(), listener->stream());
4086 return match;
4087 }
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: