~/talk

Using Trompeloeil - a mocking framework for modern C++

Talkat NDC Oslo 2017 · 2017-06-14..06-16· [testing]
slides:none on file

Trompeloeil is a single-header C++14 mocking framework (≈3.5k lines, Boost license, available via Conan) that avoids UB and supports mocking member functions, templates and move-only types. The demo builds a mock store and Order class with TDD: using make_mock, require_call/allow_call/forbid_call (named variants), times and sequence to control ordering, underscore matcher and positional _1 with LR captures, side_effect and return for behavior, plus custom printing and named expectations to manage lifetime. Tests expose and fix real bugs; the example ends green.

AI-written summary · about

  1. 0:00Introduction to Trompeloeil
  2. 2:46Framework design and setup
  3. 6:47Basic mocking examples
  4. 11:53Advanced expectation handling
  5. 20:32Templatized mocks and types
  6. 32:02Complex behavior simulation
  7. 40:24Callback testing techniques
  8. 47:31Wrap up and cheat sheet
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.