这是indexloc提供的服务,不要输入任何密码
Skip to content

How to have different mocks in different tests #135

@brendan-simon-indt

Description

@brendan-simon-indt

Does FFF support having different mocks for a function in different tests (in the same test file)?

I tried mocking a function with various return values and it works great.
I added another test which added a custom fake (as output values are returned via argument pointers), but then the original tests failed.
I think I also got multiple definition errors, so I had to modify the code under test to have the weak attribute.

Just wondering if FFF can support multiple fakes per test and not have to modify the original source code under test.

Thanks, Brendan :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions