]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/test/test/writing-test-ts/tools-debuggable-test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / test / test / writing-test-ts / tools-debuggable-test.cpp
1 // (C) Copyright Gennadiy Rozental 2015.
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)
5
6 // See http://www.boost.org/libs/test for the library home page.
7 //
8 // File : $RCSfile$
9 //
10 // Version : $Revision$
11 //
12 // Description : testing BOOST_TEST_UNDER_DEBUGGER compilation and operation
13 // ***************************************************************************
14
15 // Boost.Test
16 #define BOOST_TEST_TOOLS_DEBUGGABLE
17 #define BOOST_TEST_MODULE tools under debugger test
18 #include <boost/test/unit_test.hpp>
19
20 //____________________________________________________________________________//
21
22 static int
23 foo( int arg )
24 {
25 if( arg == 0 )
26 throw std::runtime_error("Oops");
27
28 return arg * arg;
29 }
30
31 //____________________________________________________________________________//
32
33 BOOST_AUTO_TEST_CASE( test )
34 {
35 int i = 2;
36 BOOST_TEST( foo(i)+1 == 5 );
37
38 BOOST_TEST( foo(i)+1 == 5, "My message" );
39
40 BOOST_CHECK_THROW( foo(0), std::runtime_error );
41 }
42
43 // EOF