eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.22k stars 170 forks source link

Rewrote matcher code. #268

Closed FranckRJ closed 2 years ago

FranckRJ commented 2 years ago

Now expected type doesn't need to be the same (or convertible) to the actual type. And the expected value is moved if possible, instead of always copied.

Should fix #240.

coveralls commented 2 years ago

Coverage Status

Coverage decreased (-0.002%) to 99.924% when pulling 3d0684aaf2f84de471f249a12f93c4f76b7fb396 on rewrite-matchers into 2441116619155dda59b111e81835a20223a93d5f on dev-2.2.0.

FranckRJ commented 2 years ago

I was also thinking about adding support for reference_wrapper, to store the expected value of the matcher by reference instead of copy. But it may cause issues if you try to mock a function that already take a reference_wrapper as a parameter, so I don't know.