The first step to test C++ is to pick a unit testing tool. The article propose many different open source C++ tools and the author pick up the Google Test C++ unit testing tool for his examples. The article then proposes some examples of C++ unit tests, mainly based on a Test-Driven Development (TDD). He discusses specifics aspects of unit testing like testing for exceptions, test templates and mocking.
His conclusion is that “Unit testing is one of the practices that make Agile processes viable. These processes encourage collective code ownership to avoid writing components used by just a few developers. This improves the ability to nimbly react to high-priority change needs, but this agility comes at the risk of accidentally introducing new bugs or breaking changes. A rich set of repeatable, automated unit tests will help you find these problems before Murphy does it for you.”
Read the complete article on https://visualstudiomagazine.com/articles/2013/03/08/unit-testing-with-c-plus-plus.aspx