google / google/googletest

Unhelpful error message on uninteresting MockFunction calls

Open
#3,310 2 comments 0 reactions 1 assignee Claimed by @derekmauro View on GitHub
bug
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

**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 `MockFunction`s

**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 `MockFunction`s in `StrictMock`s helps as the tried expectations will show the function name, but won't work if no expectations are present

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.