Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::gmock_matchers_test::GreaterThanMatcher Class Reference
Inheritance diagram for testing::gmock_matchers_test::GreaterThanMatcher:
Collaboration diagram for testing::gmock_matchers_test::GreaterThanMatcher:

Public Member Functions

 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
 
- Public Member Functions inherited from testing::MatcherDescriberInterface
virtual ~MatcherDescriberInterface ()
 
virtual void DescribeTo (::std::ostream *os) const =0
 
virtual void DescribeNegationTo (::std::ostream *os) const
 

Detailed Description

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

Constructor & Destructor Documentation

◆ GreaterThanMatcher()

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

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

163: rhs_(rhs) {}

Member Function Documentation

◆ DescribeTo()

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

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

165 {
166 *os << "is > " << rhs_;
167 }
os_t os

◆ MatchAndExplain()

virtual bool testing::gmock_matchers_test::GreaterThanMatcher::MatchAndExplain ( int lhs,
MatchResultListener * listener ) const
inlinevirtual

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

170 {
171 const int diff = lhs - rhs_;
172 if (diff > 0) {
173 *listener << "which is " << diff << " more than " << rhs_;
174 } else if (diff == 0) {
175 *listener << "which is the same as " << rhs_;
176 } else {
177 *listener << "which is " << -diff << " less than " << rhs_;
178 }
179
180 return lhs > rhs_;
181 }
void diff(const std::string &a, const std::string &b)
Definition jmp.cpp:18
Here is the call graph for this function:

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