Mocking free function

No it’s not possible, without changing the sources, or bringing your own version of foo() that is linked with the executable code. From GoogleMock’s FAQ it says My code calls a static/global function. Can I mock it? You can, but you need to make some changes. In general, if you find yourself needing to mock … Read more

How deep are your unit tests?

I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris). If I don’t typically make a kind of mistake (like … Read more