1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
// (C) Copyright Gennadiy Rozental 2005-2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
// Boost.Test
#define BOOST_TEST_MODULE Unit_test_example_04
#include <boost/test/unit_test.hpp>
//____________________________________________________________________________//
// automatically registered test cases could be organized in test suites
BOOST_AUTO_TEST_SUITE( my_suite1 )
BOOST_AUTO_TEST_CASE( my_test1 )
{
BOOST_CHECK( 2 == 1 );
}
//____________________________________________________________________________//
// this test case belongs to suite1 test suite
BOOST_AUTO_TEST_CASE( my_test2 )
{
int i = 0;
BOOST_CHECK_EQUAL( i, 2 );
BOOST_CHECK_EQUAL( i, 0 );
}
BOOST_AUTO_TEST_SUITE_END()
//____________________________________________________________________________//
// this test case belongs to master test suite
BOOST_AUTO_TEST_CASE( my_test3 )
{
int i = 0;
BOOST_CHECK_EQUAL( i, 0 );
}
//____________________________________________________________________________//
BOOST_AUTO_TEST_SUITE( my_suite2 )
// this test case belongs to suite2 test suite
BOOST_AUTO_TEST_CASE( my_test4 )
{
int i = 0;
BOOST_CHECK_EQUAL( i, 1 );
}
BOOST_AUTO_TEST_SUITE( internal_suite )
// this test case belongs to my_suite2:internal_suite test suite
BOOST_AUTO_TEST_CASE( my_test5 )
{
int i = 0;
BOOST_CHECK_EQUAL( i, 1 );
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE_END()
//____________________________________________________________________________//
// EOF
|