C++ code examples with tests