Commit c0dd0817 authored by Abseil Team's avatar Abseil Team Committed by Dino Radaković
Browse files

Googletest export

Clarify explanation of mocking free functions

PiperOrigin-RevId: 364943561
parent 66836f0a
...@@ -251,9 +251,9 @@ tests. ...@@ -251,9 +251,9 @@ tests.
### Mocking Free Functions ### Mocking Free Functions
It's possible to use gMock to mock a free function (i.e. a C-style function or a It is not possible to directly mock a free function (i.e. a C-style function or
static method). You just need to rewrite your code to use an interface (abstract a static method). If you need to, you can rewrite your code to use an interface
class). (abstract class).
Instead of calling a free function (say, `OpenFile`) directly, introduce an Instead of calling a free function (say, `OpenFile`) directly, introduce an
interface for it and have a concrete subclass that calls the free function: interface for it and have a concrete subclass that calls the free function:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment