mirror of
https://github.com/google/googletest.git
synced 2025-04-10 07:07:55 +00:00
Mention using MockFunction as a way to mock free functions.
PiperOrigin-RevId: 502901538 Change-Id: I0cf351b9ad1411ae9c45e09550c24e006a24e179
This commit is contained in:
parent
bdb3b0a493
commit
ec25eea8f8
1 changed files with 4 additions and 0 deletions
|
@ -285,6 +285,10 @@ If you are concerned about the performance overhead incurred by virtual
|
|||
functions, and profiling confirms your concern, you can combine this with the
|
||||
recipe for [mocking non-virtual methods](#MockingNonVirtualMethods).
|
||||
|
||||
Alternatively, instead of introducing a new interface, you can rewrite your code
|
||||
to accept a std::function instead of the free function, and then use
|
||||
[MockFunction](#MockFunction) to mock the std::function.
|
||||
|
||||
### Old-Style `MOCK_METHODn` Macros
|
||||
|
||||
Before the generic `MOCK_METHOD` macro
|
||||
|
|
Loading…
Add table
Reference in a new issue