Google Mocking Framework (GMock)
When you write a prototype or test, often it's not feasible or wise to rely on real objects entirely. A mock object implements the same interface as a real object (so it can be used as one), but lets you specify at run time how it will be used and what it should do.
Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s specifics in mind, Google C++ Mocking Framework (or Google Mock for short) is a library for writing and using C++ mock classes. Google Mock:
• lets you create mock classes trivially using simple macros,
• supports a rich set of matchers and actions,
• handles unordered, partially ordered, or completely ordered expectations,
• is extensible by users, and
• works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and Symbian.