Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::TuplePrefix< N > Class Template Reference

#include <gmock-matchers.h>

Static Public Member Functions

template<typename MatcherTuple , typename ValueTuple >
static bool Matches (const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
 
template<typename MatcherTuple , typename ValueTuple >
static void ExplainMatchFailuresTo (const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
 

Detailed Description

template<size_t N>
class testing::internal::TuplePrefix< N >

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

Member Function Documentation

◆ ExplainMatchFailuresTo()

template<size_t N>
template<typename MatcherTuple , typename ValueTuple >
static void testing::internal::TuplePrefix< N >::ExplainMatchFailuresTo ( const MatcherTuple & matchers,
const ValueTuple & values,
::std::ostream * os )
inlinestatic

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

912 {
913 // First, describes failures in the first N - 1 fields.
915
916 // Then describes the failure (if any) in the (N - 1)-th (0-based)
917 // field.
918 typename tuple_element<N - 1, MatcherTuple>::type matcher =
919 get<N - 1>(matchers);
920 typedef typename tuple_element<N - 1, ValueTuple>::type Value;
922 StringMatchResultListener listener;
923 if (!matcher.MatchAndExplain(value, &listener)) {
924 // TODO(wan): include in the message the name of the parameter
925 // as used in MOCK_METHOD*() when possible.
926 *os << " Expected arg #" << N - 1 << ": ";
927 get<N - 1>(matchers).DescribeTo(os);
928 *os << "\n Actual: ";
929 // We remove the reference in type Value to prevent the
930 // universal printer from printing the address of value, which
931 // isn't interesting to the user most of the time. The
932 // matcher's MatchAndExplain() method handles the case when
933 // the address is interesting.
935 PrintIfNotEmpty(listener.str(), os);
936 *os << "\n";
937 }
938 }
static void ExplainMatchFailuresTo(const MatcherTuple &matchers, const ValueTuple &values, ::std::ostream *os)
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Definition document.h:2110
os_t os
#define GTEST_REFERENCE_TO_CONST_(T)
GeneratorWrapper< T > values(std::initializer_list< T > values)
void UniversalPrint(const T &value, ::std::ostream *os)
void PrintIfNotEmpty(const std::string &explanation, ::std::ostream *os)
#define value
Definition pkcs11.h:157
const int N
Definition quantize.cpp:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Matches()

template<size_t N>
template<typename MatcherTuple , typename ValueTuple >
static bool testing::internal::TuplePrefix< N >::Matches ( const MatcherTuple & matcher_tuple,
const ValueTuple & value_tuple )
inlinestatic

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

900 {
901 return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple)
902 && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple));
903 }
static bool Matches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Here is the call graph for this function:
Here is the caller graph for this function:

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