2
0
mirror of https://github.com/boostorg/test.git synced 2026-01-27 07:22:11 +00:00
Files
test/doc/v2/examples/example19.cpp
Gennadiy Rozental ced5d625dc after review
2014-11-18 00:12:29 -05:00

31 lines
685 B
C++
Executable File

//[example_code
#define BOOST_TEST_MODULE example
#include <boost/test/included/unit_test.hpp>
struct F {
F() : i( 0 ) { BOOST_TEST_MESSAGE( "setup fixture" ); }
~F() { BOOST_TEST_MESSAGE( "teardown fixture" ); }
int i;
};
//____________________________________________________________________________//
BOOST_FIXTURE_TEST_SUITE( s, F )
BOOST_AUTO_TEST_CASE( test_case1 )
{
BOOST_CHECK( i == 1 );
}
//____________________________________________________________________________//
BOOST_AUTO_TEST_CASE( test_case2 )
{
BOOST_CHECK_EQUAL( i, 0 );
}
//____________________________________________________________________________//
BOOST_AUTO_TEST_SUITE_END()
//]