diff options
Diffstat (limited to 'googlemock/docs/cheat_sheet.md')
-rw-r--r-- | googlemock/docs/cheat_sheet.md | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/googlemock/docs/cheat_sheet.md b/googlemock/docs/cheat_sheet.md index 3236e6a9..975362bf 100644 --- a/googlemock/docs/cheat_sheet.md +++ b/googlemock/docs/cheat_sheet.md @@ -503,16 +503,17 @@ which must be a permanent callback. #### Returning a Value <!-- mdformat off(no multiline tables) --> -| | | -| :-------------------------- | :-------------------------------------------- | -| `Return()` | Return from a `void` mock function. | -| `Return(value)` | Return `value`. If the type of `value` is different to the mock function's return type, `value` is converted to the latter type <i>at the time the expectation is set</i>, not when the action is executed. | -| `ReturnArg<N>()` | Return the `N`-th (0-based) argument. | -| `ReturnNew<T>(a1, ..., ak)` | Return `new T(a1, ..., ak)`; a different object is created each time. | -| `ReturnNull()` | Return a null pointer. | -| `ReturnPointee(ptr)` | Return the value pointed to by `ptr`. | -| `ReturnRef(variable)` | Return a reference to `variable`. | -| `ReturnRefOfCopy(value)` | Return a reference to a copy of `value`; the copy lives as long as the action. | +| | | +| :-------------------------------- | :-------------------------------------------- | +| `Return()` | Return from a `void` mock function. | +| `Return(value)` | Return `value`. If the type of `value` is different to the mock function's return type, `value` is converted to the latter type <i>at the time the expectation is set</i>, not when the action is executed. | +| `ReturnArg<N>()` | Return the `N`-th (0-based) argument. | +| `ReturnNew<T>(a1, ..., ak)` | Return `new T(a1, ..., ak)`; a different object is created each time. | +| `ReturnNull()` | Return a null pointer. | +| `ReturnPointee(ptr)` | Return the value pointed to by `ptr`. | +| `ReturnRef(variable)` | Return a reference to `variable`. | +| `ReturnRefOfCopy(value)` | Return a reference to a copy of `value`; the copy lives as long as the action. | +| `ReturnRoundRobin({a1, ..., ak})` | Each call will return the next `ai` in the list, starting at the beginning when the end of the list is reached. | <!-- mdformat on --> #### Side Effects @@ -613,19 +614,6 @@ composite action - trying to do so will result in a run-time error. #### Defining Actions -<table border="1" cellspacing="0" cellpadding="1"> - <tr> - <td>`struct SumAction {` <br> -  `template <typename T>` <br> -  `T operator()(T x, Ty) { return x + y; }` <br> - `};` - </td> - <td> Defines a generic functor that can be used as an action summing its - arguments. </td> </tr> - <tr> - </tr> -</table> - <!-- mdformat off(no multiline tables) --> | | | | :--------------------------------- | :-------------------------------------- | |