Open APokorny opened 7 years ago
Is there anything missing here?
Only time for me to review your change. I'll find some time the next two days.
@dascandy Are you planning to merge to cpp 11 branch. We are planning to use cpp11 branch for our code base. Which require unique ptr mocking support. Apologies I am quite new to git hub
@APokorny Time got lost here. From what I can tell it's similar to adding an ExpectDestructor to a regular mock & returning a unique_ptr directly? That would be a much smaller delta to the existing code base & not require a new subclass...
This adds support for mock objects controlled by unique_ptr. In this proposal the mock repository is not the owner of the mock object - it just assists in construction. The verification of expectations thus happens when the mock object is destroyed.
Use the new UniqueMock function (or UniqueMock(Deleter d)) to construct a mock object within a unique_ptr. For example in your test you can write: