Dresden, Nov 13, 2014
Peter Steinbach
Scionics Computer Innovation GmbH
This work is licensed under a
Creative 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
Unit Test
method to test smallest testable part of an application
Test Suite
sequence of Unit Tests that validate the same entity
Test Fixture
called before/after execution of unit test to setup or tear down test environment
- pre-condition
(type and content of input data)- service it provides
(the responsibility it has)- post-condition
(type and content of output data)
//test inside the code in C++11 or with BOOST_STATIC_ASSERT in C++03
std::static_assert( sizeof(small_t) < sizeof(large_t) );
#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) );