From 280b22708c014bd29a51eee5982e941231c7925f Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Sat, 1 Jul 2017 09:51:45 -0400 Subject: Fix table formatting. The markdown was not working for a small table, fixed. --- googlemock/docs/v1_5/CookBook.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'googlemock/docs/v1_5') diff --git a/googlemock/docs/v1_5/CookBook.md b/googlemock/docs/v1_5/CookBook.md index 26e153c6..6da89fc2 100644 --- a/googlemock/docs/v1_5/CookBook.md +++ b/googlemock/docs/v1_5/CookBook.md @@ -1032,9 +1032,10 @@ a value that satisfies matcher `m`. For example: -> | `Field(&Foo::number, Ge(3))` | Matches `x` where `x.number >= 3`. | +| Expression | Description | |:-----------------------------|:-----------------------------------| -> | `Property(&Foo::name, StartsWith("John "))` | Matches `x` where `x.name()` starts with `"John "`. | +| `Field(&Foo::number, Ge(3))` | Matches `x` where `x.number >= 3`. | +| `Property(&Foo::name, StartsWith("John "))` | Matches `x` where `x.name()` starts with `"John "`. | Note that in `Property(&Foo::baz, ...)`, method `baz()` must take no argument and be declared as `const`. -- cgit v1.2.3 From 1dde1eed381a68af1e1a2ea477c26b3b1ead716b Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Sat, 1 Jul 2017 15:26:42 -0400 Subject: Fix typos too s/destoyed/destroyed/ --- googlemock/docs/v1_5/CookBook.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'googlemock/docs/v1_5') diff --git a/googlemock/docs/v1_5/CookBook.md b/googlemock/docs/v1_5/CookBook.md index 6da89fc2..f85bc3bf 100644 --- a/googlemock/docs/v1_5/CookBook.md +++ b/googlemock/docs/v1_5/CookBook.md @@ -2081,12 +2081,12 @@ versus ## Forcing a Verification ## -When it's being destoyed, your friendly mock object will automatically +When it's being destroyed, your friendly mock object will automatically verify that all expectations on it have been satisfied, and will generate [Google Test](http://code.google.com/p/googletest/) failures if not. This is convenient as it leaves you with one less thing to worry about. That is, unless you are not sure if your mock object will -be destoyed. +be destroyed. How could it be that your mock object won't eventually be destroyed? Well, it might be created on the heap and owned by the code you are -- cgit v1.2.3 From 2fcbc0c1ab4877f2a149fe2b4760fd2bf182d0b1 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Sat, 1 Jul 2017 15:30:55 -0400 Subject: Remove silly claim that C++ lacks lambdas. The document itself uses lambdas later, all the scaffolding to work around lack of lambdas should be considered for removal, but that is much larger an effort than I can commit to. --- googlemock/docs/v1_5/CookBook.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'googlemock/docs/v1_5') diff --git a/googlemock/docs/v1_5/CookBook.md b/googlemock/docs/v1_5/CookBook.md index f85bc3bf..0b25d2c5 100644 --- a/googlemock/docs/v1_5/CookBook.md +++ b/googlemock/docs/v1_5/CookBook.md @@ -1773,9 +1773,9 @@ using ::testing::_; // second argument DoThis() receives. ``` -Arghh, you need to refer to a mock function argument but C++ has no -lambda (yet), so you have to define your own action. :-( Or do you -really? +Arghh, you need to refer to a mock function argument but your version +of C++ has no lambdas, so you have to define your own action. :-( +Or do you really? Well, Google Mock has an action to solve _exactly_ this problem: -- cgit v1.2.3 From 0ffd8629c9ee58ee84ec38768a5cc45faebfa297 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Sat, 1 Jul 2017 22:34:51 -0400 Subject: More tables that did not render correctly. --- googlemock/docs/v1_5/CookBook.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'googlemock/docs/v1_5') diff --git a/googlemock/docs/v1_5/CookBook.md b/googlemock/docs/v1_5/CookBook.md index 0b25d2c5..55824bbb 100644 --- a/googlemock/docs/v1_5/CookBook.md +++ b/googlemock/docs/v1_5/CookBook.md @@ -2864,6 +2864,7 @@ For example, when using an `ACTION` as a stub action for mock function: int DoSomething(bool flag, int* ptr); ``` we have: + | **Pre-defined Symbol** | **Is Bound To** | |:-----------------------|:----------------| | `arg0` | the value of `flag` | @@ -3025,6 +3026,7 @@ is asked to infer the type of `x`? If you are writing a function that returns an `ACTION` object, you'll need to know its type. The type depends on the macro used to define the action and the parameter types. The rule is relatively simple: + | **Given Definition** | **Expression** | **Has Type** | |:---------------------|:---------------|:-------------| | `ACTION(Foo)` | `Foo()` | `FooAction` | -- cgit v1.2.3