Electroneum
Loading...
Searching...
No Matches
testing::internal::PredicateFormatterFromMatcher< M > Class Template Reference

#include <gmock-matchers.h>

Public Member Functions

 PredicateFormatterFromMatcher (M m)
template<typename T>
AssertionResult operator() (const char *value_text, const T &x) const

Detailed Description

template<typename M>
class testing::internal::PredicateFormatterFromMatcher< M >

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

Constructor & Destructor Documentation

◆ PredicateFormatterFromMatcher()

template<typename M>
testing::internal::PredicateFormatterFromMatcher< M >::PredicateFormatterFromMatcher ( M m)
inlineexplicit

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

Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename M>
template<typename T>
AssertionResult testing::internal::PredicateFormatterFromMatcher< M >::operator() ( const char * value_text,
const T & x ) const
inline

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

1842 {
1843 // We convert matcher_ to a Matcher<const T&> *now* instead of
1844 // when the PredicateFormatterFromMatcher object was constructed,
1845 // as matcher_ may be polymorphic (e.g. NotNull()) and we won't
1846 // know which type to instantiate it to until we actually see the
1847 // type of x here.
1848 //
1849 // We write SafeMatcherCast<const T&>(matcher_) instead of
1850 // Matcher<const T&>(matcher_), as the latter won't compile when
1851 // matcher_ has type Matcher<T> (e.g. An<int>()).
1852 // We don't write MatcherCast<const T&> either, as that allows
1853 // potentially unsafe downcasting of the matcher argument.
1857 return AssertionSuccess();
1858
1860 ss << "Value of: " << value_text << "\n"
1861 << "Expected: ";
1862 matcher.DescribeTo(&ss);
1863 ss << "\n Actual: " << listener.str();
1864 return AssertionFailure() << ss.str();
1865 }
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
GTEST_API_ AssertionResult AssertionSuccess()
GTEST_API_ AssertionResult AssertionFailure()
Matcher< T > SafeMatcherCast(const M &polymorphic_matcher)
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