Skip to content

`EXPECT_CALL(...).with_args(null) doesn't fail when function not called at all #13

@tudortimi-ifx

Description

@tudortimi-ifx

I have simple test like this:

some_class c;
`EXPECT_CALL(mock, func).with_args(c);
// ... act on UUT, which should trigger a call to 'func()' with 'c' as an argument
`FAIL_UNLESS(mock.check())

If the UUT doesn't call 'func', the test passes, though I would expect it to fail.

Since I forgot to add ' = new()' to 'c', I instructed the mock to expect 'null' as a value for the arg to 'func'. SVMock doesn't interpret this as a specification to have 'func' called at least one time. I think GMock does this, though.

Would we want 'with_args(...)' to play around with the cardinality of function calls like GMock does?

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