Skip to content

Missing expected functions not being flagged as failure #521

@wosym

Description

@wosym

Calling a mocked function that does not have an _Expect call in the Unit tests (or calling the mocked function more than _Expect calls were made) results in an error "Called more times than expected". This makes sense.
However, when making less calls to the mocked function than there are _Expect calls in the Unit test does not result in any error? This surprises me.

From what I understand from digging online, and reading pages such as this one, that one and this one, there is a _Verify function that needs to be called in some cases, in order for the call-counters to be compared.

We can find this function in the generated mock files, yes. But:

  1. This _Verify function isn't mentioned anywhere in the docs.
  2. I can't recall ever having used this function when using CMock in the past.

Could this be clarified? Is this a missing element in the docs? Is it a bug in CMock? Or... are we simply doing something wrong still?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions