diff options
author | Abseil Team <absl-team@google.com> | 2021-03-24 19:20:37 -0700 |
---|---|---|
committer | Dino Radaković <dinor@google.com> | 2021-03-25 13:43:43 -0700 |
commit | c0dd0817cf2c7798a7e318e410a144a372166f91 (patch) | |
tree | 9d2b5171706ad0f7765a31314fa276040bfaf46f | |
parent | 66836f0a906dcac04d19febc86ef942e52d331eb (diff) | |
download | googletest-git-c0dd0817cf2c7798a7e318e410a144a372166f91.tar.gz |
Googletest export
Clarify explanation of mocking free functions
PiperOrigin-RevId: 364943561
-rw-r--r-- | docs/gmock_cook_book.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md index ed8376a8..a9f9edc0 100644 --- a/docs/gmock_cook_book.md +++ b/docs/gmock_cook_book.md @@ -251,9 +251,9 @@ tests. ### Mocking Free Functions -It's possible to use gMock to mock a free function (i.e. a C-style function or a -static method). You just need to rewrite your code to use an interface (abstract -class). +It is not possible to directly mock a free function (i.e. a C-style function or +a static method). If you need to, you can rewrite your code to use an interface +(abstract class). Instead of calling a free function (say, `OpenFile`) directly, introduce an interface for it and have a concrete subclass that calls the free function: |