aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/docs/cheat_sheet.md
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/docs/cheat_sheet.md')
-rw-r--r--googlemock/docs/cheat_sheet.md35
1 files changed, 12 insertions, 23 deletions
diff --git a/googlemock/docs/cheat_sheet.md b/googlemock/docs/cheat_sheet.md
index 8ec5ea08..975362bf 100644
--- a/googlemock/docs/cheat_sheet.md
+++ b/googlemock/docs/cheat_sheet.md
@@ -287,6 +287,7 @@ is not changed afterwards, or the meaning of your matcher will be changed.
| `FloatEq(a_float)` | `argument` is a `float` value approximately equal to `a_float`, treating two NaNs as unequal. |
| `NanSensitiveDoubleEq(a_double)` | `argument` is a `double` value approximately equal to `a_double`, treating two NaNs as equal. |
| `NanSensitiveFloatEq(a_float)` | `argument` is a `float` value approximately equal to `a_float`, treating two NaNs as equal. |
+| `IsNan()` | `argument` is any floating-point type with a NaN value. |
<!-- mdformat on -->
The above matchers use ULP-based comparison (the same as used in googletest).
@@ -502,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
@@ -612,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>
- &emsp;`template <typename T>` <br>
- &emsp;`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) -->
| | |
| :--------------------------------- | :-------------------------------------- |