Skip to content

Allow mocks to be moved.#334

Merged
FranckRJ merged 1 commit intodevfrom
allow-moves-on-mocks
May 10, 2024
Merged

Allow mocks to be moved.#334
FranckRJ merged 1 commit intodevfrom
allow-moves-on-mocks

Conversation

@FranckRJ
Copy link
Collaborator

@FranckRJ FranckRJ commented May 9, 2024

Make mocks move-constructible, so they can be constructed from external functions. They could technically be move-assignable as well but I don't think it would be useful so I haven't done it.

They cannot be copy-constructible because the mocks can contain move-only objects (if a function returning a move-only object is mocked with Return(MoveOnly{}) then the mock will contain the move-only object that should be returned when that function is called), making them move-only as well.

This should fix #283 and #97.

@FranckRJ FranckRJ added this to the 2.5.0 milestone May 9, 2024
@coveralls
Copy link

coveralls commented May 9, 2024

Coverage Status

coverage: 99.926%. remained the same
when pulling 9428cd7 on allow-moves-on-mocks
into 52f86a8 on dev.

@FranckRJ FranckRJ force-pushed the allow-moves-on-mocks branch from 5f19982 to bb569e5 Compare May 10, 2024 14:50
@FranckRJ FranckRJ force-pushed the allow-moves-on-mocks branch from bb569e5 to 9428cd7 Compare May 10, 2024 14:51
@FranckRJ FranckRJ merged commit c1d74ea into dev May 10, 2024
@FranckRJ FranckRJ deleted the allow-moves-on-mocks branch May 10, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants