Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
83f6b08b
Commit
83f6b08b
authored
Mar 01, 2013
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarifies how to implement MatcherInterface.
parent
320814ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
gmock-matchers.h
include/gmock/gmock-matchers.h
+21
-4
No files found.
include/gmock/gmock-matchers.h
View file @
83f6b08b
...
@@ -112,10 +112,27 @@ class MatcherInterface {
...
@@ -112,10 +112,27 @@ class MatcherInterface {
virtual
~
MatcherInterface
()
{}
virtual
~
MatcherInterface
()
{}
// Returns true iff the matcher matches x; also explains the match
// Returns true iff the matcher matches x; also explains the match
// result to 'listener', in the form of a non-restrictive relative
// result to 'listener' if necessary (see the next paragraph), in
// clause ("which ...", "whose ...", etc) that describes x. For
// the form of a non-restrictive relative clause ("which ...",
// example, the MatchAndExplain() method of the Pointee(...) matcher
// "whose ...", etc) that describes x. For example, the
// should generate an explanation like "which points to ...".
// MatchAndExplain() method of the Pointee(...) matcher should
// generate an explanation like "which points to ...".
//
// Implementations of MatchAndExplain() should add an explanation of
// the match result *if and only if* they can provide additional
// information that's not already present (or not obvious) in the
// print-out of x and the matcher's description. Whether the match
// succeeds is not a factor in deciding whether an explanation is
// needed, as sometimes the caller needs to print a failure message
// when the match succeeds (e.g. when the matcher is used inside
// Not()).
//
// For example, a "has at least 10 elements" matcher should explain
// what the actual element count is, regardless of the match result,
// as it is useful information to the reader; on the other hand, an
// "is empty" matcher probably only needs to explain what the actual
// size is when the match fails, as it's redundant to say that the
// size is 0 when the value is already known to be empty.
//
//
// You should override this method when defining a new matcher.
// You should override this method when defining a new matcher.
//
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment