Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
gmock-matchers.h File Reference
#include <math.h>
#include <algorithm>
#include <iterator>
#include <limits>
#include <ostream>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include "gtest/gtest.h"
#include "gmock/internal/gmock-internal-utils.h"
#include "gmock/internal/gmock-port.h"
#include "gmock/internal/custom/gmock-matchers.h"
Include dependency graph for gmock-matchers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  testing::MatchResultListener
 
class  testing::MatcherDescriberInterface
 
class  testing::MatcherInterface< T >
 
class  testing::internal::MatcherInterfaceAdapter< T >
 
class  testing::StringMatchResultListener
 
struct  testing::internal::AnyEq
 
struct  testing::internal::AnyNe
 
struct  testing::internal::AnyLt
 
struct  testing::internal::AnyGt
 
struct  testing::internal::AnyLe
 
struct  testing::internal::AnyGe
 
class  testing::internal::DummyMatchResultListener
 
class  testing::internal::StreamMatchResultListener
 
class  testing::internal::MatcherBase< T >
 
class  testing::Matcher< T >
 
class  testing::Matcher< const std::string & >
 
class  testing::Matcher< std::string >
 
class  testing::PolymorphicMatcher< Impl >
 
class  testing::internal::MatcherCastImpl< T, M >
 
class  testing::internal::MatcherCastImpl< T, Matcher< U > >
 
class  testing::internal::MatcherCastImpl< T, Matcher< T > >
 
class  testing::SafeMatcherCastImpl< T >
 
class  testing::internal::TuplePrefix< N >
 
class  testing::internal::TuplePrefix< 0 >
 
class  testing::internal::TransformTupleValuesHelper< Tuple, Func, OutIter >
 
class  testing::internal::AnyMatcherImpl< T >
 
class  testing::internal::AnythingMatcher
 
class  testing::internal::ComparisonBase< D, Rhs, Op >
 
class  testing::internal::EqMatcher< Rhs >
 
class  testing::internal::NeMatcher< Rhs >
 
class  testing::internal::LtMatcher< Rhs >
 
class  testing::internal::GtMatcher< Rhs >
 
class  testing::internal::LeMatcher< Rhs >
 
class  testing::internal::GeMatcher< Rhs >
 
class  testing::internal::IsNullMatcher
 
class  testing::internal::NotNullMatcher
 
class  testing::internal::RefMatcher< T & >
 
class  testing::internal::StrEqualityMatcher< StringType >
 
class  testing::internal::HasSubstrMatcher< StringType >
 
class  testing::internal::StartsWithMatcher< StringType >
 
class  testing::internal::EndsWithMatcher< StringType >
 
class  testing::internal::MatchesRegexMatcher
 
class  testing::internal::PairMatchBase< D, Op >
 
class  testing::internal::Eq2Matcher
 
class  testing::internal::Ne2Matcher
 
class  testing::internal::Lt2Matcher
 
class  testing::internal::Gt2Matcher
 
class  testing::internal::Le2Matcher
 
class  testing::internal::Ge2Matcher
 
class  testing::internal::NotMatcherImpl< T >
 
class  testing::internal::NotMatcher< InnerMatcher >
 
class  testing::internal::AllOfMatcherImpl< T >
 
class  testing::internal::BothOfMatcher< Matcher1, Matcher2 >
 
class  testing::internal::AnyOfMatcherImpl< T >
 
class  testing::internal::EitherOfMatcher< Matcher1, Matcher2 >
 
class  testing::internal::TrulyMatcher< Predicate >
 
class  testing::internal::MatcherAsPredicate< M >
 
class  testing::internal::PredicateFormatterFromMatcher< M >
 
class  testing::internal::FloatingEqMatcher< FloatType >
 
class  testing::internal::FloatingEqMatcher< FloatType >::Impl< T >
 
class  testing::internal::FloatingEq2Matcher< FloatType >
 
class  testing::internal::PointeeMatcher< InnerMatcher >
 
class  testing::internal::FieldMatcher< Class, FieldType >
 
class  testing::internal::PropertyMatcher< Class, PropertyType, Property >
 
struct  testing::internal::CallableTraits< Functor >
 
struct  testing::internal::CallableTraits< ResType(*)(ArgType)>
 
class  testing::internal::ResultOfMatcher< Callable >
 
class  testing::internal::SizeIsMatcher< SizeMatcher >
 
class  testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >
 
class  testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >
 
class  testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >
 
class  testing::internal::ContainerEqMatcher< Container >
 
struct  testing::internal::LessComparator
 
class  testing::internal::WhenSortedByMatcher< Comparator, ContainerMatcher >
 
class  testing::internal::WhenSortedByMatcher< Comparator, ContainerMatcher >::Impl< LhsContainer >
 
class  testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >
 
class  testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >
 
class  testing::internal::QuantifierMatcherImpl< Container >
 
class  testing::internal::ContainsMatcherImpl< Container >
 
class  testing::internal::EachMatcherImpl< Container >
 
class  testing::internal::ContainsMatcher< M >
 
class  testing::internal::EachMatcher< M >
 
struct  testing::internal::Rank1
 
struct  testing::internal::Rank0
 
class  testing::internal::KeyMatcherImpl< PairType >
 
class  testing::internal::KeyMatcher< M >
 
class  testing::internal::PairMatcherImpl< PairType >
 
class  testing::internal::PairMatcher< FirstMatcher, SecondMatcher >
 
class  testing::internal::ElementsAreMatcherImpl< Container >
 
class  testing::internal::MatchMatrix
 
struct  testing::internal::UnorderedMatcherRequire
 
class  testing::internal::UnorderedElementsAreMatcherImplBase
 
class  testing::internal::UnorderedElementsAreMatcherImpl< Container >
 
struct  testing::internal::CastAndAppendTransform< Target >
 
class  testing::internal::UnorderedElementsAreMatcher< MatcherTuple >
 
class  testing::internal::ElementsAreMatcher< MatcherTuple >
 
class  testing::internal::UnorderedElementsAreArrayMatcher< T >
 
class  testing::internal::ElementsAreArrayMatcher< T >
 
class  testing::internal::BoundSecondMatcher< Tuple2Matcher, Second >
 
class  testing::internal::OptionalMatcher< ValueMatcher >
 
class  testing::internal::OptionalMatcher< ValueMatcher >::Impl< Optional >
 
class  testing::internal::variant_matcher::VariantMatcher< T >
 
class  testing::internal::any_cast_matcher::AnyCastMatcher< T >
 

Namespaces

namespace  testing
 
namespace  testing::internal
 
namespace  testing::internal::pair_getters
 
namespace  testing::internal::variant_matcher
 
namespace  testing::internal::any_cast_matcher
 

Macros

#define ASSERT_THAT(value, matcher)
 
#define EXPECT_THAT(value, matcher)
 

Typedefs

typedef ::std::pair< size_t, size_t > testing::internal::ElementMatcherPair
 
typedef ::std::vector< ElementMatcherPairtesting::internal::ElementMatcherPairs
 

Functions

template<typename T >
std::ostream & testing::operator<< (std::ostream &os, const Matcher< T > &matcher)
 
template<typename T >
Matcher< Ttesting::MakeMatcher (const MatcherInterface< T > *impl)
 
template<class Impl >
PolymorphicMatcher< Impl > testing::MakePolymorphicMatcher (const Impl &impl)
 
template<typename T , typename M >
Matcher< Ttesting::MatcherCast (const M &matcher)
 
template<typename T , typename M >
Matcher< Ttesting::SafeMatcherCast (const M &polymorphic_matcher)
 
template<typename T >
Matcher< Ttesting::A ()
 
void testing::internal::PrintIfNotEmpty (const std::string &explanation, ::std::ostream *os)
 
bool testing::internal::IsReadableTypeName (const std::string &type_name)
 
template<typename Value , typename T >
bool testing::internal::MatchPrintAndExplain (Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
 
template<typename MatcherTuple , typename ValueTuple >
bool testing::internal::TupleMatches (const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
 
template<typename MatcherTuple , typename ValueTuple >
void testing::internal::ExplainMatchFailureTupleTo (const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
 
template<typename Tuple , typename Func , typename OutIter >
OutIter testing::internal::TransformTupleValues (Func f, const Tuple &t, OutIter out)
 
bool testing::internal::CaseInsensitiveCStringEquals (const char *lhs, const char *rhs)
 
bool testing::internal::CaseInsensitiveCStringEquals (const wchar_t *lhs, const wchar_t *rhs)
 
template<typename StringType >
bool testing::internal::CaseInsensitiveStringEquals (const StringType &s1, const StringType &s2)
 
template<typename M >
PredicateFormatterFromMatcher< M > testing::internal::MakePredicateFormatterFromMatcher (M matcher)
 
template<typename T >
T::first_type & testing::internal::pair_getters::First (T &x, Rank0)
 
template<typename T >
const T::first_type & testing::internal::pair_getters::First (const T &x, Rank0)
 
template<typename T >
T::second_type & testing::internal::pair_getters::Second (T &x, Rank0)
 
template<typename T >
const T::second_type & testing::internal::pair_getters::Second (const T &x, Rank0)
 
GTEST_API_ ElementMatcherPairs testing::internal::FindMaxBipartiteMatching (const MatchMatrix &g)
 
template<typename Tuple2Matcher , typename Second >
BoundSecondMatcher< Tuple2Matcher, Second > testing::internal::MatcherBindSecond (const Tuple2Matcher &tm, const Second &second)
 
GTEST_API_ std::string testing::internal::FormatMatcherDescription (bool negation, const char *matcher_name, const Strings &param_values)
 
template<typename T >
void testing::internal::variant_matcher::holds_alternative ()
 
template<typename T >
void testing::internal::variant_matcher::get ()
 
template<typename T >
void testing::internal::any_cast_matcher::any_cast ()
 
template<typename Iter >
internal::ElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > testing::ElementsAreArray (Iter first, Iter last)
 
template<typename T >
internal::ElementsAreArrayMatcher< Ttesting::ElementsAreArray (const T *pointer, size_t count)
 
template<typename T , size_t N>
internal::ElementsAreArrayMatcher< Ttesting::ElementsAreArray (const T(&array)[N])
 
template<typename Container >
internal::ElementsAreArrayMatcher< typename Container::value_type > testing::ElementsAreArray (const Container &container)
 
template<typename Iter >
internal::UnorderedElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > testing::UnorderedElementsAreArray (Iter first, Iter last)
 
template<typename T >
internal::UnorderedElementsAreArrayMatcher< Ttesting::UnorderedElementsAreArray (const T *pointer, size_t count)
 
template<typename T , size_t N>
internal::UnorderedElementsAreArrayMatcher< Ttesting::UnorderedElementsAreArray (const T(&array)[N])
 
template<typename Container >
internal::UnorderedElementsAreArrayMatcher< typename Container::value_type > testing::UnorderedElementsAreArray (const Container &container)
 
template<typename T >
Matcher< Ttesting::An ()
 
template<typename T >
internal::EqMatcher< Ttesting::Eq (T x)
 
template<typename Lhs , typename Rhs >
Matcher< Lhs > testing::TypedEq (const Rhs &rhs)
 
template<typename Rhs >
internal::GeMatcher< Rhs > testing::Ge (Rhs x)
 
template<typename Rhs >
internal::GtMatcher< Rhs > testing::Gt (Rhs x)
 
template<typename Rhs >
internal::LeMatcher< Rhs > testing::Le (Rhs x)
 
template<typename Rhs >
internal::LtMatcher< Rhs > testing::Lt (Rhs x)
 
template<typename Rhs >
internal::NeMatcher< Rhs > testing::Ne (Rhs x)
 
PolymorphicMatcher< internal::IsNullMatchertesting::IsNull ()
 
PolymorphicMatcher< internal::NotNullMatchertesting::NotNull ()
 
template<typename T >
internal::RefMatcher< T & > testing::Ref (T &x)
 
internal::FloatingEqMatcher< double > testing::DoubleEq (double rhs)
 
internal::FloatingEqMatcher< double > testing::NanSensitiveDoubleEq (double rhs)
 
internal::FloatingEqMatcher< double > testing::DoubleNear (double rhs, double max_abs_error)
 
internal::FloatingEqMatcher< double > testing::NanSensitiveDoubleNear (double rhs, double max_abs_error)
 
internal::FloatingEqMatcher< float > testing::FloatEq (float rhs)
 
internal::FloatingEqMatcher< float > testing::NanSensitiveFloatEq (float rhs)
 
internal::FloatingEqMatcher< float > testing::FloatNear (float rhs, float max_abs_error)
 
internal::FloatingEqMatcher< float > testing::NanSensitiveFloatNear (float rhs, float max_abs_error)
 
template<typename InnerMatcher >
internal::PointeeMatcher< InnerMatcher > testing::Pointee (const InnerMatcher &inner_matcher)
 
template<typename Class , typename FieldType , typename FieldMatcher >
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > testing::Field (FieldType Class::*field, const FieldMatcher &matcher)
 
template<typename Class , typename FieldType , typename FieldMatcher >
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > testing::Field (const std::string &field_name, FieldType Class::*field, const FieldMatcher &matcher)
 
template<typename Class , typename PropertyType , typename PropertyMatcher >
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType, PropertyType(Class::*)() const > > testing::Property (PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
 
template<typename Class , typename PropertyType , typename PropertyMatcher >
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType, PropertyType(Class::*)() const > > testing::Property (const std::string &property_name, PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
 
template<typename Callable , typename ResultOfMatcher >
internal::ResultOfMatcher< Callable > testing::ResultOf (Callable callable, const ResultOfMatcher &matcher)
 
PolymorphicMatcher< internal::StrEqualityMatcher< std::string > > testing::StrEq (const std::string &str)
 
PolymorphicMatcher< internal::StrEqualityMatcher< std::string > > testing::StrNe (const std::string &str)
 
PolymorphicMatcher< internal::StrEqualityMatcher< std::string > > testing::StrCaseEq (const std::string &str)
 
PolymorphicMatcher< internal::StrEqualityMatcher< std::string > > testing::StrCaseNe (const std::string &str)
 
PolymorphicMatcher< internal::HasSubstrMatcher< std::string > > testing::HasSubstr (const std::string &substring)
 
PolymorphicMatcher< internal::StartsWithMatcher< std::string > > testing::StartsWith (const std::string &prefix)
 
PolymorphicMatcher< internal::EndsWithMatcher< std::string > > testing::EndsWith (const std::string &suffix)
 
PolymorphicMatcher< internal::MatchesRegexMatchertesting::MatchesRegex (const internal::RE *regex)
 
PolymorphicMatcher< internal::MatchesRegexMatchertesting::MatchesRegex (const std::string &regex)
 
PolymorphicMatcher< internal::MatchesRegexMatchertesting::ContainsRegex (const internal::RE *regex)
 
PolymorphicMatcher< internal::MatchesRegexMatchertesting::ContainsRegex (const std::string &regex)
 
internal::Eq2Matcher testing::Eq ()
 
internal::Ge2Matcher testing::Ge ()
 
internal::Gt2Matcher testing::Gt ()
 
internal::Le2Matcher testing::Le ()
 
internal::Lt2Matcher testing::Lt ()
 
internal::Ne2Matcher testing::Ne ()
 
internal::FloatingEq2Matcher< float > testing::FloatEq ()
 
internal::FloatingEq2Matcher< double > testing::DoubleEq ()
 
internal::FloatingEq2Matcher< float > testing::NanSensitiveFloatEq ()
 
internal::FloatingEq2Matcher< double > testing::NanSensitiveDoubleEq ()
 
internal::FloatingEq2Matcher< float > testing::FloatNear (float max_abs_error)
 
internal::FloatingEq2Matcher< double > testing::DoubleNear (double max_abs_error)
 
internal::FloatingEq2Matcher< float > testing::NanSensitiveFloatNear (float max_abs_error)
 
internal::FloatingEq2Matcher< double > testing::NanSensitiveDoubleNear (double max_abs_error)
 
template<typename InnerMatcher >
internal::NotMatcher< InnerMatcher > testing::Not (InnerMatcher m)
 
template<typename Predicate >
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > testing::Truly (Predicate pred)
 
template<typename SizeMatcher >
internal::SizeIsMatcher< SizeMatcher > testing::SizeIs (const SizeMatcher &size_matcher)
 
template<typename DistanceMatcher >
internal::BeginEndDistanceIsMatcher< DistanceMatcher > testing::BeginEndDistanceIs (const DistanceMatcher &distance_matcher)
 
template<typename Container >
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > testing::ContainerEq (const Container &rhs)
 
template<typename Comparator , typename ContainerMatcher >
internal::WhenSortedByMatcher< Comparator, ContainerMatcher > testing::WhenSortedBy (const Comparator &comparator, const ContainerMatcher &container_matcher)
 
template<typename ContainerMatcher >
internal::WhenSortedByMatcher< internal::LessComparator, ContainerMatcher > testing::WhenSorted (const ContainerMatcher &container_matcher)
 
template<typename TupleMatcher , typename Container >
internal::PointwiseMatcher< TupleMatcher, GTEST_REMOVE_CONST_(Container)> testing::Pointwise (const TupleMatcher &tuple_matcher, const Container &rhs)
 
template<typename Tuple2Matcher , typename RhsContainer >
internal::UnorderedElementsAreArrayMatcher< typename internal::BoundSecondMatcher< Tuple2Matcher, typename internal::StlContainerView< GTEST_REMOVE_CONST_(RhsContainer)>::type::value_type > > testing::UnorderedPointwise (const Tuple2Matcher &tuple2_matcher, const RhsContainer &rhs_container)
 
template<typename M >
internal::ContainsMatcher< M > testing::Contains (M matcher)
 
template<typename Iter >
internal::UnorderedElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > testing::IsSupersetOf (Iter first, Iter last)
 
template<typename T >
internal::UnorderedElementsAreArrayMatcher< Ttesting::IsSupersetOf (const T *pointer, size_t count)
 
template<typename T , size_t N>
internal::UnorderedElementsAreArrayMatcher< Ttesting::IsSupersetOf (const T(&array)[N])
 
template<typename Container >
internal::UnorderedElementsAreArrayMatcher< typename Container::value_type > testing::IsSupersetOf (const Container &container)
 
template<typename Iter >
internal::UnorderedElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > testing::IsSubsetOf (Iter first, Iter last)
 
template<typename T >
internal::UnorderedElementsAreArrayMatcher< Ttesting::IsSubsetOf (const T *pointer, size_t count)
 
template<typename T , size_t N>
internal::UnorderedElementsAreArrayMatcher< Ttesting::IsSubsetOf (const T(&array)[N])
 
template<typename Container >
internal::UnorderedElementsAreArrayMatcher< typename Container::value_type > testing::IsSubsetOf (const Container &container)
 
template<typename M >
internal::EachMatcher< M > testing::Each (M matcher)
 
template<typename M >
internal::KeyMatcher< M > testing::Key (M inner_matcher)
 
template<typename FirstMatcher , typename SecondMatcher >
internal::PairMatcher< FirstMatcher, SecondMatcher > testing::Pair (FirstMatcher first_matcher, SecondMatcher second_matcher)
 
template<typename M >
internal::MatcherAsPredicate< M > testing::Matches (M matcher)
 
template<typename T , typename M >
bool testing::Value (const T &value, M matcher)
 
template<typename T , typename M >
bool testing::ExplainMatchResult (M matcher, const T &value, MatchResultListener *listener)
 
template<typename T , typename M >
std::string testing::DescribeMatcher (const M &matcher, bool negation=false)
 
template<typename InnerMatcher >
InnerMatcher testing::AllArgs (const InnerMatcher &matcher)
 
template<typename ValueMatcher >
internal::OptionalMatcher< ValueMatcher > testing::Optional (const ValueMatcher &value_matcher)
 
template<typename T >
PolymorphicMatcher< internal::any_cast_matcher::AnyCastMatcher< T > > testing::AnyWith (const Matcher< const T & > &matcher)
 
template<typename T >
PolymorphicMatcher< internal::variant_matcher::VariantMatcher< T > > testing::VariantWith (const Matcher< const T & > &matcher)
 

Variables

const internal::AnythingMatcher testing::_ = {}
 

Macro Definition Documentation

◆ ASSERT_THAT

#define ASSERT_THAT ( value,
matcher )
Value:
#define ASSERT_PRED_FORMAT1(pred_format, v1)
PredicateFormatterFromMatcher< M > MakePredicateFormatterFromMatcher(M matcher)
#define value
Definition pkcs11.h:157

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

5243#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
5244 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)

◆ EXPECT_THAT

#define EXPECT_THAT ( value,
matcher )
Value:

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

5245#define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\
5246 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)