summaryrefslogtreecommitdiffstats
path: root/googlemock/docs
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/docs')
-rw-r--r--googlemock/docs/cheat_sheet.md23
-rw-r--r--googlemock/docs/cook_book.md12
-rw-r--r--googlemock/docs/for_dummies.md2
-rw-r--r--googlemock/docs/gmock_faq.md8
4 files changed, 23 insertions, 22 deletions
diff --git a/googlemock/docs/cheat_sheet.md b/googlemock/docs/cheat_sheet.md
index 6441a7a8..3bfc6dde 100644
--- a/googlemock/docs/cheat_sheet.md
+++ b/googlemock/docs/cheat_sheet.md
@@ -177,7 +177,8 @@ Example usage:
To customize the default action for a particular method of a specific mock
object, use `ON_CALL()`. `ON_CALL()` has a similar syntax to `EXPECT_CALL()`,
but it is used for setting default behaviors (when you do not require that the
-mock method is called). See go/prefer-on-call for a more detailed discussion.
+mock method is called). See [here](cook_book.md#UseOnCall) for a more detailed
+discussion.
```cpp
ON_CALL(mock-object, method(matchers))
@@ -332,8 +333,8 @@ The `argument` can be either a C string or a C++ string object:
`ContainsRegex()` and `MatchesRegex()` take ownership of the `RE` object. They
use the regular expression syntax defined
-[here](http://go/gunit-advanced-regex). `StrCaseEq()`, `StrCaseNe()`, `StrEq()`,
-and `StrNe()` work for wide strings as well.
+[here](advanced.md#regular-expression-syntax). `StrCaseEq()`, `StrCaseNe()`,
+`StrEq()`, and `StrNe()` work for wide strings as well.
#### Container Matchers
@@ -599,10 +600,10 @@ which must be a permanent callback.
**Notes:**
1. The `MATCHER*` macros cannot be used inside a function or class.
-1. The matcher body must be *purely functional* (i.e. it cannot have any side
+2. The matcher body must be *purely functional* (i.e. it cannot have any side
effect, and the result must not depend on anything other than the value
being matched and the matcher parameters).
-1. You can use `PrintToString(x)` to convert a value `x` of any type to a
+3. You can use `PrintToString(x)` to convert a value `x` of any type to a
string.
### Actions {#ActionList}
@@ -658,20 +659,20 @@ which must be a permanent callback.
: : be any copyable value. Available since :
: : v1.1.0. :
-#### Using a Function, Functor, Lambda, or Callback as an Action
+#### Using a Function, Functor, or Lambda as an Action
In the following, by "callable" we mean a free function, `std::function`,
-functor, lambda, or `google3`-style permanent callback.
+functor, or lambda.
| | |
| :---------------------------------- | :------------------------------------- |
| `f` | Invoke f with the arguments passed to |
: : the mock function, where f is a :
-: : callable (except of google3 callback). :
+: : callable. :
| `Invoke(f)` | Invoke `f` with the arguments passed |
: : to the mock function, where `f` can be :
: : a global/static function or a functor. :
-| `Invoke(object_pointer, | Invoke the {method on the object with |
+| `Invoke(object_pointer, | Invoke the method on the object with |
: &class\:\:method)` : the arguments passed to the mock :
: : function. :
| `InvokeWithoutArgs(f)` | Invoke `f`, which can be a |
@@ -886,12 +887,12 @@ you can do it earlier:
using ::testing::Mock;
...
// Verifies and removes the expectations on mock_obj;
-// returns true iff successful.
+// returns true if successful.
Mock::VerifyAndClearExpectations(&mock_obj);
...
// Verifies and removes the expectations on mock_obj;
// also removes the default actions set by ON_CALL();
-// returns true iff successful.
+// returns true if successful.
Mock::VerifyAndClear(&mock_obj);
```
diff --git a/googlemock/docs/cook_book.md b/googlemock/docs/cook_book.md
index 17c26459..676560bf 100644
--- a/googlemock/docs/cook_book.md
+++ b/googlemock/docs/cook_book.md
@@ -1038,7 +1038,7 @@ arguments as *one* single tuple to the predicate.
Have you noticed that a matcher is just a fancy predicate that also knows how to
describe itself? Many existing algorithms take predicates as arguments (e.g.
those defined in STL's `<algorithm>` header), and it would be a shame if gMock
-matchers are not allowed to participate.
+matchers were not allowed to participate.
Luckily, you can use a matcher where a unary predicate functor is expected by
wrapping it inside the `Matches()` function. For example,
@@ -1245,7 +1245,7 @@ what if you want to make sure the value *pointed to* by the pointer, instead of
the pointer itself, has a certain property? Well, you can use the `Pointee(m)`
matcher.
-`Pointee(m)` matches a pointer iff `m` matches the value the pointer points to.
+`Pointee(m)` matches a pointer if `m` matches the value the pointer points to.
For example:
```cpp
@@ -2603,7 +2603,7 @@ However, if the action has its own state, you may be surprised if you share the
action object. Suppose you have an action factory `IncrementCounter(init)` which
creates an action that increments and returns a counter whose initial value is
`init`, using two actions created from the same expression and using a shared
-action will exihibit different behaviors. Example:
+action will exhibit different behaviors. Example:
```cpp
EXPECT_CALL(foo, DoThis())
@@ -3548,7 +3548,7 @@ class MatcherInterface {
public:
virtual ~MatcherInterface();
- // Returns true iff the matcher matches x; also explains the match
+ // Returns true if the matcher matches x; also explains the match
// result to 'listener'.
virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
@@ -3702,10 +3702,10 @@ class CardinalityInterface {
public:
virtual ~CardinalityInterface();
- // Returns true iff call_count calls will satisfy this cardinality.
+ // Returns true if call_count calls will satisfy this cardinality.
virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
- // Returns true iff call_count calls will saturate this cardinality.
+ // Returns true if call_count calls will saturate this cardinality.
virtual bool IsSaturatedByCallCount(int call_count) const = 0;
// Describes self to an ostream.
diff --git a/googlemock/docs/for_dummies.md b/googlemock/docs/for_dummies.md
index 5551cd8b..3bccd2bd 100644
--- a/googlemock/docs/for_dummies.md
+++ b/googlemock/docs/for_dummies.md
@@ -695,4 +695,4 @@ For example, in some tests we may not care about how many times `GetX()` and
In gMock, if you are not interested in a method, just don't say anything about
it. If a call to this method occurs, you'll see a warning in the test output,
but it won't be a failure. This is called "naggy" behavior; to change, see
-[The Nice, the Strict, and the Naggy](#NiceStrictNaggy).
+[The Nice, the Strict, and the Naggy](cook_book.md#NiceStrictNaggy).
diff --git a/googlemock/docs/gmock_faq.md b/googlemock/docs/gmock_faq.md
index 8bc45b18..214aabf1 100644
--- a/googlemock/docs/gmock_faq.md
+++ b/googlemock/docs/gmock_faq.md
@@ -81,7 +81,7 @@ void Bar(int* p); // Neither p nor *p is const.
void Bar(const int* p); // p is not const, but *p is.
```
-<<!-- GOOGLETEST_CM0030 DO NOT DELETE -->
+<!-- GOOGLETEST_CM0030 DO NOT DELETE -->
### I can't figure out why gMock thinks my expectations are not satisfied. What should I do?
@@ -91,9 +91,9 @@ trace, you'll gain insights on why the expectations you set are not met.
If you see the message "The mock function has no default action set, and its
return type has no default value set.", then try
-[adding a default action](http://go/gmockguide#DefaultValue). Due to a known
-issue, unexpected calls on mocks without default actions don't print out a
-detailed comparison between the actual arguments and the expected arguments.
+[adding a default action](for_dummies.md#DefaultValue). Due to a known issue,
+unexpected calls on mocks without default actions don't print out a detailed
+comparison between the actual arguments and the expected arguments.
### My program crashed and `ScopedMockLog` spit out tons of messages. Is it a gMock bug?
OpenPOWER on IntegriCloud