googletest icon indicating copy to clipboard operation
googletest copied to clipboard

Unhelpful error message on uninteresting MockFunction calls

Open rcywongaa opened this issue 4 years ago • 2 comments

Describe the bug Uninteresting calls to MockFunction generates the following error message

GMOCK WARNING:
Uninteresting mock function call - returning default value.
    Function call: Call()
          Returns: false

which is unhelpful when there are multiple MockFunctions as all uninteresting calls to them will be identified as Function call: Call()

It would be more useful if the Function call showed the full function name, e.g.

    Function call: my_func::Call()

so as to distinguish between different MockFunctions

Steps to reproduce the bug

  1. Create MockFunction
  2. Call MockFunction without creating an expectation
  3. Observe uninteresting mock function call warning

What version of GoogleTest are you using? 1.8.0-6

What operating system and version are you using Ubuntu 18.04

What compiler and version are you using? gcc 7.5.0

What build system are you using? CMake 3.10.2

Additional context

Wrapping all MockFunctions in StrictMocks helps as the tried expectations will show the function name, but won't work if no expectations are present

rcywongaa avatar Mar 10 '21 07:03 rcywongaa