On Github psteinb / TDD_in_Cpp
Dresden, Nov 13, 2014Peter SteinbachScionics Computer Innovation GmbH
This work is licensed under aCreative Commons Attribution 4.0 International License.
All material contained in the slides are linked to their source if not produced by the author. If you find intellectual property is not attributed to your satisfaction, feel free to contact me. For feedback, forks, discussions and contributions, go to
github.com/psteinb/TDD_in_cpp.Unit Testmethod to test smallest testable part of an application
Test Suitesequence of Unit Tests that validate the same entity
Test Fixturecalled before/after execution of unit test to setup or tear down test environment
//test inside the code in C++11 or with BOOST_STATIC_ASSERT in C++03 std::static_assert( sizeof(small_t) < sizeof(large_t) );Boost MPL Test Asserts
#include "boost/mpl/assert.hpp" BOOST_MPL_ASSERT( sizeof(small_t) < sizeof(large_t) ); BOOST_MPL_ASSERT_MSG( sizeof(small_t) < sizeof(large_t) , MESSAGE_THAT_WILL_BE_PRINTED); BOOST_MPL_ASSERT_NOT(( boost::is_same< small_t,large_t > )); BOOST_MPL_ASSERT_RELATION( sizeof(small_t), <, sizeof(large_t) );