aboutsummaryrefslogtreecommitdiff
path: root/docs/gmock_cook_book.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/gmock_cook_book.md')
-rw-r--r--docs/gmock_cook_book.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md
index da10918c..5e9b6647 100644
--- a/docs/gmock_cook_book.md
+++ b/docs/gmock_cook_book.md
@@ -1927,6 +1927,12 @@ class MockFoo : public Foo {
action_n));
```
+The return value of the last action **must** match the return type of the mocked
+method. In the example above, `action_n` could be `Return(true)`, or a lambda
+that returns a `bool`, but not `SaveArg`, which returns `void`. Otherwise the
+signature of `DoAll` would not match the signature expected by `WillOnce`, which
+is the signature of the mocked method, and it wouldn't compile.
+
### Verifying Complex Arguments {#SaveArgVerify}
If you want to verify that a method is called with a particular argument but the