proxygen
testing::gmock_matchers_test::GreaterThanMatcher Class Reference
Inheritance diagram for testing::gmock_matchers_test::GreaterThanMatcher:
testing::MatcherInterface< T > testing::MatcherInterface< T > testing::MatcherInterface< T > testing::MatcherDescriberInterface testing::MatcherDescriberInterface testing::MatcherDescriberInterface testing::MatcherDescriberInterface testing::MatcherDescriberInterface testing::MatcherDescriberInterface testing::MatcherDescriberInterface testing::MatcherDescriberInterface testing::MatcherDescriberInterface

Public Member Functions

 GreaterThanMatcher (int rhs)
 
virtual void DescribeTo (ostream *os) const
 
virtual bool MatchAndExplain (int lhs, MatchResultListener *listener) const
 
 GreaterThanMatcher (int rhs)
 
virtual void DescribeTo (ostream *os) const
 
virtual bool MatchAndExplain (int lhs, MatchResultListener *listener) const
 
 GreaterThanMatcher (int rhs)
 
virtual void DescribeTo (ostream *os) const
 
virtual bool MatchAndExplain (int lhs, MatchResultListener *listener) const
 
- Public Member Functions inherited from testing::MatcherInterface< T >
virtual bool MatchAndExplain (T x, MatchResultListener *listener) const =0
 
virtual bool MatchAndExplain (T x, MatchResultListener *listener) const =0
 
virtual bool MatchAndExplain (T x, MatchResultListener *listener) const =0
 
- Public Member Functions inherited from testing::MatcherDescriberInterface
virtual ~MatcherDescriberInterface ()
 
virtual void DescribeTo (::std::ostream *os) const =0
 
virtual void DescribeNegationTo (::std::ostream *os) const
 
virtual ~MatcherDescriberInterface ()
 
virtual void DescribeTo (::std::ostream *os) const =0
 
virtual void DescribeNegationTo (::std::ostream *os) const
 
virtual ~MatcherDescriberInterface ()
 
virtual void DescribeTo (::std::ostream *os) const =0
 
virtual void DescribeNegationTo (::std::ostream *os) const
 

Private Attributes

int rhs_
 

Detailed Description

Definition at line 162 of file gmock-matchers_test.cc.

Constructor & Destructor Documentation

testing::gmock_matchers_test::GreaterThanMatcher::GreaterThanMatcher ( int  rhs)
inlineexplicit

Definition at line 164 of file gmock-matchers_test.cc.

testing::gmock_matchers_test::GreaterThanMatcher::GreaterThanMatcher ( int  rhs)
inlineexplicit

Definition at line 164 of file gmock-matchers_test.cc.

testing::gmock_matchers_test::GreaterThanMatcher::GreaterThanMatcher ( int  rhs)
inlineexplicit

Definition at line 164 of file gmock-matchers_test.cc.

Member Function Documentation

virtual void testing::gmock_matchers_test::GreaterThanMatcher::DescribeTo ( ostream *  os) const
inlinevirtual

Definition at line 166 of file gmock-matchers_test.cc.

166  {
167  *os << "is > " << rhs_;
168  }
virtual void testing::gmock_matchers_test::GreaterThanMatcher::DescribeTo ( ostream *  os) const
inlinevirtual

Definition at line 166 of file gmock-matchers_test.cc.

166  {
167  *os << "is > " << rhs_;
168  }
virtual void testing::gmock_matchers_test::GreaterThanMatcher::DescribeTo ( ostream *  os) const
inlinevirtual

Definition at line 166 of file gmock-matchers_test.cc.

166  {
167  *os << "is > " << rhs_;
168  }
virtual bool testing::gmock_matchers_test::GreaterThanMatcher::MatchAndExplain ( int  lhs,
MatchResultListener listener 
) const
inlinevirtual

Definition at line 170 of file gmock-matchers_test.cc.

References testing::StringMatchResultListener::Clear(), testing::gmock_matchers_test::Describe(), testing::gmock_matchers_test::DescribeNegation(), testing::internal::MatcherBase< T >::DescribeNegationTo(), testing::internal::MatcherBase< T >::DescribeTo(), diff(), dummy(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, testing::gmock_matchers_test::Explain(), testing::ExplainMatchResult(), testing::gmock_matchers_test::GreaterThan(), m, testing::MakeMatcher(), testing::gmock_matchers_test::OfType(), testing::StringMatchResultListener::str(), stream, testing::internal::TEST(), and testing::Value().

171  {
172  const int diff = lhs - rhs_;
173  if (diff > 0) {
174  *listener << "which is " << diff << " more than " << rhs_;
175  } else if (diff == 0) {
176  *listener << "which is the same as " << rhs_;
177  } else {
178  *listener << "which is " << -diff << " less than " << rhs_;
179  }
180 
181  return lhs > rhs_;
182  }
uint64_t diff(uint64_t a, uint64_t b)
Definition: FutexTest.cpp:135
virtual bool testing::gmock_matchers_test::GreaterThanMatcher::MatchAndExplain ( int  lhs,
MatchResultListener listener 
) const
inlinevirtual

Definition at line 170 of file gmock-matchers_test.cc.

References diff().

171  {
172  const int diff = lhs - rhs_;
173  if (diff > 0) {
174  *listener << "which is " << diff << " more than " << rhs_;
175  } else if (diff == 0) {
176  *listener << "which is the same as " << rhs_;
177  } else {
178  *listener << "which is " << -diff << " less than " << rhs_;
179  }
180 
181  return lhs > rhs_;
182  }
uint64_t diff(uint64_t a, uint64_t b)
Definition: FutexTest.cpp:135
virtual bool testing::gmock_matchers_test::GreaterThanMatcher::MatchAndExplain ( int  lhs,
MatchResultListener listener 
) const
inlinevirtual

Definition at line 170 of file gmock-matchers_test.cc.

References testing::StringMatchResultListener::Clear(), testing::gmock_matchers_test::Describe(), testing::gmock_matchers_test::DescribeNegation(), testing::internal::MatcherBase< T >::DescribeNegationTo(), testing::internal::MatcherBase< T >::DescribeTo(), diff(), dummy(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, testing::gmock_matchers_test::Explain(), testing::ExplainMatchResult(), testing::gmock_matchers_test::GreaterThan(), m, testing::MakeMatcher(), testing::gmock_matchers_test::OfType(), testing::StringMatchResultListener::str(), stream, testing::internal::TEST(), and testing::Value().

171  {
172  const int diff = lhs - rhs_;
173  if (diff > 0) {
174  *listener << "which is " << diff << " more than " << rhs_;
175  } else if (diff == 0) {
176  *listener << "which is the same as " << rhs_;
177  } else {
178  *listener << "which is " << -diff << " less than " << rhs_;
179  }
180 
181  return lhs > rhs_;
182  }
uint64_t diff(uint64_t a, uint64_t b)
Definition: FutexTest.cpp:135

Member Data Documentation

int testing::gmock_matchers_test::GreaterThanMatcher::rhs_
private

Definition at line 185 of file gmock-matchers_test.cc.


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