Using Trompeloeil, a Mocking Framework for Modern C++

By Björn Fahller

A popular technique in unit testing is to break dependencies by replacing collaborators of the unit under test with mock objects. Mocking frameworks makes it easier to create mock objects.

Trompeloeil is a new, open source, mocking framework written in C++14. It is easy to use while also allowing great expressive power.

This presentation will show how to use Trompeloeil by following the step-by-step development of an example program using TDD (test driven development.) The example will begin with the most basic usage and go on to cover increasingly more advanced topics, including:

  • testing patterns

  • techniques for controlling sequential ordering relations

  • how to represent data in violation messages

  • managing the life time of mock objects

  • writing matchers

  • disambiguating overloads

The presentation will also include call outs for participation to help further the development.

Level: intermediate→advanced





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.