]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/test/example/unit_test_example_06.cpp
1 // (C) Copyright Gennadiy Rozental 2005-2014.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
9 #define BOOST_TEST_MODULE Unit test example 06
10 #include <boost/test/unit_test.hpp>
12 //____________________________________________________________________________//
15 F() : i( 0 ) { BOOST_TEST_MESSAGE( "setup fixture" ); }
16 ~F() { BOOST_TEST_MESSAGE( "teardown fixture" ); }
21 //____________________________________________________________________________//
23 // struct F is going to be used as a fixture for all test cases in this test suite
24 BOOST_FIXTURE_TEST_SUITE( s
, F
)
26 BOOST_AUTO_TEST_CASE( my_test1
)
28 BOOST_CHECK( i
== 1 );
31 //____________________________________________________________________________//
33 BOOST_AUTO_TEST_CASE( my_test2
)
35 BOOST_CHECK_EQUAL( i
, 2 );
37 BOOST_CHECK_EQUAL( i
, 0 );
40 //____________________________________________________________________________//
42 BOOST_AUTO_TEST_SUITE_END()