Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Mocking C++

CppNow via YouTube

Overview

Explore mocking techniques in C++ for efficient unit testing in this conference talk from C++Now 2017. Learn how to create mock components that simulate desired behaviors without relying on actual dependencies, improving test reliability and speed. Discover methods to implement mocking in C++ without extensive use of macros, manual labor, or code duplication, challenging the notion that C++ lacks the necessary capabilities. Gain insights into advanced topics such as virtual functions, marking frameworks, and handling complex scenarios like throwing destructors and virtual inheritance. Understand the advantages and limitations of mocking in C++, and how to effectively apply these techniques to enhance your unit testing practices.

Syllabus

Intro
Marking
Mark Objects
Manual Approach
Virtual Functions
Advantages
Alternatives
Unit Tests
Marking Framework
Limitations
My malloc is not your malloc
Test code
Throwing destructor
Virtual inheritance
Callback reporting
Reify function
Update lambda
Explicit lambda
Feedback framework

Taught by

CppNow

Reviews

Start your review of Mocking C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.